Mesa (master): util: Handle the remaining format cases in pipe_tile_raw_to_rgba().
MichaŠKról
michal at kemper.freedesktop.org
Wed Jan 6 15:11:41 UTC 2010
Module: Mesa
Branch: master
Commit: 4fd566ea31f7ef64edb997e1731b131668c431ea
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4fd566ea31f7ef64edb997e1731b131668c431ea
Author: Michal Krol <michal at vmware.com>
Date: Wed Jan 6 14:07:12 2010 +0100
util: Handle the remaining format cases in pipe_tile_raw_to_rgba().
---
src/gallium/auxiliary/util/u_tile.c | 27 ++++-----------------------
1 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index 5b8dd1a..1ba82bb 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -1155,27 +1155,6 @@ ycbcr_get_tile_rgba(const ushort *src,
}
-static void
-fake_get_tile_rgba(const ushort *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) {
- pRow[0] =
- pRow[1] =
- pRow[2] =
- pRow[3] = (i ^ j) & 1 ? 1.0f : 0.0f;
- }
- p += dst_stride;
- }
-}
-
-
void
pipe_tile_raw_to_rgba(enum pipe_format format,
void *src,
@@ -1258,8 +1237,10 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
ycbcr_get_tile_rgba((ushort *) src, w, h, dst, dst_stride, TRUE);
break;
default:
- debug_printf("%s: unsupported format %s\n", __FUNCTION__, pf_name(format));
- fake_get_tile_rgba(src, w, h, dst, dst_stride);
+ util_format_read_4f(format,
+ dst, dst_stride * sizeof(float),
+ src, util_format_get_stride(format, w),
+ 0, 0, w, h);
}
}
More information about the mesa-commit
mailing list