From 0279ac6e51e772bf9c374f4eb736d5f11d97d5f9 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 3 Jul 2019 09:14:25 +0200 Subject: v3d: add color formats and swizzles to the fragment shader key We are going to need these very soon to emit correct reads from the tlb to implement logic operations. Reviewed-by: Eric Anholt --- src/gallium/drivers/v3d/v3d_program.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gallium/drivers/v3d/v3d_program.c') diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c index cdacb5dbb80..78c41c8efd1 100644 --- a/src/gallium/drivers/v3d/v3d_program.c +++ b/src/gallium/drivers/v3d/v3d_program.c @@ -537,6 +537,17 @@ v3d_update_compiled_fs(struct v3d_context *v3d, uint8_t prim_mode) */ key->cbufs |= 1 << i; + /* If logic operations are enabled then we might emit color + * reads and we need to know the color buffer format and + * swizzle for that. + */ + if (key->logicop_func != PIPE_LOGICOP_COPY) { + key->color_fmt[i].format = cbuf->format; + key->color_fmt[i].swizzle = + v3d_get_format_swizzle(&v3d->screen->devinfo, + cbuf->format); + } + const struct util_format_description *desc = util_format_description(cbuf->format); -- cgit v1.2.3