Mesa (main): glsl: inline do_common_optimization() call

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 8 23:46:59 UTC 2022


Module: Mesa
Branch: main
Commit: 893b4d98f8e1f779682e70c46b8525f58c42c5c6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=893b4d98f8e1f779682e70c46b8525f58c42c5c6

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Wed Jun  8 14:54:46 2022 +1000

glsl: inline do_common_optimization() call

The function was previously a helper for when some drivers still
called the GLSL IR optimisations in a loop. No drivers do that
anymore.

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16924>

---

 src/compiler/glsl/linker.cpp | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 8d9bb3763c9..3a8b9b5ebf1 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3561,15 +3561,6 @@ link_varyings(const struct gl_constants *consts, struct gl_shader_program *prog,
    return true;
 }
 
-static void
-linker_optimisation_loop(const struct gl_constants *consts, exec_list *ir,
-                         unsigned stage)
-{
-   /* Run it just once, since NIR will do the real optimizaiton. */
-   do_common_optimization(ir, true, &consts->ShaderCompilerOptions[stage],
-                           consts->NativeIntegers);
-}
-
 void
 link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
 {
@@ -3907,10 +3898,10 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
          }
       }
 
-      /* Call opts before lowering const arrays to uniforms so we can const
-       * propagate any elements accessed directly.
-       */
-      linker_optimisation_loop(consts, prog->_LinkedShaders[i]->ir, i);
+      /* Run it just once, since NIR will do the real optimizaiton. */
+      do_common_optimization(prog->_LinkedShaders[i]->ir, true,
+                             &consts->ShaderCompilerOptions[i],
+                             consts->NativeIntegers);
    }
 
    /* Check and validate stream emissions in geometry shaders */



More information about the mesa-commit mailing list