vc4: Fix clear color setup for RGB565.
authorEric Anholt <eric@anholt.net>
Sat, 10 Jan 2015 21:58:58 +0000 (10:58 +1300)
committerEric Anholt <eric@anholt.net>
Sun, 11 Jan 2015 04:17:19 +0000 (17:17 +1300)
The util_pack_color() thing only sets up the low bits of the union, so
only return them, too.  Fixes intermittent failure on
fbo-alphatest-formats and es3conform's framebuffer-objects test under
simulation.

src/gallium/drivers/vc4/vc4_draw.c

index bb4b9a42217e6fdf56b37b5e43fbc602fbd797d9..3a6d6254a1b55d048ceaf7dc31ed832c3a54384b 100644 (file)
@@ -288,7 +288,10 @@ pack_rgba(enum pipe_format format, const float *rgba)
 {
         union util_color uc;
         util_pack_color(rgba, format, &uc);
-        return uc.ui[0];
+        if (util_format_get_blocksize(format) == 2)
+                return uc.us;
+        else
+                return uc.ui[0];
 }
 
 static void