fix z buffer read/write issue with rv100-like chips and old ddx
authorRoland Scheidegger <sroland@tungstengraphics.com>
Thu, 22 Nov 2007 01:49:11 +0000 (02:49 +0100)
committerRoland Scheidegger <sroland@tungstengraphics.com>
Thu, 22 Nov 2007 01:49:15 +0000 (02:49 +0100)
src/mesa/drivers/dri/radeon/radeon_screen.c

index c12eef20242f88a493ebfc112377c1dfee91463c..e9c9df1222920d87328364875c9cc15455817460 100644 (file)
@@ -720,7 +720,11 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
    screen->depthPitch  = dri_priv->depthPitch;
 
    /* Check if ddx has set up a surface reg to cover depth buffer */
-   screen->depthHasSurface = (sPriv->ddx_version.major > 4);
+   screen->depthHasSurface = (sPriv->ddx_version.major > 4) ||
+      /* these chips don't use tiled z without hyperz. So always pretend
+         we have set up a surface which will cause linear reads/writes */
+      ((screen->chip_family & RADEON_CLASS_R100) &&
+      !(screen->chip_flags & RADEON_CHIPSET_TCL));
 
    if ( dri_priv->textureSize == 0 ) {
       screen->texOffset[RADEON_LOCAL_TEX_HEAP] = screen->gart_texture_offset;