radv: Enable lowering dynamic quad broadcasts.
authorTimur Kristóf <timur.kristof@gmail.com>
Wed, 11 Mar 2020 14:05:47 +0000 (15:05 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 12 Mar 2020 13:16:07 +0000 (13:16 +0000)
This will lower dynamic quad broadcasts into something that both
LLVM and ACO can understand. On hardware which supports shuffles,
they are lowered to shuffle, on older hardware (GFX6-7) they will
get lowered to constant quad broadcasts.

Fixes dEQP-VK.subgroups.quad.*.subgroupquadbroadcast_nonconst_*

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4147>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4147>

src/amd/vulkan/radv_shader.c

index 37b8ee45e3445c734212297665273c60bb5b4e4e..049611371f6d7148c66eb9e074635efaceddfa12 100644 (file)
@@ -480,6 +480,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
 
        nir_lower_global_vars_to_local(nir);
        nir_remove_dead_variables(nir, nir_var_function_temp);
+       bool gfx7minus = device->physical_device->rad_info.chip_class <= GFX7;
        nir_lower_subgroups(nir, &(struct nir_lower_subgroups_options) {
                        .subgroup_size = 64,
                        .ballot_bit_size = 64,
@@ -488,6 +489,8 @@ radv_shader_compile_to_nir(struct radv_device *device,
                        .lower_shuffle = 1,
                        .lower_shuffle_to_32bit = 1,
                        .lower_vote_eq_to_ballot = 1,
+                       .lower_quad_broadcast_dynamic = 1,
+                       .lower_quad_broadcast_dynamic_to_const = gfx7minus,
                });
 
        nir_lower_load_const_to_scalar(nir);