From 1fe4c748f743d003fc9052f4a7d0925ab8c5919e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 27 Mar 2018 22:02:17 -0700 Subject: [PATCH] broadcom/vc5: Fix setup of integer surface clear values. 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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/vc5/vc5_draw.c b/src/gallium/drivers/vc5/vc5_draw.c index 841c991d205..ff14d1c1358 100644 --- a/src/gallium/drivers/vc5/vc5_draw.c +++ b/src/gallium/drivers/vc5/vc5_draw.c @@ -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: -- 2.30.2