diff options
author | Eric Anholt <[email protected]> | 2019-11-08 12:30:02 -0800 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-04 19:02:59 +0000 |
commit | c574cda3c6a3f880f99e4e22967fc82e34609942 (patch) | |
tree | 4624753a3a745e978b1942c532982ded0e189603 /src/gallium/drivers/radeonsi | |
parent | 333c9d5bb054d5ac5518e830b535e8a4f3f80187 (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/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_clear.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c index c0aceea66c4..b1858fb42fe 100644 --- a/src/gallium/drivers/radeonsi/si_clear.c +++ b/src/gallium/drivers/radeonsi/si_clear.c @@ -752,11 +752,12 @@ static void si_clear_texture(struct pipe_context *pipe, /* Depth is always present. */ clear = PIPE_CLEAR_DEPTH; - desc->unpack_z_float(&depth, 0, data, 0, 1, 1); + util_format_unpack_z_float(tex->format, &depth, data, 1); if (stex->surface.has_stencil) { clear |= PIPE_CLEAR_STENCIL; - desc->unpack_s_8uint(&stencil, 0, data, 0, 1, 1); + util_format_unpack_s_8uint(tex->format, + &stencil, data, 1); } si_clear_depth_stencil(pipe, sf, clear, depth, stencil, @@ -765,13 +766,7 @@ static void si_clear_texture(struct pipe_context *pipe, } else { union pipe_color_union color; - /* pipe_color_union requires the full vec4 representation. */ - if (util_format_is_pure_uint(tex->format)) - desc->unpack_rgba_uint(color.ui, 0, data, 0, 1, 1); - else if (util_format_is_pure_sint(tex->format)) - desc->unpack_rgba_sint(color.i, 0, data, 0, 1, 1); - else - desc->unpack_rgba_float(color.f, 0, data, 0, 1, 1); + util_format_unpack_rgba(tex->format, color.ui, data, 1); if (screen->is_format_supported(screen, tex->format, tex->target, 0, 0, |