[Mesa-dev] [PATCH] nv50: don't assume a rast is set when validating scissors
Ilia Mirkin
imirkin at alum.mit.edu
Sun Mar 5 23:56:16 UTC 2017
Clears can happen before a rast is set, which can in turn cause scissors
to be validated. Make sure that we handle this case.
Reported-by: Andrew Randrianasulu <randrianasulu at gmail.com>
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/gallium/drivers/nouveau/nv50/nv50_state_validate.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c b/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
index c6f0363..fcf2228 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
@@ -186,16 +186,17 @@ nv50_validate_scissor(struct nv50_context *nv50)
struct nouveau_pushbuf *push = nv50->base.pushbuf;
#ifdef NV50_SCISSORS_CLIPPING
int minx, maxx, miny, maxy, i;
+ bool rast_scissor = nv50->rast ? nv50->rast->pipe.scissor : false;
if (!(nv50->dirty_3d &
(NV50_NEW_3D_SCISSOR | NV50_NEW_3D_VIEWPORT | NV50_NEW_3D_FRAMEBUFFER)) &&
- nv50->state.scissor == nv50->rast->pipe.scissor)
+ nv50->state.scissor == rast_scissor)
return;
- if (nv50->state.scissor != nv50->rast->pipe.scissor)
+ if (nv50->state.scissor != rast_scissor)
nv50->scissors_dirty = (1 << NV50_MAX_VIEWPORTS) - 1;
- nv50->state.scissor = nv50->rast->pipe.scissor;
+ nv50->state.scissor = rast_scissor;
if ((nv50->dirty_3d & NV50_NEW_3D_FRAMEBUFFER) && !nv50->state.scissor)
nv50->scissors_dirty = (1 << NV50_MAX_VIEWPORTS) - 1;
--
2.10.2
More information about the mesa-dev
mailing list