summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-10-02 16:43:33 -0700
committerEric Anholt <[email protected]>2017-10-10 11:42:05 -0700
commitdc25a83a7a0b71548d0d7b6f0021f73450ce0c6d (patch)
tree725a8c194c036088a64b1359defcce6ab4250485 /src/gallium/drivers
parentf0ee7d6ba85c0695e276b61c8c8113552d8bde6c (diff)
broadcom/vc5: Start hooking up multiple render targets support.
We now emit as many TLB color writes as there are color buffers.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/vc5/vc5_program.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc5/vc5_program.c b/src/gallium/drivers/vc5/vc5_program.c
index f22f474954c..d5634c7a7d3 100644
--- a/src/gallium/drivers/vc5/vc5_program.c
+++ b/src/gallium/drivers/vc5/vc5_program.c
@@ -357,12 +357,18 @@ vc5_update_compiled_fs(struct vc5_context *vc5, uint8_t prim_mode)
key->alpha_test_func = vc5->zsa->base.alpha.func;
}
- if (vc5->framebuffer.cbufs[0]) {
- struct pipe_surface *cbuf = vc5->framebuffer.cbufs[0];
+ /* gl_FragColor's propagation to however many bound color buffers
+ * there are means that the buffer count needs to be in the key.
+ */
+ key->nr_cbufs = vc5->framebuffer.nr_cbufs;
+
+ for (int i = 0; i < key->nr_cbufs; i++) {
+ struct pipe_surface *cbuf = vc5->framebuffer.cbufs[i];
const struct util_format_description *desc =
util_format_description(cbuf->format);
- key->swap_color_rb = desc->swizzle[0] == PIPE_SWIZZLE_Z;
+ if (desc->swizzle[0] == PIPE_SWIZZLE_Z)
+ key->swap_color_rb |= 1 << i;
}
if (key->is_points) {