st/nir: Move lower_deref_instrs later
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 20 Mar 2018 19:28:35 +0000 (12:28 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 23 Jun 2018 03:15:57 +0000 (20:15 -0700)
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/state_tracker/st_glsl_to_nir.cpp

index 6d5881084d36d7ef117e697163853070676aa02c..fa1fbbf3a3da278d32dd4c99f8382091cbcc5593 100644 (file)
@@ -376,7 +376,6 @@ st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
       return prog->nir;
 
    nir_shader *nir = glsl_to_nir(shader_program, stage, options);
-   nir_lower_deref_instrs(nir, (nir_lower_deref_flags)~0);
 
    /* Set the next shader stage hint for VS and TES. */
    if (!nir->info.separate_shader &&
@@ -590,6 +589,8 @@ st_nir_get_mesa_program(struct gl_context *ctx,
 
    nir_shader *nir = st_glsl_to_nir(st, prog, shader_program, shader->Stage);
 
+   nir_lower_deref_instrs(nir, (nir_lower_deref_flags)~0);
+
    set_st_program(prog, shader_program, nir);
    prog->nir = nir;
 }