}
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);
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)
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) |
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;
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) |
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;
static void upload_BFO( struct i915_context *i915 )
{
+ unsigned bfo[2];
+ bfo[0] = i915->depth_stencil->bfo[0];
+ bfo[1] = i915->depth_stencil->bfo[1];
+ /* I don't get it only allowed to set a ref mask when the enable bit is set? */
+ if (bfo[0] & BFO_ENABLE_STENCIL_REF) {
+ bfo[0] |= i915->stencil_ref.ref_value[1] << BFO_STENCIL_REF_SHIFT;
+ }
set_dynamic_indirect( i915,
I915_DYNAMIC_BFO_0,
- &(i915->depth_stencil->bfo[0]),
+ &(bfo[0]),
2 );
}