Module: Mesa
Branch: master
Commit: 2df897cf1ffd5ae01ecdbb66195d292a2a15df91
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2df897cf1ffd5ae01ecdbb66195d292a2a15df91

Author: Jason Ekstrand <jason.ekstr...@intel.com>
Date:   Thu Sep 28 09:58:59 2017 -0700

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.jus...@intel.com: Tested NIR_TEST_CLONE=1 with valgrind]
Tested-by: Jordan Justen <jordan.l.jus...@intel.com>
Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>

---

 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 dd6f895db0..1fe5ad66f5 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;
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to