Mesa (master): nv30: fp/rast may be null when validating fb/ scissor due to clear

Ilia Mirkin imirkin at kemper.freedesktop.org
Sun Apr 2 15:14:38 UTC 2017


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sun Apr  2 10:57:39 2017 -0400

nv30: fp/rast may be null when validating fb/scissor due to clear

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nouveau/nv30/nv30_state_validate.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c b/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
index f6acd246da..4ed94e0b4e 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
@@ -225,14 +225,15 @@ nv30_validate_scissor(struct nv30_context *nv30)
 {
    struct nouveau_pushbuf *push = nv30->base.pushbuf;
    struct pipe_scissor_state *s = &nv30->scissor;
+   bool rast_scissor = nv30->rast ? nv30->rast->pipe.scissor : false;
 
    if (!(nv30->dirty & NV30_NEW_SCISSOR) &&
-       nv30->rast->pipe.scissor != nv30->state.scissor_off)
+       rast_scissor != nv30->state.scissor_off)
       return;
-   nv30->state.scissor_off = !nv30->rast->pipe.scissor;
+   nv30->state.scissor_off = !rast_scissor;
 
    BEGIN_NV04(push, NV30_3D(SCISSOR_HORIZ), 2);
-   if (nv30->rast->pipe.scissor) {
+   if (rast_scissor) {
       PUSH_DATA (push, ((s->maxx - s->minx) << 16) | s->minx);
       PUSH_DATA (push, ((s->maxy - s->miny) << 16) | s->miny);
    } else {
@@ -344,9 +345,9 @@ nv30_validate_fragment(struct nv30_context *nv30)
    struct nv30_fragprog *fp = nv30->fragprog.program;
 
    BEGIN_NV04(push, NV30_3D(RT_ENABLE), 1);
-   PUSH_DATA (push, nv30->state.rt_enable & ~fp->rt_enable);
+   PUSH_DATA (push, nv30->state.rt_enable & (fp ? ~fp->rt_enable : 0x1f));
    BEGIN_NV04(push, NV30_3D(COORD_CONVENTIONS), 1);
-   PUSH_DATA (push, fp->coord_conventions | nv30->framebuffer.height);
+   PUSH_DATA (push, (fp ? fp->coord_conventions : 0) | nv30->framebuffer.height);
 }
 
 static void




More information about the mesa-commit mailing list