st/glsl_to_nir: fix the case where NIR clone testing is enabled
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sun, 25 Jun 2017 13:26:47 +0000 (15:26 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 31 Jul 2017 12:55:29 +0000 (14:55 +0200)
In that case, prog->nir must be assigned at the end.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_nir.cpp

index 89f78884389ff25bb2314e6782a88d7e877175b1..5c4ae81305523ed7f343ba538fc8d3015825e1d6 100644 (file)
@@ -236,7 +236,6 @@ st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
       return prog->nir;
 
    nir = glsl_to_nir(shader_program, stage, options);
-   prog->nir = nir;
 
    NIR_PASS_V(nir, nir_lower_io_to_temporaries,
          nir_shader_get_entrypoint(nir),
@@ -281,6 +280,8 @@ st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
       _mesa_log("\n\n");
    }
 
+   prog->nir = nir;
+
    return nir;
 }