summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-01-01 14:01:14 -0700
committerBrian <[email protected]>2008-01-01 15:21:50 -0700
commit57a711f7275993e75aa00918065b876776618a17 (patch)
treec62c1a05f59d299fb71ee9ccd950b7b9deafc313
parent52659e3c238d961de1f25bed9254747f2f931547 (diff)
hack/fix pack_color() for correct ps3 format
-rw-r--r--src/mesa/pipe/cell/spu/tri.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/pipe/cell/spu/tri.c b/src/mesa/pipe/cell/spu/tri.c
index 90452f14ba6..cd648db3604 100644
--- a/src/mesa/pipe/cell/spu/tri.c
+++ b/src/mesa/pipe/cell/spu/tri.c
@@ -42,6 +42,7 @@
#include "pipe/p_compiler.h"
+#include "pipe/p_format.h"
#include "pipe/p_util.h"
#include "main.h"
#include "tri.h"
@@ -235,8 +236,16 @@ pack_color(const float color[4])
uint g = (uint) (color[1] * 255.0);
uint b = (uint) (color[2] * 255.0);
uint a = (uint) (color[3] * 255.0);
- uint icolor = (b << 24) | (g << 16) | (r << 8) | a;
- return icolor;
+ const enum pipe_format format = PIPE_FORMAT_A8R8G8B8_UNORM; /* XXX temp */
+ switch (format) {
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ return (a << 24) | (r << 16) | (g << 8) | b;
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
+ return (b << 24) | (g << 16) | (r << 8) | a;
+ default:
+ assert(0);
+ return 0;
+ }
}