aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/translate/translate_generic.c
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-08-11 16:00:32 +0200
committerLuca Barbieri <[email protected]>2010-08-11 16:27:58 +0200
commit684aeb366fb72a2dbf9dd7a0803f29880858cd06 (patch)
tree60476373a6ec8f6985d21cb963f9fdaf0313502b /src/gallium/auxiliary/translate/translate_generic.c
parent945e38c73b46afc12b0655f9fc8200f216a8f8c1 (diff)
translate_generic: fix broken A8R8G8B8_UNORM output
translate was attempting to output A8R8G8B8_UNORM as if it were R8G8B8A8_UNORM. Now the tests just added pass.
Diffstat (limited to 'src/gallium/auxiliary/translate/translate_generic.c')
-rw-r--r--src/gallium/auxiliary/translate/translate_generic.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c
index 809a4e47f4d..021099ae980 100644
--- a/src/gallium/auxiliary/translate/translate_generic.c
+++ b/src/gallium/auxiliary/translate/translate_generic.c
@@ -187,9 +187,15 @@ ATTRIB( R8G8B8_SNORM, 3, char, TO_8_SNORM )
ATTRIB( R8G8_SNORM, 2, char, TO_8_SNORM )
ATTRIB( R8_SNORM, 1, char, TO_8_SNORM )
-ATTRIB( A8R8G8B8_UNORM, 4, ubyte, TO_8_UNORM )
-/*ATTRIB( R8G8B8A8_UNORM, 4, ubyte, TO_8_UNORM )*/
-
+static void
+emit_A8R8G8B8_UNORM( const float *attrib, void *ptr)
+{
+ ubyte *out = (ubyte *)ptr;
+ out[0] = TO_8_UNORM(attrib[3]);
+ out[1] = TO_8_UNORM(attrib[0]);
+ out[2] = TO_8_UNORM(attrib[1]);
+ out[3] = TO_8_UNORM(attrib[2]);
+}
static void
emit_B8G8R8A8_UNORM( const float *attrib, void *ptr)