summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe/sp_clear.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-01 15:11:59 -0600
committerBrian <[email protected]>2007-08-01 15:11:59 -0600
commit0c4acfe15a0555a6f3da02ab17e58cc379df11fd (patch)
treec65574cd49cdbc79d1eb8034f5bfe661f5e06eef /src/mesa/pipe/softpipe/sp_clear.c
parent0eb02a1963a25f6994b730147d0613b03424c11e (diff)
Re-implement intelClear() in terms of softpipe_clear(). Pretty simple/small now.
Note: softpipe_clear() should really be renamed to something like pipe_clear_with_blits() and put into a driver-indepedent module...
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_clear.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_clear.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c
index aa7601ab8cb..b3bbc96f307 100644
--- a/src/mesa/pipe/softpipe/sp_clear.c
+++ b/src/mesa/pipe/softpipe/sp_clear.c
@@ -90,7 +90,8 @@ color_mask(GLuint format, GLuint pipeMask)
/**
- * XXX maybe this belongs in the GL state tracker...
+ * XXX This should probaby be renamed to something like pipe_clear_with_blits()
+ * and moved into a device-independent pipe file.
*/
void
softpipe_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth,
@@ -157,16 +158,32 @@ softpipe_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth,
if (stencil) {
struct pipe_surface *ps = softpipe->framebuffer.sbuf;
GLuint clearVal = softpipe->stencil.clear_value;
- GLuint mask = 0xff;
- if (softpipe->stencil.write_mask[0] /*== 0xff*/) {
- /* no masking */
- pipe->region_fill(pipe, ps->region, 0, x, y, w, h, clearVal, mask);
- }
- else if (softpipe->stencil.write_mask[0] != 0x0) {
- /* masking */
- /* fill with quad funcs */
+ GLuint mask = softpipe->stencil.write_mask[0];
+
+ switch (ps->format) {
+ case PIPE_FORMAT_S8_Z24:
+ clearVal = clearVal << 24;
+ mask = mask << 24;
+ break;
+ case PIPE_FORMAT_U_S8:
+ /* nothing */
+ break;
+ default:
assert(0);
}
+
+ pipe->region_fill(pipe, ps->region, 0, x, y, w, h, clearVal, mask);
}
}
+
+ if (accum) {
+ /* XXX there might be no notion of accum buffers in 'pipe'.
+ * Just implement them with a deep RGBA surface format...
+ */
+ struct pipe_surface *ps = softpipe->framebuffer.abuf;
+ GLuint clearVal = 0x0; /* XXX FIX */
+ GLuint mask = !0;
+ assert(ps);
+ pipe->region_fill(pipe, ps->region, 0, x, y, w, h, clearVal, mask);
+ }
}