Mesa (master): intel/fs: Remove unused state from brw_nir_lower_cs_intrinsics

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 26 20:45:57 UTC 2020


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

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Wed May 20 02:37:49 2020 -0700

intel/fs: Remove unused state from brw_nir_lower_cs_intrinsics

After 2663759af0e ("intel/fs: Add and use a new load_simd_width_intel
intrinsic") the local_workgroup_size is not used anymore except for
assertions at the pass' start, so drop it from state struct.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5213>

---

 src/intel/compiler/brw_nir_lower_cs_intrinsics.c | 27 ++++++++++--------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/src/intel/compiler/brw_nir_lower_cs_intrinsics.c b/src/intel/compiler/brw_nir_lower_cs_intrinsics.c
index 883fc469924..7c08b36aab6 100644
--- a/src/intel/compiler/brw_nir_lower_cs_intrinsics.c
+++ b/src/intel/compiler/brw_nir_lower_cs_intrinsics.c
@@ -29,7 +29,6 @@ struct lower_intrinsics_state {
    nir_function_impl *impl;
    bool progress;
    nir_builder builder;
-   unsigned local_workgroup_size;
 };
 
 static bool
@@ -203,22 +202,18 @@ brw_nir_lower_cs_intrinsics(nir_shader *nir)
       .nir = nir,
    };
 
-   if (!nir->info.cs.local_size_variable) {
-      state.local_workgroup_size = nir->info.cs.local_size[0] *
-                                   nir->info.cs.local_size[1] *
-                                   nir->info.cs.local_size[2];
-   } else {
-      state.local_workgroup_size = nir->info.cs.max_variable_local_size;
-   }
-
    /* Constraints from NV_compute_shader_derivatives. */
-   if (nir->info.cs.derivative_group == DERIVATIVE_GROUP_QUADS &&
-       !nir->info.cs.local_size_variable) {
-      assert(nir->info.cs.local_size[0] % 2 == 0);
-      assert(nir->info.cs.local_size[1] % 2 == 0);
-   } else if (nir->info.cs.derivative_group == DERIVATIVE_GROUP_LINEAR &&
-              !nir->info.cs.local_size_variable) {
-      assert(state.local_workgroup_size % 4 == 0);
+   if (!nir->info.cs.local_size_variable) {
+      if (nir->info.cs.derivative_group == DERIVATIVE_GROUP_QUADS) {
+         assert(nir->info.cs.local_size[0] % 2 == 0);
+         assert(nir->info.cs.local_size[1] % 2 == 0);
+      } else if (nir->info.cs.derivative_group == DERIVATIVE_GROUP_LINEAR) {
+         ASSERTED unsigned local_workgroup_size =
+            nir->info.cs.local_size[0] *
+            nir->info.cs.local_size[1] *
+            nir->info.cs.local_size[2];
+         assert(local_workgroup_size % 4 == 0);
+      }
    }
 
    nir_foreach_function(function, nir) {



More information about the mesa-commit mailing list