summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-08-02 18:25:10 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2007-08-02 18:25:10 +0100
commit0e067f1fb20094417e84e1b18f2302251cece2ca (patch)
treec52e128a9d5d898a25171a45718d732667a449b6
parent3dfe125861df183fcc325c516639f80b86bfbc19 (diff)
Remove references to accum buffers in softpipe.
Also some minor clear fixes.
-rw-r--r--src/mesa/pipe/p_context.h2
-rw-r--r--src/mesa/pipe/p_state.h1
-rw-r--r--src/mesa/pipe/softpipe/sp_clear.c13
-rw-r--r--src/mesa/pipe/softpipe/sp_clear.h2
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c20
-rw-r--r--src/mesa/state_tracker/st_draw.h2
6 files changed, 17 insertions, 23 deletions
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index 4f5937b8f3..2ce2781771 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/mesa/pipe/p_context.h
@@ -57,7 +57,7 @@ struct pipe_context {
/** Clear framebuffer */
void (*clear)(struct pipe_context *pipe, GLboolean color, GLboolean depth,
- GLboolean stencil, GLboolean accum);
+ GLboolean stencil);
/** occlusion counting (XXX this may be temporary - we should probably
* have generic query objects with begin/end methods)
diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h
index d6ed514fb1..699efd5877 100644
--- a/src/mesa/pipe/p_state.h
+++ b/src/mesa/pipe/p_state.h
@@ -202,7 +202,6 @@ struct pipe_framebuffer_state
struct pipe_surface *zbuf; /**< Z buffer */
struct pipe_surface *sbuf; /**< Stencil buffer */
- struct pipe_surface *abuf; /**< Accum buffer */
};
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c
index 09cc643003..e9b142e780 100644
--- a/src/mesa/pipe/softpipe/sp_clear.c
+++ b/src/mesa/pipe/softpipe/sp_clear.c
@@ -63,7 +63,7 @@ color_value(GLuint format, const GLfloat color[4])
void
softpipe_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth,
- GLboolean stencil, GLboolean accum)
+ GLboolean stencil)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
GLint x, y, w, h;
@@ -152,15 +152,4 @@ softpipe_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth,
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);
- }
}
diff --git a/src/mesa/pipe/softpipe/sp_clear.h b/src/mesa/pipe/softpipe/sp_clear.h
index f9db99dd32..d41cc1d070 100644
--- a/src/mesa/pipe/softpipe/sp_clear.h
+++ b/src/mesa/pipe/softpipe/sp_clear.h
@@ -37,7 +37,7 @@ struct pipe_context;
extern void
softpipe_clear(struct pipe_context *pipe, GLboolean color, GLboolean depth,
- GLboolean stencil, GLboolean accum);
+ GLboolean stencil);
#endif /* SP_CLEAR_H */
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index 523a9b682c..a7a3b5eba1 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -49,7 +49,7 @@
static void
clear_with_quad(GLcontext *ctx,
GLboolean color, GLboolean depth,
- GLboolean stencil, GLboolean accum)
+ GLboolean stencil)
{
struct st_context *st = ctx->st;
struct pipe_blend_state blend;
@@ -119,17 +119,18 @@ static void st_clear(GLcontext *ctx, GLbitfield mask)
GLboolean depth = (mask & BUFFER_BIT_DEPTH) ? GL_TRUE : GL_FALSE;
GLboolean stencil = (mask & BUFFER_BIT_STENCIL) ? GL_TRUE : GL_FALSE;
GLboolean accum = (mask & BUFFER_BIT_ACCUM) ? GL_TRUE : GL_FALSE;
+
GLboolean maskColor, maskStencil;
GLboolean fullscreen = 1; /* :-) */
- GLuint stencilMax = 1 << ctx->DrawBuffer->_StencilBuffer->StencilBits;
+ GLuint stencilMax = stencil ? (1 << ctx->DrawBuffer->_StencilBuffer->StencilBits) : 0;
/* This makes sure the softpipe has the latest scissor, etc values */
st_validate_state( st );
- maskColor = st->state.blend.colormask != PIPE_MASK_RGBA;
- maskStencil = ctx->Stencil.WriteMask[0] != stencilMax;
+ maskColor = color && st->state.blend.colormask != PIPE_MASK_RGBA;
+ maskStencil = stencil && ctx->Stencil.WriteMask[0] != stencilMax;
- if (fullscreen && !maskColor) {
+ if (fullscreen && !maskColor && !maskStencil) {
/* pipe->clear() should clear a particular surface, so that we
* can iterate over render buffers at this level and clear the
* ones GL is asking for.
@@ -139,12 +140,17 @@ static void st_clear(GLcontext *ctx, GLbitfield mask)
* buffers, though could perhaps deal with them explicitly at
* this level.
*/
- st->pipe->clear(st->pipe, color, depth, stencil, accum);
+ st->pipe->clear(st->pipe, color, depth, stencil);
+
+ /* And here we would do a clear on whatever surface we are using
+ * to implement accum buffers:
+ */
+ assert(!accum);
}
else {
/* Convert to geometry, etc:
*/
- clear_with_quad(ctx, color, depth, stencil, accum);
+ clear_with_quad(ctx, color, depth, stencil);
}
}
diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h
index 7a3ba52130..0afadab577 100644
--- a/src/mesa/state_tracker/st_draw.h
+++ b/src/mesa/state_tracker/st_draw.h
@@ -39,6 +39,6 @@ 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);
+ GLboolean stencil);
#endif