summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i915/i915_state.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2010-02-11 18:16:09 +0100
committerRoland Scheidegger <sroland@vmware.com>2010-02-11 18:16:09 +0100
commit388109c04dc92ed81d1dbe6209120c95bdbc83cd (patch)
tree293a3b675b9b9edf88981a578adeef7fb1a02fae /src/gallium/drivers/i915/i915_state.c
parent263406addb90ca7599ddfb210944ab0dd63b973c (diff)
i915g: adapt to stencil ref changes
Diffstat (limited to 'src/gallium/drivers/i915/i915_state.c')
-rw-r--r--src/gallium/drivers/i915/i915_state.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index beb26e996a..14a9314dab 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -190,7 +190,7 @@ static void i915_delete_blend_state(struct pipe_context *pipe, void *blend)
}
static void i915_set_blend_color( struct pipe_context *pipe,
- const struct pipe_blend_color *blend_color )
+ const struct pipe_blend_color *blend_color )
{
struct i915_context *i915 = i915_context(pipe);
draw_flush(i915->draw);
@@ -200,6 +200,17 @@ static void i915_set_blend_color( struct pipe_context *pipe,
i915->dirty |= I915_NEW_BLEND;
}
+static void i915_set_stencil_ref( struct pipe_context *pipe,
+ const struct pipe_stencil_ref *stencil_ref )
+{
+ struct i915_context *i915 = i915_context(pipe);
+ draw_flush(i915->draw);
+
+ i915->stencil_ref = *stencil_ref;
+
+ i915->dirty |= I915_NEW_DEPTH_STENCIL;
+}
+
static void *
i915_create_sampler_state(struct pipe_context *pipe,
const struct pipe_sampler_state *sampler)
@@ -334,11 +345,9 @@ i915_create_depth_stencil_state(struct pipe_context *pipe,
int fop = i915_translate_stencil_op(depth_stencil->stencil[0].fail_op);
int dfop = i915_translate_stencil_op(depth_stencil->stencil[0].zfail_op);
int dpop = i915_translate_stencil_op(depth_stencil->stencil[0].zpass_op);
- int ref = depth_stencil->stencil[0].ref_value & 0xff;
cso->stencil_LIS5 |= (S5_STENCIL_TEST_ENABLE |
S5_STENCIL_WRITE_ENABLE |
- (ref << S5_STENCIL_REF_SHIFT) |
(test << S5_STENCIL_TEST_FUNC_SHIFT) |
(fop << S5_STENCIL_FAIL_SHIFT) |
(dfop << S5_STENCIL_PASS_Z_FAIL_SHIFT) |
@@ -350,7 +359,6 @@ i915_create_depth_stencil_state(struct pipe_context *pipe,
int fop = i915_translate_stencil_op(depth_stencil->stencil[1].fail_op);
int dfop = i915_translate_stencil_op(depth_stencil->stencil[1].zfail_op);
int dpop = i915_translate_stencil_op(depth_stencil->stencil[1].zpass_op);
- int ref = depth_stencil->stencil[1].ref_value & 0xff;
int tmask = depth_stencil->stencil[1].valuemask & 0xff;
int wmask = depth_stencil->stencil[1].writemask & 0xff;
@@ -359,7 +367,6 @@ i915_create_depth_stencil_state(struct pipe_context *pipe,
BFO_ENABLE_STENCIL_TWO_SIDE |
BFO_ENABLE_STENCIL_REF |
BFO_STENCIL_TWO_SIDE |
- (ref << BFO_STENCIL_REF_SHIFT) |
(test << BFO_STENCIL_TEST_SHIFT) |
(fop << BFO_STENCIL_FAIL_SHIFT) |
(dfop << BFO_STENCIL_PASS_Z_FAIL_SHIFT) |
@@ -777,6 +784,7 @@ i915_init_state_functions( struct i915_context *i915 )
i915->base.delete_vs_state = i915_delete_vs_state;
i915->base.set_blend_color = i915_set_blend_color;
+ i915->base.set_stencil_ref = i915_set_stencil_ref;
i915->base.set_clip_state = i915_set_clip_state;
i915->base.set_constant_buffer = i915_set_constant_buffer;
i915->base.set_framebuffer_state = i915_set_framebuffer_state;