From e3ebc1ca4bd3d744ae69c9a1bba45eb893fda0ba Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 14 Apr 2021 10:18:17 +0100 Subject: [PATCH] radv: fix conditions for running nir_opt_vectorize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No fossil-db changes, probably because all fp16 shaders have at least one 16-bit mov or vec2 somehwere. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/vulkan/radv_pipeline.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index dab428497c4..7db89b54d6e 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3375,9 +3375,10 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_device *device, if (device->physical_device->rad_info.chip_class >= GFX8) nir_opt_remove_phis(nir[i]); /* cleanup LCSSA phis */ - if (device->physical_device->rad_info.chip_class >= GFX9) - NIR_PASS_V(nir[i], nir_opt_vectorize, opt_vectorize_callback, NULL); } + if (((nir[i]->info.bit_sizes_int | nir[i]->info.bit_sizes_float) & 16) && + device->physical_device->rad_info.chip_class >= GFX9) + NIR_PASS_V(nir[i], nir_opt_vectorize, opt_vectorize_callback, NULL); /* cleanup passes */ nir_lower_load_const_to_scalar(nir[i]);