From a3a1a8b1d059a420e574110c0394a103871f8350 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Thu, 25 Jan 2024 14:36:52 +0100 Subject: [PATCH] radv: enable VK_KHR_shader_subgroup_rotate Reviewed-by: Samuel Pitoiset Part-of: --- docs/features.txt | 1 + docs/relnotes/new_features.txt | 1 + src/amd/vulkan/radv_physical_device.c | 5 +++++ src/amd/vulkan/radv_shader.c | 2 ++ 4 files changed, 9 insertions(+) diff --git a/docs/features.txt b/docs/features.txt index d9557875c57..4469ccc7df6 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -532,6 +532,7 @@ Khronos extensions that are not part of any Vulkan version: VK_KHR_ray_tracing_pipeline DONE (anv/gfx12.5+, radv/gfx10.3+) VK_KHR_ray_tracing_position_fetch DONE (radv/gfx10.3+) VK_KHR_shader_clock DONE (anv, hasvk, lvp, nvk, radv, vn) + VK_KHR_shader_subgroup_rotate DONE (radv) VK_KHR_shader_subgroup_uniform_control_flow DONE (anv, hasvk, radv) VK_KHR_shared_presentable_image not started VK_KHR_surface DONE (anv, dzn, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn) diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index e69de29bb2d..9c46926eb39 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -0,0 +1 @@ +VK_KHR_shader_subgroup_rotate on RADV diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index 867a0956e46..47ee5a1b9b5 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -496,6 +496,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device .KHR_shader_integer_dot_product = true, .KHR_shader_non_semantic_info = true, .KHR_shader_subgroup_extended_types = true, + .KHR_shader_subgroup_rotate = true, .KHR_shader_subgroup_uniform_control_flow = true, .KHR_shader_terminate_invocation = true, .KHR_spirv_1_4 = true, @@ -1111,6 +1112,10 @@ radv_physical_device_get_features(const struct radv_physical_device *pdevice, st /* VK_KHR_maintenance6 */ .maintenance6 = true, + + /* VK_KHR_shader_subgroup_rotate */ + .shaderSubgroupRotate = true, + .shaderSubgroupRotateClustered = true, }; } diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 6bd40256786..d19160abd87 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -400,6 +400,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st .subgroup_ballot = true, .subgroup_basic = true, .subgroup_quad = true, + .subgroup_rotate = true, .subgroup_shuffle = true, .subgroup_uniform_control_flow = true, .subgroup_vote = true, @@ -609,6 +610,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st .lower_to_scalar = 1, .lower_subgroup_masks = 1, .lower_relative_shuffle = 1, + .lower_rotate_to_shuffle = radv_use_llvm_for_stage(device, nir->info.stage), .lower_shuffle_to_32bit = 1, .lower_vote_eq = 1, .lower_vote_bool_eq = 1,