Mesa (master): radv/aco: enable VK_EXT_shader_demote_to_helper_invocation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 19 10:33:40 UTC 2019


Module: Mesa
Branch: master
Commit: 281262281b7fc76016fa216f9c9a6a16a564206d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=281262281b7fc76016fa216f9c9a6a16a564206d

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Tue Sep 17 17:09:52 2019 +0200

radv/aco: enable VK_EXT_shader_demote_to_helper_invocation

For now, this extension will only be enabled for ACO.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_device.c      | 6 ++++++
 src/amd/vulkan/radv_extensions.py | 1 +
 src/amd/vulkan/radv_shader.c      | 1 +
 3 files changed, 8 insertions(+)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 80bd19028d2..4aeaedd85a2 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -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;
diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py
index eb2505ba765..068ca89ade9 100644
--- a/src/amd/vulkan/radv_extensions.py
+++ b/src/amd/vulkan/radv_extensions.py
@@ -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),
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 2bd4c351745..918fc82469f 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -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,




More information about the mesa-commit mailing list