summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-02-06 19:29:48 +0000
committerBrian Paul <[email protected]>2000-02-06 19:29:48 +0000
commitb79d289bded99e78e6ef64c5f8c4c71770b0e145 (patch)
treed09947de79d9c1b4f29d125ac3668a7b58c5d84a /src
parentd4ce76275d17c3de3bdbf91f1ca5b2977c4ee02c (diff)
clearing depth buffer failed when clearing front color buffer
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/glide/fxdd.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 9c0fc4de537..cb2a1e1883e 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -178,9 +178,9 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
GLbitfield softwareMask = mask & (DD_STENCIL_BIT | DD_ACCUM_BIT);
GLbitfield newMask = mask & ~(DD_STENCIL_BIT | DD_ACCUM_BIT);
-
if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxDDClear(%d,%d,%d,%d)\n",x,y,width,height);
+ fprintf(stderr,"fxmesa: fxDDClear(%d,%d,%d,%d)\n", (int) x, (int) y,
+ (int) width, (int) height);
}
if (mask == (DD_BACK_LEFT_BIT | DD_DEPTH_BIT)
@@ -209,6 +209,20 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
if (newMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) {
if (newMask & DD_FRONT_LEFT_BIT) {
+ if (mask & DD_DEPTH_BIT) {
+ /* XXX it appears that the depth buffer isn't cleared when
+ * glRenderBuffer(GR_BUFFER_FRONTBUFFER) is set.
+ * This is a work-around/
+ */
+ FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ FX_grColorMask(FXFALSE,FXFALSE);
+ FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
+ (FxU16)(ctx->Depth.Clear*0xffff));
+ FX_grColorMask(ctx->Color.ColorMask[RCOMP] ||
+ ctx->Color.ColorMask[GCOMP] ||
+ ctx->Color.ColorMask[BCOMP],
+ ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
+ }
FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
(FxU16)(ctx->Depth.Clear*0xffff));
@@ -254,7 +268,7 @@ static GLboolean fxDDSetDrawBuffer(GLcontext *ctx, GLenum mode )
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxDDSetBuffer(%x)\n",mode);
+ fprintf(stderr,"fxmesa: fxDDSetBuffer(%x)\n", (int) mode);
}
if (mode == GL_FRONT_LEFT) {
@@ -282,7 +296,7 @@ static void fxDDSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer,
(void) buffer;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxDDSetBuffer(%x)\n",mode);
+ fprintf(stderr,"fxmesa: fxDDSetBuffer(%x)\n", (int) mode);
}
if (mode == GL_FRONT_LEFT) {
@@ -455,7 +469,7 @@ static GLint fxDDGetParameteri(const GLcontext *ctx, GLint param)
case DD_HAVE_HARDWARE_FOG:
return 1;
default:
- fprintf(stderr,"fx Driver: internal error in fxDDGetParameteri(): %x\n",param);
+ fprintf(stderr,"fx Driver: internal error in fxDDGetParameteri(): %x\n", (int) param);
fxCloseHardware();
exit(-1);
return 0;
@@ -674,18 +688,6 @@ void fxDDInitExtensions( GLcontext *ctx )
/************************************************************************/
/************************************************************************/
-/* This is a no-op, since the z-buffer is in hardware */
-static void fxAllocDepthBuffer(GLcontext *ctx)
-{
- if (MESA_VERBOSE&VERBOSE_DRIVER) {
- fprintf(stderr,"fxmesa: fxAllocDepthBuffer()\n");
- }
-}
-
-/************************************************************************/
-/************************************************************************/
-/************************************************************************/
-
/* Check if the hardware supports the current context
*
* Performs similar work to fxDDChooseRenderState() - should be merged.