[Mesa-dev] [PATCH 2/2] radv: enable subgroups arithmetic for VI+

Daniel Schürmann daniel.schuermann at campus.tu-berlin.de
Fri May 4 18:32:16 UTC 2018


---
 src/amd/vulkan/radv_device.c | 4 +++-
 src/amd/vulkan/radv_shader.c | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 9fe415c4e0..ec60f9a9c5 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -970,7 +970,9 @@ void radv_GetPhysicalDeviceProperties2(
 							VK_SUBGROUP_FEATURE_QUAD_BIT |
 							VK_SUBGROUP_FEATURE_SHUFFLE_BIT |
 							VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT |
-							VK_SUBGROUP_FEATURE_VOTE_BIT;
+							VK_SUBGROUP_FEATURE_VOTE_BIT |
+							(pdevice->rad_info.chip_class >= VI && HAVE_LLVM >= 0x0600 ?
+							VK_SUBGROUP_FEATURE_ARITHMETIC_BIT : 0 );
 			properties->quadOperationsInAllStages = true;
 			break;
 		}
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 27b3fbed16..953cebb7e8 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -213,6 +213,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
 				.tessellation = true,
 				.int64 = true,
 				.multiview = true,
+				.subgroup_arithmetic = true,
 				.subgroup_ballot = true,
 				.subgroup_basic = true,
 				.subgroup_quad = true,
-- 
2.17.0



More information about the mesa-dev mailing list