Mesa (master): radv: fix conditions for running nir_opt_vectorize

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 14 12:41:27 UTC 2021


Module: Mesa
Branch: master
Commit: e3ebc1ca4bd3d744ae69c9a1bba45eb893fda0ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3ebc1ca4bd3d744ae69c9a1bba45eb893fda0ba

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Wed Apr 14 10:18:17 2021 +0100

radv: fix conditions for running nir_opt_vectorize

No fossil-db changes, probably because all fp16 shaders have at least one
16-bit mov or vec2 somehwere.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10227>

---

 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]);



More information about the mesa-commit mailing list