diff options
author | Roland Scheidegger <[email protected]> | 2010-02-11 18:48:57 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2010-02-11 18:48:57 +0100 |
commit | bf4b0773c570017c1c3ec80da769bf5c39a685b2 (patch) | |
tree | d2bed0e38cd84227e837f890dd89d20c0dd52b24 /src/gallium/drivers/r300/r300_state.c | |
parent | 94c035f61d38e198382c90b1a113817dc018ea36 (diff) |
r300g: adapt to stencil ref changes
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index d07e90860c2..a6a4f99d730 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -425,7 +425,7 @@ static void* (r300_translate_stencil_op(state->stencil[0].zfail_op) << R300_S_FRONT_ZFAIL_OP_SHIFT); - dsa->stencil_ref_mask = (state->stencil[0].ref_value) | + dsa->stencil_ref_mask = (state->stencil[0].valuemask << R300_STENCILMASK_SHIFT) | (state->stencil[0].writemask << R300_STENCILWRITEMASK_SHIFT); @@ -444,7 +444,7 @@ static void* if (caps->is_r500) { dsa->z_buffer_control |= R500_STENCIL_REFMASK_FRONT_BACK; - dsa->stencil_ref_bf = (state->stencil[1].ref_value) | + dsa->stencil_ref_bf = (state->stencil[1].valuemask << R300_STENCILMASK_SHIFT) | (state->stencil[1].writemask << @@ -488,6 +488,14 @@ static void r300_delete_dsa_state(struct pipe_context* pipe, FREE(state); } +static void r300_set_stencil_ref(struct pipe_context* pipe, + const struct pipe_stencil_ref* sr) +{ + struct r300_context* r300 = r300_context(pipe); + r300->stencil_ref = *sr; + r300->dsa_state.dirty = TRUE; +} + static void r300_set_framebuffer_state(struct pipe_context* pipe, const struct pipe_framebuffer_state* state) @@ -1087,6 +1095,8 @@ void r300_init_state_functions(struct r300_context* r300) r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; + r300->context.set_stencil_ref = r300_set_stencil_ref; + r300->context.set_framebuffer_state = r300_set_framebuffer_state; r300->context.create_fs_state = r300_create_fs_state; |