summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Mandin <pmandin@caramail.com>2007-08-16 21:31:30 +0200
committerPatrice Mandin <pmandin@caramail.com>2007-08-16 21:31:30 +0200
commita60695ebafcdf048ce13d5195e74f8b7d1fff8d8 (patch)
tree257b94c61a4f5f0cc1573c594b4fe27798bf751d
parentfe789805801cbbc2c97847c159cfd470232cc1f4 (diff)
nouveau: nv10: add function to clear a buffer
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c
index 2183fc1577..0c746325c6 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state.c
@@ -111,11 +111,41 @@ static void nv10BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB, GLenum dfac
OUT_RING_CACHE(dfactorRGB);
}
-static void nv10Clear(GLcontext *ctx, GLbitfield mask)
+static void nv10ClearBuffer(GLcontext *ctx, nouveau_renderbuffer_t *buffer, int fill, int mask)
{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (!buffer) {
+ return;
+ }
+
/* TODO */
}
+static void nv10Clear(GLcontext *ctx, GLbitfield mask)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (mask & (BUFFER_BIT_FRONT_LEFT)) {
+ nv10ClearBuffer(ctx, nmesa->color_buffer[0],
+ nmesa->clear_color_value, 0xffffffff);
+ }
+ if (mask & (BUFFER_BIT_BACK_LEFT)) {
+ nv10ClearBuffer(ctx, nmesa->color_buffer[1],
+ nmesa->clear_color_value, 0xffffffff);
+ }
+ /* FIXME: check depth bits */
+ if (mask & (BUFFER_BIT_DEPTH)) {
+ nv10ClearBuffer(ctx, nmesa->depth_buffer,
+ nmesa->clear_value, 0xffffff00);
+ }
+ /* FIXME: check about stencil? */
+ if (mask & (BUFFER_BIT_STENCIL)) {
+ nv10ClearBuffer(ctx, nmesa->depth_buffer,
+ nmesa->clear_value, 0x000000ff);
+ }
+}
+
static void nv10ClearColor(GLcontext *ctx, const GLfloat color[4])
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);