radv: enable shaderStorageImageMultisample feature on GFX8+
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 18 Dec 2018 08:11:30 +0000 (09:11 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Dec 2018 17:01:19 +0000 (18:01 +0100)
Untested on older chips.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_formats.c
src/amd/vulkan/radv_shader.c

index cb51ee44e58da09154d08b5de2c867d961a413db..53aed1a15db56b6c1e8637a19146a3b13f7c718c 100644 (file)
@@ -736,7 +736,7 @@ void radv_GetPhysicalDeviceFeatures(
                .shaderTessellationAndGeometryPointSize   = true,
                .shaderImageGatherExtended                = true,
                .shaderStorageImageExtendedFormats        = true,
-               .shaderStorageImageMultisample            = false,
+               .shaderStorageImageMultisample            = pdevice->rad_info.chip_class >= VI,
                .shaderUniformBufferArrayDynamicIndexing  = true,
                .shaderSampledImageArrayDynamicIndexing   = true,
                .shaderStorageBufferArrayDynamicIndexing  = true,
@@ -975,7 +975,7 @@ void radv_GetPhysicalDeviceProperties(
                .sampledImageIntegerSampleCounts          = VK_SAMPLE_COUNT_1_BIT,
                .sampledImageDepthSampleCounts            = sample_counts,
                .sampledImageStencilSampleCounts          = sample_counts,
-               .storageImageSampleCounts                 = VK_SAMPLE_COUNT_1_BIT,
+               .storageImageSampleCounts                 = pdevice->rad_info.chip_class >= VI ? sample_counts : VK_SAMPLE_COUNT_1_BIT,
                .maxSampleMaskWords                       = 1,
                .timestampComputeAndGraphics              = true,
                .timestampPeriod                          = 1000000.0 / pdevice->rad_info.clock_crystal_freq,
index 843279805080b1e3b83890a31710378dd184b66a..8510f8a427ed08b94b412a8abe13a805451dbbf4 100644 (file)
@@ -1093,8 +1093,7 @@ static VkResult radv_get_image_format_properties(struct radv_physical_device *ph
            info->type == VK_IMAGE_TYPE_2D &&
            (format_feature_flags & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
                                     VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) &&
-           !(info->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) &&
-           !(info->usage & VK_IMAGE_USAGE_STORAGE_BIT)) {
+           !(info->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)) {
                sampleCounts |= VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT | VK_SAMPLE_COUNT_8_BIT;
        }
 
index 5c72890aa8eb5f627ae7b9f0fb91d9288238b906..7ad9abe8df8a2a946d74e7fa2c608fc9f693f85e 100644 (file)
@@ -245,6 +245,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
                                .storage_16bit = true,
                                .geometry_streams = true,
                                .transform_feedback = true,
+                               .storage_image_ms = true,
                        },
                };
                entry_point = spirv_to_nir(spirv, module->size / 4,