summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv40/nv40_state.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-02-16 21:27:53 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-02-18 12:46:25 +1100
commit5e091b573aa0a0c45f8ff34429f2a9d4198bb80a (patch)
tree0f5466954eeed371b00d5487989e1602398435c7 /src/gallium/drivers/nv40/nv40_state.c
parent9a6c39bd2e857398199f46f302a70317a70e3a8d (diff)
nv40: ensure scissor gets disabled where necessary
Fixes progs/demos/lodbias. Makes a complete mess of things, but now there's a motivation to finish this off :)
Diffstat (limited to 'src/gallium/drivers/nv40/nv40_state.c')
-rw-r--r--src/gallium/drivers/nv40/nv40_state.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gallium/drivers/nv40/nv40_state.c b/src/gallium/drivers/nv40/nv40_state.c
index 713f31dbb1..bb9b6b139f 100644
--- a/src/gallium/drivers/nv40/nv40_state.c
+++ b/src/gallium/drivers/nv40/nv40_state.c
@@ -278,12 +278,12 @@ nv40_rasterizer_state_create(struct pipe_context *pipe,
const struct pipe_rasterizer_state *cso)
{
struct nv40_context *nv40 = nv40_context(pipe);
+ struct nv40_rasterizer_state *rsso = MALLOC(sizeof(*rsso));
struct nouveau_stateobj *so = so_new(32, 0);
/*XXX: ignored:
* light_twoside
* offset_cw/ccw -nohw
- * scissor
* point_smooth -nohw
* multisample
* offset_units / offset_scale
@@ -362,24 +362,29 @@ nv40_rasterizer_state_create(struct pipe_context *pipe,
so_data(so, 0);
}
- return (void *)so;
+ rsso->so = so;
+ rsso->pipe = *cso;
+ return (void *)rsso;
}
static void
nv40_rasterizer_state_bind(struct pipe_context *pipe, void *hwcso)
{
struct nv40_context *nv40 = nv40_context(pipe);
+ struct nv40_rasterizer_state *rsso = hwcso;
- so_ref(hwcso, &nv40->so_rast);
+ so_ref(rsso->so, &nv40->so_rast);
+ nv40->rasterizer = rsso;
nv40->dirty |= NV40_NEW_RAST;
}
static void
nv40_rasterizer_state_delete(struct pipe_context *pipe, void *hwcso)
{
- struct nouveau_stateobj *so = hwcso;
+ struct nv40_rasterizer_state *rsso = hwcso;
- so_ref(NULL, &so);
+ so_ref(NULL, &rsso->so);
+ free(rsso);
}
static void *
@@ -723,14 +728,8 @@ nv40_set_scissor_state(struct pipe_context *pipe,
const struct pipe_scissor_state *s)
{
struct nv40_context *nv40 = nv40_context(pipe);
- struct nouveau_stateobj *so = so_new(3, 0);
- so_method(so, nv40->hw->curie, NV40TCL_SCISSOR_HORIZ, 2);
- so_data (so, ((s->maxx - s->minx) << 16) | s->minx);
- so_data (so, ((s->maxy - s->miny) << 16) | s->miny);
-
- so_ref(so, &nv40->so_scissor);
- so_ref(NULL, &so);
+ nv40->pipe_state.scissor = *s;
nv40->dirty |= NV40_NEW_SCISSOR;
}