diff options
author | Brian <[email protected]> | 2008-03-12 18:24:46 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2008-03-12 18:24:46 -0600 |
commit | d91e62e9c6ff81c91b83af883281c1e205c6bf35 (patch) | |
tree | 9db474dd998a5f8cf54d4a974d84a80da063f8fe /src/mesa/state_tracker | |
parent | 2109ba4c5d22e1f7effa33a6ff26ce587ce46fe3 (diff) |
gallium: in clear_stencil_buffer() check surface format to determine stencil clear value
... as we do for the Z and Z+stencil cases
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_clear.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index eae40f2a4f1..cc8a136292d 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -544,6 +544,15 @@ clear_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) /* simple clear of whole buffer */ GLuint clearValue = ctx->Stencil.Clear; + + switch (strb->surface->format) { + case PIPE_FORMAT_S8Z24_UNORM: + clearValue <<= 24; + break; + default: + ; /* no-op, stencil value is in least significant bits */ + } + ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue); } } |