radv/aco: enable VK_EXT_shader_demote_to_helper_invocation
authorDaniel Schürmann <daniel@schuermann.dev>
Tue, 17 Sep 2019 15:09:52 +0000 (17:09 +0200)
committerDaniel Schürmann <daniel@schuermann.dev>
Thu, 19 Sep 2019 10:10:00 +0000 (12:10 +0200)
For now, this extension will only be enabled for ACO.

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

index 80bd19028d2c1f04b8c56c1338e9d6338d081385..4aeaedd85a289e47165ddc77a6760119a585bb98 100644 (file)
@@ -1000,6 +1000,12 @@ void radv_GetPhysicalDeviceFeatures2(
                        features->shaderSharedInt64Atomics = LLVM_VERSION_MAJOR >= 9;
                        break;
                }
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT: {
+                       VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *features =
+                               (VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *)ext;
+                       features->shaderDemoteToHelperInvocation = pdevice->use_aco;
+                       break;
+               }
                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
                        VkPhysicalDeviceInlineUniformBlockFeaturesEXT *features =
                                (VkPhysicalDeviceInlineUniformBlockFeaturesEXT *)ext;
index eb2505ba76535a6a8c010119ebafe333dca8a301..068ca89ade9c2081ac8cf177e3c683bfffbf2634 100644 (file)
@@ -128,6 +128,7 @@ EXTENSIONS = [
     Extension('VK_EXT_sample_locations',                  1, True),
     Extension('VK_EXT_sampler_filter_minmax',             1, 'device->rad_info.chip_class >= GFX7'),
     Extension('VK_EXT_scalar_block_layout',               1, 'device->rad_info.chip_class >= GFX7'),
+    Extension('VK_EXT_shader_demote_to_helper_invocation',1, 'device->use_aco'),
     Extension('VK_EXT_shader_viewport_index_layer',       1, True),
     Extension('VK_EXT_shader_stencil_export',             1, True),
     Extension('VK_EXT_shader_subgroup_ballot',            1, True),
index 2bd4c351745393bb5e29e02371e00015fe9e1896..918fc82469f36c0a1258ac639d2d7957f6a27e2a 100644 (file)
@@ -334,6 +334,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
                                .amd_gcn_shader = true,
                                .amd_shader_ballot = device->physical_device->use_shader_ballot,
                                .amd_trinary_minmax = true,
+                               .demote_to_helper_invocation = device->physical_device->use_aco,
                                .derivative_group = true,
                                .descriptor_array_dynamic_indexing = true,
                                .descriptor_array_non_uniform_indexing = true,