Mesa (master): intel/fs: Don't loop when lowering CS intrinsics

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 9 03:29:09 UTC 2019


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

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Tue Apr  2 17:41:07 2019 -0700

intel/fs: Don't loop when lowering CS intrinsics

This was needed when certain intrinsics were lowered to other ones
that were defined by the same pass.  After 060817b2 "intel,nir: Move
gl_LocalInvocationID lowering to nir_lower_system_values" we don't
need the loop anymore.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/compiler/brw_nir_lower_cs_intrinsics.c | 25 ++++++++++--------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/src/intel/compiler/brw_nir_lower_cs_intrinsics.c b/src/intel/compiler/brw_nir_lower_cs_intrinsics.c
index 6180e6a706b..434ad005281 100644
--- a/src/intel/compiler/brw_nir_lower_cs_intrinsics.c
+++ b/src/intel/compiler/brw_nir_lower_cs_intrinsics.c
@@ -193,11 +193,10 @@ brw_nir_lower_cs_intrinsics(nir_shader *nir,
 {
    assert(nir->info.stage == MESA_SHADER_COMPUTE);
 
-   bool progress = false;
-   struct lower_intrinsics_state state;
-   memset(&state, 0, sizeof(state));
-   state.nir = nir;
-   state.dispatch_width = dispatch_width;
+   struct lower_intrinsics_state state = {
+      .nir = nir,
+      .dispatch_width = dispatch_width,
+   };
 
    assert(!nir->info.cs.local_size_variable);
    state.local_workgroup_size = nir->info.cs.local_size[0] *
@@ -212,16 +211,12 @@ brw_nir_lower_cs_intrinsics(nir_shader *nir,
       assert(state.local_workgroup_size % 4 == 0);
    }
 
-   do {
-      state.progress = false;
-      nir_foreach_function(function, nir) {
-         if (function->impl) {
-            state.impl = function->impl;
-            lower_cs_intrinsics_convert_impl(&state);
-         }
+   nir_foreach_function(function, nir) {
+      if (function->impl) {
+         state.impl = function->impl;
+         lower_cs_intrinsics_convert_impl(&state);
       }
-      progress |= state.progress;
-   } while (state.progress);
+   }
 
-   return progress;
+   return state.progress;
 }




More information about the mesa-commit mailing list