From c3d05003896f9c57cffed5a126ff48f367413089 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Jul 2020 16:27:38 -0700 Subject: [PATCH] svga: Reuse util_format_unpack_rgba(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This assumes that pipe_color_union is a vec4, but that seems safe. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/svga/svga_pipe_clear.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 490f91b5fc9..0661d0a7899 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -352,18 +352,7 @@ svga_clear_texture(struct pipe_context *pipe, color.f[0] = color.f[1] = color.f[2] = color.f[3] = 0; } else { - if (util_format_is_pure_sint(surface->format)) { - /* signed integer */ - desc->unpack_rgba_sint(color.i, 0, data, 0, 1, 1); - } - else if (util_format_is_pure_uint(surface->format)) { - /* unsigned integer */ - desc->unpack_rgba_uint(color.ui, 0, data, 0, 1, 1); - } - else { - /* floating point */ - desc->unpack_rgba_float(color.f, 0, data, 0, 1, 1); - } + util_format_unpack_rgba(surface->format, &color, data, 1); } /* Setup render target view */ -- 2.30.2