Mesa (master): nir: Fix crash in nir_lower_drawpixels.

Eric Anholt anholt at kemper.freedesktop.org
Mon Aug 22 19:11:32 UTC 2016


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Aug 19 15:38:08 2016 -0700

nir: Fix crash in nir_lower_drawpixels.

Generally you'd see the gl_Color reference first and get some cursor set.
However, in piglit draw-pixel-with-texture we're now seeing the TexCoord
dereferenced first.

Reviewed-by: Rob Clark <robdclark at gmail.com>

---

 src/compiler/nir/nir_lower_drawpixels.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir_lower_drawpixels.c b/src/compiler/nir/nir_lower_drawpixels.c
index a71bccd..54f3ea0 100644
--- a/src/compiler/nir/nir_lower_drawpixels.c
+++ b/src/compiler/nir/nir_lower_drawpixels.c
@@ -194,6 +194,8 @@ lower_color(lower_drawpixels_state *state, nir_intrinsic_instr *intr)
 static void
 lower_texcoord(lower_drawpixels_state *state, nir_intrinsic_instr *intr)
 {
+   state->b.cursor = nir_before_instr(&intr->instr);
+
    nir_ssa_def *texcoord_const = get_texcoord_const(state);
    nir_ssa_def_rewrite_uses(&intr->dest.ssa, nir_src_for_ssa(texcoord_const));
 }




More information about the mesa-commit mailing list