gallium: fix some PIPE_FORMAT_Z24S8_UNORM bugs in softpipe driver
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 30 May 2008 21:07:58 +0000 (15:07 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 30 May 2008 21:07:58 +0000 (15:07 -0600)
src/gallium/drivers/softpipe/sp_quad_depth_test.c
src/gallium/drivers/softpipe/sp_tile_cache.c

index a1859f988325b1abcfb3079799f3954629d569de..33888abcc5ecbc0987a85907bfb8c232f690fe33 100644 (file)
@@ -230,7 +230,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
             int x = quad->x0 % TILE_SIZE + (j & 1);
             int y = quad->y0 % TILE_SIZE + (j >> 1);
             uint z24s8 = tile->data.depth32[y][x];
-            z24s8 = (z24s8 & 0xff) | (bzzzz[j] << 24);
+            z24s8 = (z24s8 & 0xff) | (bzzzz[j] << 8);
             tile->data.depth32[y][x] = z24s8;
          }
          break;
index 28c29da87c9079edebb7bc18d55aaa8be5933cf3..0e4c8c41eea926b3124591bf36719470b9f3b9f2 100644 (file)
@@ -169,6 +169,7 @@ sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
                                                    PIPE_BUFFER_USAGE_CPU_WRITE);
 
       tc->depth_stencil = (ps->format == PIPE_FORMAT_S8Z24_UNORM ||
+                           ps->format == PIPE_FORMAT_Z24S8_UNORM ||
                            ps->format == PIPE_FORMAT_Z16_UNORM ||
                            ps->format == PIPE_FORMAT_Z32_UNORM ||
                            ps->format == PIPE_FORMAT_S8_UNORM);