aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-11-08 12:30:02 -0800
committerMarge Bot <[email protected]>2020-02-04 19:02:59 +0000
commitc574cda3c6a3f880f99e4e22967fc82e34609942 (patch)
tree4624753a3a745e978b1942c532982ded0e189603 /src/gallium/drivers/svga
parent333c9d5bb054d5ac5518e830b535e8a4f3f80187 (diff)
util: Make helper functions for pack/unpacking pixel rows.
Almost all users of the unpack functions don't have strides to plug in (and many are only doing one pixel!), and this will help simplify them. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_clear.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c
index 6aa74d5b69a..75507fc1752 100644
--- a/src/gallium/drivers/svga/svga_pipe_clear.c
+++ b/src/gallium/drivers/svga/svga_pipe_clear.c
@@ -309,8 +309,8 @@ svga_clear_texture(struct pipe_context *pipe,
stencil = 0;
}
else {
- desc->unpack_z_float(&depth, 0, data, 0, 1, 1);
- desc->unpack_s_8uint(&stencil, 0, data, 0, 1, 1);
+ util_format_unpack_z_float(surface->format, &depth, data, 1);
+ util_format_unpack_s_8uint(surface->format, &stencil, data, 1);
}
if (util_format_has_depth(desc)) {
@@ -367,18 +367,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.ui, data, 1);
}
/* Setup render target view */