summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-06-20 13:10:48 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-06-20 13:10:48 -0600
commitb7c646d1bcf4b6fa285996d1b9b660ce478190f6 (patch)
tree76c122ce2ec8deab8574bd53c6db1742cbe30ae7
parentabf45c2a3db39fc1690e282e7f7603bc1d81f647 (diff)
actually use new glClear code
-rw-r--r--src/mesa/drivers/x11/xm_dd.c12
-rw-r--r--src/mesa/pipe/softpipe/sp_clear.c10
-rw-r--r--src/mesa/state_tracker/st_draw.c14
-rw-r--r--src/mesa/state_tracker/st_draw.h4
4 files changed, 35 insertions, 5 deletions
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index eb59d1d05ef..57254148561 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -55,6 +55,8 @@
#include "pipe/softpipe/sp_context.h"
#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
+#include "state_tracker/st_draw.h"
/*
@@ -393,6 +395,7 @@ clear_buffers(GLcontext *ctx, GLbitfield buffers)
/* we can't handle color or index masking */
if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
+#if 0
if (buffers & BUFFER_BIT_FRONT_LEFT) {
/* clear front color buffer */
struct gl_renderbuffer *frontRb
@@ -416,6 +419,15 @@ clear_buffers(GLcontext *ctx, GLbitfield buffers)
buffers &= ~BUFFER_BIT_BACK_LEFT;
}
}
+#else
+ /* Clear with state-tracker/pipe interface */
+ struct st_context *st = st_context(ctx);
+ GLboolean color = (buffers & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) ? 1: 0;
+ GLboolean depth = (buffers & BUFFER_BIT_DEPTH) ? 1 : 0;
+ GLboolean stencil = (buffers & BUFFER_BIT_STENCIL) ? 1 : 0;
+ GLboolean accum = (buffers & BUFFER_BIT_ACCUM) ? 1 : 0;
+ st_clear(st, color, depth, stencil, accum);
+#endif
}
}
if (buffers)
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c
index 536f0d39243..e83bc053ef7 100644
--- a/src/mesa/pipe/softpipe/sp_clear.c
+++ b/src/mesa/pipe/softpipe/sp_clear.c
@@ -40,14 +40,14 @@ void
softpipe_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth,
GLboolean stencil, GLboolean accum)
{
- struct softpipe_context *softpipe = softpipe_context(pipe);
+ const struct softpipe_context *softpipe = softpipe_context(pipe);
+ const GLint x = softpipe->scissor.minx;
+ const GLint y = softpipe->scissor.miny;
+ const GLint w = softpipe->scissor.maxx - x;
+ const GLint h = softpipe->scissor.maxy - y;
if (color) {
GLuint i;
- const GLint x = softpipe->scissor.minx;
- const GLint y = softpipe->scissor.miny;
- const GLint w = softpipe->scissor.maxx - x;
- const GLint h = softpipe->scissor.maxy - y;
GLubyte clr[4];
UNCLAMPED_FLOAT_TO_UBYTE(clr[0], softpipe->clear_color.color[0]);
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 1f6c261bc24..55b98629dbd 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -105,3 +105,17 @@ void st_destroy_draw( struct st_context *st )
/* Nothing to do.
*/
}
+
+
+/** XXX temporary here */
+void
+st_clear(struct st_context *st, GLboolean color, GLboolean depth,
+ GLboolean stencil, GLboolean accum)
+{
+ /* Validate driver and pipe state:
+ */
+ st_validate_state( st );
+
+ st->pipe->clear(st->pipe, color, depth, stencil, accum);
+}
+
diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h
index f51059706ad..7a3ba521300 100644
--- a/src/mesa/state_tracker/st_draw.h
+++ b/src/mesa/state_tracker/st_draw.h
@@ -37,4 +37,8 @@
void st_init_draw( struct st_context *st );
void st_destroy_draw( struct st_context *st );
+/** XXX temporary here */
+void st_clear(struct st_context *st, GLboolean color, GLboolean depth,
+ GLboolean stencil, GLboolean accum);
+
#endif