broadcom/vc5: Fix setup of integer surface clear values.
authorEric Anholt <eric@anholt.net>
Wed, 28 Mar 2018 05:02:17 +0000 (22:02 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 29 Mar 2018 00:48:41 +0000 (17:48 -0700)
I'm disappointed that the compiler didn't warn me about use of
uninitialized uc in these paths.  Just use the incoming clear color
instead of the packing temporary if we're doing our own packing.

Fixes GTF-GLES3.gtf.GL3Tests.color_buffer_float.color_buffer_float_clamp_*

src/gallium/drivers/vc5/vc5_draw.c

index 841c991d205906490f204a0e045c68e632470631..ff14d1c13584c3875f45fb120a61e9a428e5c2d9 100644 (file)
@@ -633,10 +633,10 @@ vc5_clear(struct pipe_context *pctx, unsigned buffers,
                         break;
                 case V3D_INTERNAL_TYPE_8I:
                 case V3D_INTERNAL_TYPE_8UI:
-                        job->clear_color[i][0] = ((uc.ui[0] & 0xff) |
-                                                  (uc.ui[1] & 0xff) << 8 |
-                                                  (uc.ui[2] & 0xff) << 16 |
-                                                  (uc.ui[3] & 0xff) << 24);
+                        job->clear_color[i][0] = ((color->ui[0] & 0xff) |
+                                                  (color->ui[1] & 0xff) << 8 |
+                                                  (color->ui[2] & 0xff) << 16 |
+                                                  (color->ui[3] & 0xff) << 24);
                         break;
                 case V3D_INTERNAL_TYPE_16F:
                         util_pack_color(color->f, PIPE_FORMAT_R16G16B16A16_FLOAT,
@@ -645,10 +645,10 @@ vc5_clear(struct pipe_context *pctx, unsigned buffers,
                         break;
                 case V3D_INTERNAL_TYPE_16I:
                 case V3D_INTERNAL_TYPE_16UI:
-                        job->clear_color[i][0] = ((uc.ui[0] & 0xffff) |
-                                                  uc.ui[1] << 16);
-                        job->clear_color[i][1] = ((uc.ui[2] & 0xffff) |
-                                                  uc.ui[3] << 16);
+                        job->clear_color[i][0] = ((color->ui[0] & 0xffff) |
+                                                  color->ui[1] << 16);
+                        job->clear_color[i][1] = ((color->ui[2] & 0xffff) |
+                                                  color->ui[3] << 16);
                         break;
                 case V3D_INTERNAL_TYPE_32F:
                 case V3D_INTERNAL_TYPE_32I: