GLboolean color, GLboolean depth, GLboolean stencil)
{
struct st_context *st = ctx->st;
+ struct pipe_alpha_test_state alpha_test;
struct pipe_blend_state blend;
struct pipe_depth_state depth_test;
struct pipe_stencil_state stencil_test;
+ struct pipe_setup_state setup;
+
+ /* alpha state: disabled */
+ memset(&alpha_test, 0, sizeof(alpha_test));
+ st->pipe->set_alpha_test_state(st->pipe, &alpha_test);
+
+ /* blend state: RGBA masking */
+ memset(&blend, 0, sizeof(blend));
+ if (color) {
+ if (ctx->Color.ColorMask[0])
+ blend.colormask |= PIPE_MASK_R;
+ if (ctx->Color.ColorMask[1])
+ blend.colormask |= PIPE_MASK_G;
+ if (ctx->Color.ColorMask[2])
+ blend.colormask |= PIPE_MASK_B;
+ if (ctx->Color.ColorMask[3])
+ blend.colormask |= PIPE_MASK_A;
+ if (st->ctx->Color.DitherFlag)
+ blend.dither = 1;
+ }
+ st->pipe->set_blend_state(st->pipe, &blend);
/* depth state: always pass */
- memset(&depth_test, 0, sizeof(depth));
+ memset(&depth_test, 0, sizeof(depth_test));
if (depth) {
depth_test.enabled = 1;
depth_test.writemask = 1;
}
st->pipe->set_depth_state(st->pipe, &depth_test);
+ /* setup state: nothing */
+ memset(&setup, 0, sizeof(setup));
+ st->pipe->set_setup_state(st->pipe, &setup);
+
/* stencil state: always set to ref value */
- memset(&stencil_test, 0, sizeof(stencil));
+ memset(&stencil_test, 0, sizeof(stencil_test));
if (stencil) {
stencil_test.front_enabled = 1;
stencil_test.front_func = PIPE_FUNC_ALWAYS;
}
st->pipe->set_stencil_state(st->pipe, &stencil_test);
- /* blend state: RGBA masking */
- memset(&blend, 0, sizeof(blend));
- if (color) {
- if (ctx->Color.ColorMask[0])
- blend.colormask |= PIPE_MASK_R;
- if (ctx->Color.ColorMask[1])
- blend.colormask |= PIPE_MASK_G;
- if (ctx->Color.ColorMask[2])
- blend.colormask |= PIPE_MASK_B;
- if (ctx->Color.ColorMask[3])
- blend.colormask |= PIPE_MASK_A;
- if (st->ctx->Color.DitherFlag)
- blend.dither = 1;
- }
- st->pipe->set_blend_state(st->pipe, &blend);
-
+ /* draw quad matching scissor rect (XXX verify coord round-off) */
draw_quad(ctx,
ctx->Scissor.X, ctx->Scissor.Y,
ctx->Scissor.X + ctx->Scissor.Width,
ctx->Depth.Clear, ctx->Color.ClearColor);
/* Restore GL state */
+ st->pipe->set_alpha_test_state(st->pipe, &st->state.alpha_test);
st->pipe->set_blend_state(st->pipe, &st->state.blend);
st->pipe->set_depth_state(st->pipe, &st->state.depth);
+ st->pipe->set_setup_state(st->pipe, &st->state.setup);
st->pipe->set_stencil_state(st->pipe, &st->state.stencil);
/* OR:
st_invalidate_state(ctx, _NEW_COLOR | _NEW_DEPTH | _NEW_STENCIL);