diff options
author | Keith Whitwell <[email protected]> | 2008-04-29 21:30:31 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-04-29 21:30:31 +0100 |
commit | 1e97ab685689ef06181a5f22fae9a3a82c83142c (patch) | |
tree | 043358fbf4a0d2a4a5226f9aa2a8884b01e42d4a | |
parent | bbafa8aa2fc8009fb8e32f996d4972c56e6b46e6 (diff) |
gallium: add pack for _FLOAT formats to pack_ub
-rw-r--r-- | src/gallium/auxiliary/util/u_pack_color.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h index bb2c34e5f6e..0b917c005f1 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -101,6 +101,24 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, *d = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4); } return; + case PIPE_FORMAT_R32G32B32A32_FLOAT: + { + float *d = (float *) dest; + d[0] = (float)r / 255.0f; + d[1] = (float)g / 255.0f; + d[2] = (float)b / 255.0f; + d[3] = (float)a / 255.0f; + } + return; + case PIPE_FORMAT_R32G32B32_FLOAT: + { + float *d = (float *) dest; + d[0] = (float)r / 255.0f; + d[1] = (float)g / 255.0f; + d[2] = (float)b / 255.0f; + } + return; + /* XXX lots more cases to add */ default: debug_print_format("gallium: unhandled format in util_pack_color_ub()", format); |