summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian <brian@i915.localnet.net>2007-08-02 13:48:02 -0600
committerBrian <brian@i915.localnet.net>2007-08-02 13:48:02 -0600
commit406da44da31f71afd98fc45e2bbfbf41deff1d12 (patch)
tree2a81c87d459338569ccf8a945556da7f18b5d0a1 /src/mesa/state_tracker
parent7b274b4318f7390b0bc8a7f20a0326881d4df2c9 (diff)
setup more state for clear_with_quad()
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c49
1 files changed, 31 insertions, 18 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 8e2e30253e..85df549404 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -96,12 +96,34 @@ clear_with_quad(GLcontext *ctx,
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;
@@ -109,8 +131,12 @@ clear_with_quad(GLcontext *ctx,
}
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;
@@ -123,22 +149,7 @@ clear_with_quad(GLcontext *ctx,
}
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,
@@ -146,8 +157,10 @@ clear_with_quad(GLcontext *ctx,
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);