summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-06-02 11:46:53 -0700
committerJosé Fonseca <jfonseca@vmware.com>2009-06-02 11:46:53 -0700
commit840af5fd62edc01769cc3818702ea399a0c68c40 (patch)
treebabcb42bcc037d82f3965f0cdcaec0fbabdce4be /src/gallium/auxiliary/util
parentc91df4c1534e2db2274b6d08e90470bf21a49e2a (diff)
util: Support Z24S8/Z24X8 -> unsigned conversion.
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_tile.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index 9becd9fea4..a2fcdad9e4 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -1133,6 +1133,21 @@ pipe_get_tile_z(struct pipe_transfer *pt,
}
}
break;
+ case PIPE_FORMAT_Z24S8_UNORM:
+ case PIPE_FORMAT_Z24X8_UNORM:
+ {
+ const uint *ptrc
+ = (const uint *)(map + y * pt->stride + x*4);
+ for (i = 0; i < h; i++) {
+ for (j = 0; j < w; j++) {
+ /* convert 24-bit Z to 32-bit Z */
+ pDest[j] = (ptrc[j] & 0xffffff00) | (ptrc[j] & 0xff);
+ }
+ pDest += dstStride;
+ ptrc += pt->stride/4;
+ }
+ }
+ break;
case PIPE_FORMAT_Z16_UNORM:
{
const ushort *ptrc