summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornathanh <nathanh>2001-09-18 16:00:18 +0000
committernathanh <nathanh>2001-09-18 16:00:18 +0000
commitfdf87b2751df88a8ca6b5b7cb0508bb9c915cc2e (patch)
tree21d44980c5c1c4008e47ba5d5f95825ff9e49773
parent521d54c96797e3d6f4c5f08ab01f3a4a3b949ee7 (diff)
Pipes hack in xscreensaver was not rendering. The code sets FRONT_AND_BACK
buffering, clears COLOR|DEPTH, then clears COLOR twice. The second & third clears incorrectly reset the depth buffer. Looks like a bug in Glide. Work around is to reset grColorMask inside tdfxDDClear before grBufferClear.
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c
index 208478d77..65db94bbd 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_render.c
@@ -48,9 +48,8 @@ static GLbitfield tdfxDDClear( GLcontext *ctx,
GLint x, GLint y, GLint width, GLint height )
{
tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx;
- GLbitfield softwareMask = mask & (DD_ACCUM_BIT);
- const GLuint stencil_size =
- fxMesa->haveHwStencil ? fxMesa->glVis->StencilBits : 0;
+ const GLuint stencil_size = fxMesa->haveHwStencil ? fxMesa->glVis->StencilBits : 0;
+ GLbitfield softwareMask = 0;
#if 0
GLuint flags;
@@ -134,7 +133,10 @@ static GLbitfield tdfxDDClear( GLcontext *ctx,
}
/* we can't clear accum buffers */
- mask &= ~(DD_ACCUM_BIT);
+ if (mask & DD_ACCUM_BIT) {
+ mask &= ~(DD_ACCUM_BIT);
+ softwareMask |= DD_ACCUM_BIT;
+ }
if (mask & DD_STENCIL_BIT) {
if (!fxMesa->haveHwStencil || ctx->Stencil.WriteMask != 0xff) {
@@ -147,8 +149,8 @@ static GLbitfield tdfxDDClear( GLcontext *ctx,
if (fxMesa->glVis->RedBits != 8) {
/* can only do color masking if running in 24/32bpp on Napalm */
- if (ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP] ||
- ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]) {
+ if ((ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP]) ||
+ (ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP])) {
softwareMask |= (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT));
mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT);
}
@@ -275,7 +277,8 @@ static GLbitfield tdfxDDClear( GLcontext *ctx,
case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT:
/* front and back */
fxMesa->Glide.grDepthMask(FXFALSE);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ FX_grColorMaskv_NoLock(ctx, true4);
if (stencil_size > 0)
fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
fxMesa->Color.ClearAlpha,
@@ -285,7 +288,7 @@ static GLbitfield tdfxDDClear( GLcontext *ctx,
fxMesa->Glide.grBufferClear(fxMesa->Color.ClearColor,
fxMesa->Color.ClearAlpha,
fxMesa->Depth.Clear);
- fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER);
if (stencil_size > 0)
fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
fxMesa->Color.ClearAlpha,
@@ -303,6 +306,7 @@ static GLbitfield tdfxDDClear( GLcontext *ctx,
/* clear front */
fxMesa->Glide.grDepthMask(FXFALSE);
fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ FX_grColorMaskv_NoLock(ctx, true4);
if (stencil_size > 0)
fxMesa->Glide.grBufferClearExt(fxMesa->Color.ClearColor,
fxMesa->Color.ClearAlpha,