diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-11-20 08:36:06 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-11-20 08:36:06 -0700 |
commit | 5a6017d496ccce94d7e3cf9a6cfe1db886dcc767 (patch) | |
tree | 8a7baab5fcb3e80eb9924a22d3e57921380023ec /src/mesa/pipe/softpipe/sp_quad_depth_test.c | |
parent | 0191570f024ba787799ca2bccd46549a8af74aa9 (diff) |
add PIPE_FORMAT_Z24_S8 support to softpipe patsh
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_quad_depth_test.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_quad_depth_test.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_depth_test.c b/src/mesa/pipe/softpipe/sp_quad_depth_test.c index f7e93af784..3318189621 100644 --- a/src/mesa/pipe/softpipe/sp_quad_depth_test.c +++ b/src/mesa/pipe/softpipe/sp_quad_depth_test.c @@ -119,6 +119,21 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad) } } break; + case PIPE_FORMAT_Z24_S8: + { + float scale = (float) ((1 << 24) - 1); + + for (j = 0; j < QUAD_SIZE; j++) { + qzzzz[j] = (unsigned) (quad->outputs.depth[j] * scale); + } + + for (j = 0; j < QUAD_SIZE; j++) { + int x = quad->x0 % TILE_SIZE + (j & 1); + int y = quad->y0 % TILE_SIZE + (j >> 1); + bzzzz[j] = tile->data.depth32[y][x] >> 8; + } + } + break; default: assert(0); } @@ -210,6 +225,15 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad) tile->data.depth32[y][x] = s8z24; } break; + case PIPE_FORMAT_Z24_S8: + for (j = 0; j < QUAD_SIZE; j++) { + 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); + tile->data.depth32[y][x] = z24s8; + } + break; default: assert(0); } |