summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_state_validate.c
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-12-29 23:59:08 +0100
committerMaarten Maathuis <madman2003@gmail.com>2010-01-05 19:13:34 +0100
commitc77ade8fed2be933af3f493932cedee7ca868b04 (patch)
tree4afeb8ee5930553c41bee8bc83b5715b307e09cf /src/gallium/drivers/nv50/nv50_state_validate.c
parent29d2ab37e65c9242d01f63cc5376cb6929f9285f (diff)
nouveau: rewrite nouveau_stateobj to use BEGIN_RING properly
- The previous solution was hacky and didn't do subchannel autobinding. - The beheaviour should match what libdrm_nouveau does closely. - The solution remains statically sized, but when debugging is on it will check for abuse. Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_state_validate.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_state_validate.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c
index 682786345e..f83232f43c 100644
--- a/src/gallium/drivers/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nv50/nv50_state_validate.c
@@ -33,7 +33,7 @@ static void
nv50_state_validate_fb(struct nv50_context *nv50)
{
struct nouveau_grobj *tesla = nv50->screen->tesla;
- struct nouveau_stateobj *so = so_new(128, 18);
+ struct nouveau_stateobj *so = so_new(32, 79, 18);
struct pipe_framebuffer_state *fb = &nv50->framebuffer;
unsigned i, w, h, gw = 0;
@@ -299,7 +299,7 @@ nv50_state_validate(struct nv50_context *nv50)
so_ref(nv50->rasterizer->so, &nv50->state.rast);
if (nv50->dirty & NV50_NEW_BLEND_COLOUR) {
- so = so_new(5, 0);
+ so = so_new(1, 4, 0);
so_method(so, tesla, NV50TCL_BLEND_COLOR(0), 4);
so_data (so, fui(nv50->blend_colour.color[0]));
so_data (so, fui(nv50->blend_colour.color[1]));
@@ -310,7 +310,7 @@ nv50_state_validate(struct nv50_context *nv50)
}
if (nv50->dirty & NV50_NEW_STIPPLE) {
- so = so_new(33, 0);
+ so = so_new(1, 32, 0);
so_method(so, tesla, NV50TCL_POLYGON_STIPPLE_PATTERN(0), 32);
for (i = 0; i < 32; i++)
so_data(so, util_bswap32(nv50->stipple.stipple[i]));
@@ -327,7 +327,7 @@ nv50_state_validate(struct nv50_context *nv50)
goto scissor_uptodate;
nv50->state.scissor_enabled = rast->scissor;
- so = so_new(3, 0);
+ so = so_new(1, 2, 0);
so_method(so, tesla, NV50TCL_SCISSOR_HORIZ(0), 2);
if (nv50->state.scissor_enabled) {
so_data(so, (s->maxx << 16) | s->minx);
@@ -356,7 +356,7 @@ scissor_uptodate:
goto viewport_uptodate;
nv50->state.viewport_bypass = bypass;
- so = so_new(14, 0);
+ so = so_new(5, 9, 0);
if (!bypass) {
so_method(so, tesla, NV50TCL_VIEWPORT_TRANSLATE_X(0), 3);
so_data (so, fui(nv50->viewport.translate[0]));
@@ -400,7 +400,8 @@ viewport_uptodate:
for (i = 0; i < PIPE_SHADER_TYPES; ++i)
nr += nv50->sampler_nr[i];
- so = so_new(nr * 8 + 24 * PIPE_SHADER_TYPES + 2, 4);
+ so = so_new(1+ 5 * PIPE_SHADER_TYPES, 1+ 19 * PIPE_SHADER_TYPES
+ + nr * 8, PIPE_SHADER_TYPES * 2);
nv50_validate_samplers(nv50, so, PIPE_SHADER_VERTEX);
nv50_validate_samplers(nv50, so, PIPE_SHADER_FRAGMENT);