summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_quad_depth_test.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-08-07 15:05:13 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-08-07 15:14:52 -0600
commitfdb7dc889f4251183915c811566ced083fdac40d (patch)
tree24f752f349fe84e4646f9b48eaaee99f405fd137 /src/gallium/drivers/softpipe/sp_quad_depth_test.c
parent6a82ea2ed21c47749676e765311baed97f5dea9f (diff)
softpipe: add support for PIPE_FORMAT_X8Z24_UNORM, PIPE_FORMAT_Z24X8_UNORM
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_quad_depth_test.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_depth_test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index 33888abcc5..0c82692c6e 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -104,6 +104,8 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
}
}
break;
+ case PIPE_FORMAT_X8Z24_UNORM:
+ /* fall-through */
case PIPE_FORMAT_S8Z24_UNORM:
{
float scale = (float) ((1 << 24) - 1);
@@ -119,6 +121,8 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
}
}
break;
+ case PIPE_FORMAT_Z24X8_UNORM:
+ /* fall-through */
case PIPE_FORMAT_Z24S8_UNORM:
{
float scale = (float) ((1 << 24) - 1);
@@ -209,6 +213,9 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
tile->data.depth16[y][x] = (ushort) bzzzz[j];
}
break;
+ case PIPE_FORMAT_X8Z24_UNORM:
+ /* fall-through */
+ /* (yes, this falls through to a different case than above) */
case PIPE_FORMAT_Z32_UNORM:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
@@ -234,6 +241,13 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
tile->data.depth32[y][x] = z24s8;
}
break;
+ case PIPE_FORMAT_Z24X8_UNORM:
+ for (j = 0; j < QUAD_SIZE; j++) {
+ int x = quad->x0 % TILE_SIZE + (j & 1);
+ int y = quad->y0 % TILE_SIZE + (j >> 1);
+ tile->data.depth32[y][x] = bzzzz[j] << 8;
+ }
+ break;
default:
assert(0);
}