aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_tile.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-06 19:27:25 +0100
committerMarc Haesen <marc@hc-consult.be>2012-01-06 19:27:25 +0100
commit7e9f4ea970e8f7008c212d7d3918a974eb0066da (patch)
tree92cf7fcdf6e8093e743346af2397f3caa17cffe3 /mesalib/src/gallium/auxiliary/util/u_tile.c
parent9715b7fab0757c86e1bb151f3dce0b324bcff692 (diff)
downloadvcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.tar.gz
vcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.tar.bz2
vcxsrv-7e9f4ea970e8f7008c212d7d3918a974eb0066da.zip
libX11 mesa pixman git update 6 jan 2012
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_tile.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_tile.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_tile.c b/mesalib/src/gallium/auxiliary/util/u_tile.c
index 02bdb731d..ea4b91f95 100644
--- a/mesalib/src/gallium/auxiliary/util/u_tile.c
+++ b/mesalib/src/gallium/auxiliary/util/u_tile.c
@@ -344,6 +344,31 @@ z32f_x24s8_get_tile_rgba(const float *src,
}
}
+/*** PIPE_FORMAT_X32_S8X24_UINT ***/
+
+/**
+ * Return S component as four uint32_t in [0..255]. Z part ignored.
+ */
+static void
+x32_s8_get_tile_rgba(const unsigned *src,
+ unsigned w, unsigned h,
+ float *p,
+ unsigned dst_stride)
+{
+ unsigned i, j;
+
+ for (i = 0; i < h; i++) {
+ float *pRow = p;
+ for (j = 0; j < w; j++, pRow += 4) {
+ src++;
+ pRow[0] =
+ pRow[1] =
+ pRow[2] =
+ pRow[3] = (float)(*src++ & 0xff);
+ }
+ p += dst_stride;
+ }
+}
void
pipe_tile_raw_to_rgba(enum pipe_format format,
@@ -381,6 +406,9 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
z32f_x24s8_get_tile_rgba((float *) src, w, h, dst, dst_stride);
break;
+ case PIPE_FORMAT_X32_S8X24_UINT:
+ x32_s8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride);
+ break;
default:
util_format_read_4f(format,
dst, dst_stride * sizeof(float),