i965/link: Use prog->nir instead of creating a temporary

This way, when NIR_PASS_V makes a clone of the shader (for testing
nir_clone), the new and lowered version gets re-assigned to prog->nir.

[jordan.l.justen@intel.com: Tested NIR_TEST_CLONE=1 with valgrind]
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Jason Ekstrand 2017-09-28 09:58:59 -07:00 committed by Jordan Justen
parent 006533d5ef
commit 2df897cf1f
1 changed files with 3 additions and 4 deletions

View File

@ -316,11 +316,10 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
continue;
struct gl_program *prog = shader->Program;
nir_shader *nir = shader->Program->nir;
brw_shader_gather_info(nir, prog);
brw_shader_gather_info(prog->nir, prog);
NIR_PASS_V(nir, nir_lower_samplers, shProg);
NIR_PASS_V(nir, nir_lower_atomics, shProg);
NIR_PASS_V(prog->nir, nir_lower_samplers, shProg);
NIR_PASS_V(prog->nir, nir_lower_atomics, shProg);
infos[stage] = &prog->nir->info;