#include "pipe/softpipe/sp_context.h"
#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
+#include "state_tracker/st_draw.h"
/*
/* 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
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)
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]);
/* 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);
+}
+
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