diff options
author | Ben Skeggs <[email protected]> | 2010-03-03 14:43:21 +1000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2010-03-10 16:29:58 +1000 |
commit | e1d015fe222a3f6f942426c39fb1a17188df8d57 (patch) | |
tree | 393856ee4899e39b1e0b27f5dbd3582c516c8b0f /src/gallium/drivers/nv50/nv50_vbo.c | |
parent | 62ab89785b55e60b978dc2b32995676859299c80 (diff) |
nv50: ensure enough room for state changes in current pushbuf
Also allows the nv50_state_validate() caller to request a minimum amount
of space that itself requires, not all callers accurately use this yet
but the simple cases are now accounted for.
Rendering will also be dropped on the floor if validate fails now.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_vbo.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_vbo.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 3e540013c42..ce2e479cfda 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -425,7 +425,8 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, if (!NV50_USING_LOATHED_EDGEFLAG(nv50)) nv50_upload_user_vbufs(nv50); - nv50_state_validate(nv50); + if (!nv50_state_validate(nv50, 0)) + return; nz_divisors = init_per_instance_arrays(nv50, startInstance, pos, step); @@ -477,7 +478,8 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, struct nouveau_grobj *tesla = nv50->screen->tesla; boolean ret; - nv50_state_validate(nv50); + if (!nv50_state_validate(nv50, 11)) + return; BEGIN_RING(chan, tesla, 0x142c, 1); OUT_RING (chan, 0); @@ -633,7 +635,8 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, if (!NV50_USING_LOATHED_EDGEFLAG(nv50)) nv50_upload_user_vbufs(nv50); - nv50_state_validate(nv50); + if (!nv50_state_validate(nv50, 0)) + return; nz_divisors = init_per_instance_arrays(nv50, startInstance, pos, step); @@ -677,7 +680,8 @@ nv50_draw_elements(struct pipe_context *pipe, struct pipe_screen *pscreen = pipe->screen; void *map; - nv50_state_validate(nv50); + if (!nv50_state_validate(nv50, 14)) + return; BEGIN_RING(chan, tesla, 0x142c, 1); OUT_RING (chan, 0); |