summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv30/nv30_state.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2010-02-11 20:55:33 +0100
committerRoland Scheidegger <sroland@vmware.com>2010-02-11 20:55:33 +0100
commitbedb6faec0882cf01ae8773f2ea685135471a87b (patch)
tree2b266e730364b12ccbef784d7eb80a8211e1416f /src/gallium/drivers/nv30/nv30_state.c
parented0f3b08b65679452132a9caeef1509a8dac23b9 (diff)
nv30: adapt to stencil ref changes
not sure if this has any hope of working
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_state.c')
-rw-r--r--src/gallium/drivers/nv30/nv30_state.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/gallium/drivers/nv30/nv30_state.c b/src/gallium/drivers/nv30/nv30_state.c
index f775938ba7..8fc6856ee5 100644
--- a/src/gallium/drivers/nv30/nv30_state.c
+++ b/src/gallium/drivers/nv30/nv30_state.c
@@ -435,7 +435,7 @@ nv30_depth_stencil_alpha_state_create(struct pipe_context *pipe,
{
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_zsa_state *zsaso = CALLOC(1, sizeof(*zsaso));
- struct nouveau_stateobj *so = so_new(5, 21, 0);
+ struct nouveau_stateobj *so = so_new(6, 20, 0);
struct nouveau_grobj *rankine = nv30->screen->rankine;
so_method(so, rankine, NV34TCL_DEPTH_FUNC, 3);
@@ -449,11 +449,11 @@ nv30_depth_stencil_alpha_state_create(struct pipe_context *pipe,
so_data (so, float_to_ubyte(cso->alpha.ref_value));
if (cso->stencil[0].enabled) {
- so_method(so, rankine, NV34TCL_STENCIL_FRONT_ENABLE, 8);
+ so_method(so, rankine, NV34TCL_STENCIL_FRONT_ENABLE, 3);
so_data (so, cso->stencil[0].enabled ? 1 : 0);
so_data (so, cso->stencil[0].writemask);
so_data (so, nvgl_comparison_op(cso->stencil[0].func));
- so_data (so, cso->stencil[0].ref_value);
+ so_method(so, rankine, NV34TCL_STENCIL_FRONT_FUNC_MASK, 4);
so_data (so, cso->stencil[0].valuemask);
so_data (so, nvgl_stencil_op(cso->stencil[0].fail_op));
so_data (so, nvgl_stencil_op(cso->stencil[0].zfail_op));
@@ -464,11 +464,11 @@ nv30_depth_stencil_alpha_state_create(struct pipe_context *pipe,
}
if (cso->stencil[1].enabled) {
- so_method(so, rankine, NV34TCL_STENCIL_BACK_ENABLE, 8);
+ so_method(so, rankine, NV34TCL_STENCIL_BACK_ENABLE, 3);
so_data (so, cso->stencil[1].enabled ? 1 : 0);
so_data (so, cso->stencil[1].writemask);
so_data (so, nvgl_comparison_op(cso->stencil[1].func));
- so_data (so, cso->stencil[1].ref_value);
+ so_method(so, rankine, NV34TCL_STENCIL_BACK_FUNC_MASK, 4);
so_data (so, cso->stencil[1].valuemask);
so_data (so, nvgl_stencil_op(cso->stencil[1].fail_op));
so_data (so, nvgl_stencil_op(cso->stencil[1].zfail_op));
@@ -583,6 +583,16 @@ nv30_set_blend_color(struct pipe_context *pipe,
}
static void
+nv30_set_stencil_ref(struct pipe_context *pipe,
+ const struct pipe_stencil_ref *sr)
+{
+ struct nv30_context *nv30 = nv30_context(pipe);
+
+ nv30->stencil_ref = *sr;
+ nv30->dirty |= NV30_NEW_SR;
+}
+
+static void
nv30_set_clip_state(struct pipe_context *pipe,
const struct pipe_clip_state *clip)
{
@@ -704,6 +714,7 @@ nv30_init_state_functions(struct nv30_context *nv30)
nv30->pipe.delete_fs_state = nv30_fp_state_delete;
nv30->pipe.set_blend_color = nv30_set_blend_color;
+ nv30->pipe.set_stencil_ref = nv30_set_stencil_ref;
nv30->pipe.set_clip_state = nv30_set_clip_state;
nv30->pipe.set_constant_buffer = nv30_set_constant_buffer;
nv30->pipe.set_framebuffer_state = nv30_set_framebuffer_state;