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/nouveau/nv50 | |
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/nouveau/nv50')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_surface.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_vbo.c | 10 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c index 7a2402d72ed..34c2633916b 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c @@ -475,11 +475,11 @@ nv50_clear_texture(struct pipe_context *pipe, if (util_format_has_depth(desc)) { clear |= PIPE_CLEAR_DEPTH; - desc->unpack_z_float(&depth, 0, data, 0, 1, 1); + util_format_unpack_z_float(res->format, &depth, data, 1); } if (util_format_has_stencil(desc)) { clear |= PIPE_CLEAR_STENCIL; - desc->unpack_s_8uint(&stencil, 0, data, 0, 1, 1); + util_format_unpack_s_8uint(res->format, &stencil, data, 1); } pipe->clear_depth_stencil(pipe, sf, clear, depth, stencil, box->x, box->y, box->width, box->height, false); diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c index 865d8b4359d..da4a0171ac6 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c @@ -149,15 +149,7 @@ nv50_emit_vtxattr(struct nv50_context *nv50, struct pipe_vertex_buffer *vb, assert(vb->is_user_buffer); - if (desc->channel[0].pure_integer) { - if (desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) { - desc->unpack_rgba_sint((int32_t *)v, 0, data, 0, 1, 1); - } else { - desc->unpack_rgba_uint((uint32_t *)v, 0, data, 0, 1, 1); - } - } else { - desc->unpack_rgba_float(v, 0, data, 0, 1, 1); - } + util_format_unpack_rgba(ve->src_format, v, data, 1); switch (nc) { case 4: |