Mesa (master): vc4: Fix clear color setup for RGB565.

Eric Anholt anholt at kemper.freedesktop.org
Sun Jan 11 04:38:07 UTC 2015


Module: Mesa
Branch: master
Commit: c1226629846613f9442e5fc5ad9be305176a4f0f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1226629846613f9442e5fc5ad9be305176a4f0f

Author: Eric Anholt <eric at anholt.net>
Date:   Sun Jan 11 10:58:58 2015 +1300

vc4: Fix clear color setup for RGB565.

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 |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index bb4b9a4..3a6d625 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -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




More information about the mesa-commit mailing list