summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-02-12 21:39:29 +0100
committerRoland Scheidegger <[email protected]>2010-02-12 21:39:29 +0100
commit6602889d82d1402338f5d23e37a9f46db99e86c6 (patch)
treede80ae0d9607b02252043852fe385418e4c5379a /src/gallium/drivers/r300/r300_state.c
parentaf1052e2804ee5fbcde3c8f8618feeb2c17b51fd (diff)
parent0087f9dc0690e5de139f89ea4577b1824b918757 (diff)
Merge branch 'gallium-dynamicstencilref'
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 99ecae9f5f8..4d158cff7c7 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)
@@ -794,7 +802,7 @@ static void*
sampler->filter0 |= r300_translate_tex_filters(state->min_img_filter,
state->mag_img_filter,
state->min_mip_filter,
- state->max_anisotropy > 1.0);
+ state->max_anisotropy > 0);
/* Unfortunately, r300-r500 don't support floating-point mipmap lods. */
/* We must pass these to the emit function to clamp them properly. */
@@ -1112,6 +1120,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;