I'm not sure these are quite correct. The reflect demo doesn't assert
anymore, but it doesn't produce correct results either. SPE-based
vertex shader code needs to be disabled for relfect to run.
spu.fb.width_tiles = (spu.fb.width + TILE_SIZE - 1) / TILE_SIZE;
spu.fb.height_tiles = (spu.fb.height + TILE_SIZE - 1) / TILE_SIZE;
- if (spu.fb.depth_format == PIPE_FORMAT_Z32_UNORM)
+ switch (spu.fb.depth_format) {
+ case PIPE_FORMAT_Z32_UNORM:
+ case PIPE_FORMAT_Z24S8_UNORM:
spu.fb.zsize = 4;
- else if (spu.fb.depth_format == PIPE_FORMAT_Z16_UNORM)
+ break;
+ case PIPE_FORMAT_Z16_UNORM:
spu.fb.zsize = 2;
- else
+ break;
+ default:
spu.fb.zsize = 0;
+ break;
+ }
if (spu.fb.color_format == PIPE_FORMAT_A8R8G8B8_UNORM)
spu.color_shuffle = ((vector unsigned char) {
static INLINE void
clear_z_tile(tile_t *ztile)
{
- if (spu.fb.depth_format == PIPE_FORMAT_Z16_UNORM) {
+ if (spu.fb.zsize == 2) {
memset16((ushort*) ztile->us,
spu.fb.depth_clear_value,
TILE_SIZE * TILE_SIZE);
}
else {
- ASSERT(spu.fb.depth_format == PIPE_FORMAT_Z32_UNORM);
+ ASSERT(spu.fb.zsize != 0);
memset32((uint*) ztile->ui,
spu.fb.depth_clear_value,
TILE_SIZE * TILE_SIZE);