[Mesa-dev] [PATCH 7/7] radv: enable subgroup capabilities
Daniel Schürmann
daniel.schuermann at campus.tu-berlin.de
Thu Mar 8 17:10:44 UTC 2018
---
src/amd/vulkan/radv_device.c | 12 ++++++++++--
src/amd/vulkan/radv_shader.c | 6 +++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 7a11e08f97..4200eb7d7d 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -929,8 +929,16 @@ void radv_GetPhysicalDeviceProperties2(
(VkPhysicalDeviceSubgroupProperties*)ext;
properties->subgroupSize = 64;
properties->supportedStages = VK_SHADER_STAGE_ALL;
- properties->supportedOperations = VK_SUBGROUP_FEATURE_BASIC_BIT;
- properties->quadOperationsInAllStages = false;
+ properties->supportedOperations =
+ VK_SUBGROUP_FEATURE_BASIC_BIT |
+ VK_SUBGROUP_FEATURE_BALLOT_BIT |
+ VK_SUBGROUP_FEATURE_QUAD_BIT |
+ VK_SUBGROUP_FEATURE_SHUFFLE_BIT |
+ VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT |
+ VK_SUBGROUP_FEATURE_VOTE_BIT |
+ (HAVE_LLVM >= 0x600 && pdevice->rad_info.chip_class >= VI ?
+ VK_SUBGROUP_FEATURE_ARITHMETIC_BIT : 0);
+ properties->quadOperationsInAllStages = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 85672e600d..ae139b6dcd 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -212,7 +212,12 @@ 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,
+ .subgroup_shuffle = true,
+ .subgroup_vote = true,
.variable_pointers = true,
},
.exts = {
@@ -278,7 +283,6 @@ radv_shader_compile_to_nir(struct radv_device *device,
.lower_to_scalar = 1,
.lower_subgroup_masks = 1,
.lower_shuffle = 1,
- .lower_quad = 1,
});
radv_optimize_nir(nir);
--
2.14.1
More information about the mesa-dev
mailing list