aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/sis/sis_state.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2005-10-19 00:53:05 +0000
committerEric Anholt <[email protected]>2005-10-19 00:53:05 +0000
commitdeadd47aab68d4914d70b19fa08f834623f2e0a7 (patch)
tree5f951bc349cff8655995dcfee24372c489647f68 /src/mesa/drivers/dri/sis/sis_state.c
parentbf3f0bcf802af20b2d95890ad4dcc56c98289b10 (diff)
Bug #4615: Fix the SiS driver for the renderbuffer changes. Previously, all
drirenderbuffers pointed at screen offset 0 and NULL. Instead, set up the front buffer at startup but leave the others for later, since sis allocates them on demand rather than using the static method of the other non-sis-descendent drivers. Some basic apps work, but fallbacks may be broken still.
Diffstat (limited to 'src/mesa/drivers/dri/sis/sis_state.c')
-rw-r--r--src/mesa/drivers/dri/sis/sis_state.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c
index 8349c42d297..01688c2fda5 100644
--- a/src/mesa/drivers/dri/sis/sis_state.c
+++ b/src/mesa/drivers/dri/sis/sis_state.c
@@ -521,19 +521,21 @@ void sisDDDrawBuffer( GLcontext *ctx, GLenum mode )
sisContextPtr smesa = SIS_CONTEXT(ctx);
__GLSiSHardware *prev = &smesa->prev;
__GLSiSHardware *current = &smesa->current;
- int pitch;
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
+ current->hwDstSet &= ~MASK_DstBufferPitch;
switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
case BUFFER_BIT_FRONT_LEFT:
FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
- pitch = smesa->frontPitch;
+ current->hwOffsetDest = smesa->front.offset >> 1;
+ current->hwDstSet |= smesa->front.pitch >> 2;
break;
case BUFFER_BIT_BACK_LEFT:
FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
- pitch = smesa->backPitch;
+ current->hwOffsetDest = smesa->back.offset >> 1;
+ current->hwDstSet |= smesa->back.pitch >> 2;
break;
default:
/* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
@@ -541,10 +543,6 @@ void sisDDDrawBuffer( GLcontext *ctx, GLenum mode )
return;
}
- current->hwOffsetDest = (smesa->drawOffset) >> 1;
- current->hwDstSet &= ~MASK_DstBufferPitch;
- current->hwDstSet |= pitch >> 2;
-
if (current->hwDstSet != prev->hwDstSet) {
prev->hwDstSet = current->hwDstSet;
smesa->GlobalFlag |= GFLAG_DESTSETTING;
@@ -598,7 +596,7 @@ sisDDEnable( GLcontext * ctx, GLenum cap, GLboolean state )
current->hwCapEnable &= ~MASK_CullEnable;
break;
case GL_DEPTH_TEST:
- if (state && smesa->depthbuffer)
+ if (state && smesa->depth.offset != 0)
current->hwCapEnable |= MASK_ZTestEnable;
else
current->hwCapEnable &= ~MASK_ZTestEnable;
@@ -840,6 +838,7 @@ void sisDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = _swrast_ReadPixels;
+ ctx->Driver.ResizeBuffers = sisReAllocateBuffers;
/* Swrast hooks for imaging extensions:
*/
ctx->Driver.CopyColorTable = _swrast_CopyColorTable;