actually use new glClear code

This commit is contained in:
Brian
2007-06-20 13:10:48 -06:00
parent abf45c2a3d
commit b7c646d1bc
4 changed files with 35 additions and 5 deletions
+12
View File
@@ -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)
+5 -5
View File
@@ -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]);
+14
View File
@@ -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);
}
+4
View File
@@ -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