[Mesa-dev] [PATCH 09/14] st/glsl_to_nir: enable NIR opts

Timothy Arceri tarceri at itsqueeze.com
Tue Nov 21 03:37:30 UTC 2017


---
 src/mesa/state_tracker/st_glsl_to_nir.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 7d66a85a10..e83b5dd2ef 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -293,21 +293,25 @@ st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
 
    assert(pscreen->get_compiler_options);   /* drivers using NIR must implement this */
 
    options = (const nir_shader_compiler_options *)
       pscreen->get_compiler_options(pscreen, PIPE_SHADER_IR_NIR, ptarget);
    assert(options);
 
    if (prog->nir)
       return prog->nir;
 
-   return glsl_to_nir(shader_program, stage, options);
+   nir_shader *nir = glsl_to_nir(shader_program, stage, options);
+
+   st_nir_opts(nir);
+
+   return nir;
 }
 
 /* Second third of converting glsl_to_nir. This creates uniforms, gathers
  * info on varyings, etc after NIR link time opts have been applied.
  */
 static void
 st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog,
                          struct gl_shader_program *shader_program)
 {
    nir_shader *nir = prog->nir;
-- 
2.14.3



More information about the mesa-dev mailing list