[Mesa-dev] [PATCH 09/10] radv: call nir_opt_intrinsics()

Connor Abbott connora at valvesoftware.com
Tue Aug 1 02:24:16 UTC 2017


From: Connor Abbott <cwabbott0 at gmail.com>

For us, this will only lower subgroup mask instructions. It could do
other things in the future though.
---
 src/amd/vulkan/radv_pipeline.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index c4407ec..2fc64e8 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -65,6 +65,8 @@ static const struct nir_shader_compiler_options nir_options = {
 	.lower_unpack_unorm_4x8 = true,
 	.lower_extract_byte = true,
 	.lower_extract_word = true,
+	.lower_subgroup_masks = true,
+	.max_subgroup_size = 64,
 	.max_unroll_iterations = 32
 };
 
@@ -154,6 +156,7 @@ radv_optimize_nir(struct nir_shader *shader)
 		NIR_PASS_V(shader, nir_lower_64bit_pack);
                 NIR_PASS_V(shader, nir_lower_alu_to_scalar);
                 NIR_PASS_V(shader, nir_lower_phis_to_scalar);
+		NIR_PASS_V(shader, nir_opt_intrinsics);
 
                 NIR_PASS(progress, shader, nir_copy_prop);
                 NIR_PASS(progress, shader, nir_opt_remove_phis);
-- 
2.9.4



More information about the mesa-dev mailing list