From 2df897cf1ffd5ae01ecdbb66195d292a2a15df91 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 28 Sep 2017 09:58:59 -0700 Subject: [PATCH] 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 Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_link.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index dd6f895db07..1fe5ad66f54 100644 --- a/src/mesa/drivers/dri/i965/brw_link.cpp +++ b/src/mesa/drivers/dri/i965/brw_link.cpp @@ -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; -- 2.30.2