summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2019-11-08 12:30:02 -0800
committerMarge Bot <eric+marge@anholt.net>2020-02-04 19:02:59 +0000
commitc574cda3c6a3f880f99e4e22967fc82e34609942 (patch)
tree4624753a3a745e978b1942c532982ded0e189603 /src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
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 <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
index 6ed96509bf4..92bd7eb5b8e 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
@@ -184,17 +184,15 @@ nvc0_set_constant_vertex_attrib(struct nvc0_context *nvc0, const unsigned a)
PUSH_SPACE(push, 6);
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 5);
dst = &push->cur[1];
+ util_format_unpack_rgba(ve->src_format, dst, src, 1);
if (desc->channel[0].pure_integer) {
if (desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) {
mode = VTX_ATTR(a, 4, SINT, 32);
- desc->unpack_rgba_sint(dst, 0, src, 0, 1, 1);
} else {
mode = VTX_ATTR(a, 4, UINT, 32);
- desc->unpack_rgba_uint(dst, 0, src, 0, 1, 1);
}
} else {
mode = VTX_ATTR(a, 4, FLOAT, 32);
- desc->unpack_rgba_float(dst, 0, src, 0, 1, 1);
}
push->cur[0] = mode;
push->cur += 5;