diff options
author | Christoph Bumiller <[email protected]> | 2011-08-27 20:49:36 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-08-30 13:55:07 +0200 |
commit | 222b3ea653e5525a4afa57e6a2353335953012d4 (patch) | |
tree | a0a296f28409108acfdd6830fbc8aefb0e1f55bb /src/gallium/drivers/nv50/nv50_surface.c | |
parent | 9f4998639c3c47f0b7ee3e2a29b7f3609d3f7796 (diff) |
nv50,nvc0: add states mask to state validation function
This prevents null dereferences in validation of interdependent
state after a switch to a pipe context where we mark all state
as dirty but where not all state is valid / set yet.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_surface.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_surface.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 8bca900e1ff..57339f89a36 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -370,12 +370,10 @@ nv50_clear(struct pipe_context *pipe, unsigned buffers, struct nouveau_channel *chan = nv50->screen->base.channel; struct pipe_framebuffer_state *fb = &nv50->framebuffer; unsigned i; - const unsigned dirty = nv50->dirty; uint32_t mode = 0; /* don't need NEW_BLEND, COLOR_MASK doesn't affect CLEAR_BUFFERS */ - nv50->dirty &= NV50_NEW_FRAMEBUFFER; - if (!nv50_state_validate(nv50, 9 + (fb->nr_cbufs * 2))) + if (!nv50_state_validate(nv50, NV50_NEW_FRAMEBUFFER, 9 + (fb->nr_cbufs * 2))) return; if (buffers & PIPE_CLEAR_COLOR && fb->nr_cbufs) { @@ -408,8 +406,6 @@ nv50_clear(struct pipe_context *pipe, unsigned buffers, BEGIN_RING(chan, RING_3D(CLEAR_BUFFERS), 1); OUT_RING (chan, (i << 6) | 0x3c); } - - nv50->dirty = dirty & ~NV50_NEW_FRAMEBUFFER; } @@ -851,7 +847,7 @@ nv50_resource_resolve(struct pipe_context *pipe, nv50_blitctx_prepare_state(blit); - nv50_state_validate(nv50, 36); + nv50_state_validate(nv50, ~0, 36); x_range = (float)(info->src.x1 - info->src.x0) / |