Mesa (master): svga: Reuse util_format_unpack_rgba().
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 7 18:47:18 UTC 2020
Module: Mesa
Branch: master
Commit: c3d05003896f9c57cffed5a126ff48f367413089
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3d05003896f9c57cffed5a126ff48f367413089
Author: Eric Anholt <eric at anholt.net>
Date: Wed Jul 1 16:27:38 2020 -0700
svga: Reuse util_format_unpack_rgba().
This assumes that pipe_color_union is a vec4, but that seems safe.
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>
---
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 */
More information about the mesa-commit
mailing list