From: José Fonseca Date: Fri, 27 Mar 2009 20:23:16 +0000 (+0000) Subject: util: Support Z24S8/Z24X8. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7900748106a9ad339a4552ca944f2fa30486cfc;p=mesa.git util: Support Z24S8/Z24X8. --- diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index d31ca9c029e..f0a5a339eb3 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -957,6 +957,7 @@ pipe_tile_raw_to_rgba(enum pipe_format format, s8z24_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: z24s8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_Z32_FLOAT: @@ -1069,6 +1070,7 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, /*s8z24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ break; case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: /*z24s8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ break; default: @@ -1198,6 +1200,20 @@ pipe_put_tile_z(struct pipe_transfer *pt, } } break; + case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + { + uint *pDest = (uint *) (map + y * pt->stride + x*4); + for (i = 0; i < h; i++) { + for (j = 0; j < w; j++) { + /* convert 32-bit Z to 24-bit Z (0 stencil) */ + pDest[j] = ptrc[j] << 8; + } + pDest += pt->stride/4; + ptrc += srcStride; + } + } + break; case PIPE_FORMAT_Z16_UNORM: { ushort *pDest = (ushort *) (map + y * pt->stride + x*2);