diff options
author | Brian Paul <[email protected]> | 2014-01-16 18:32:47 -0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2014-01-21 10:53:51 -0800 |
commit | b9f68d927ea5e114b6019c807ce65674d9fa1d1d (patch) | |
tree | 66516d8234dc8bbf843ddc500d047bbeed94964c /src/gallium/drivers/svga/svga_tgsi_insn.c | |
parent | 384fd64ab1533df8256600733a1fc8413af3514a (diff) |
svga: implement TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
Fixes several colorbuffer tests, including piglit "fbo-drawbuffers-none"
for "gl_FragColor" and "glDrawPixels" cases.
v2: rework patch to only avoid creating extra shader variants when
TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS is not specified. Per Jose.
Use a write_color0_to_n_cbufs key field to replicate color0 to N
color buffers only when N > 0 and WRITES_ALL_CBUFS is set.
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_tgsi_insn.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_tgsi_insn.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index 21435462293..ce00da6fc0b 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -3074,6 +3074,15 @@ emit_ps_postamble(struct svga_shader_emitter *emit) one )) return FALSE; } + else if (emit->unit == PIPE_SHADER_FRAGMENT && + i < emit->key.fkey.write_color0_to_n_cbufs) { + /* Write temp color output [0] to true output [i] */ + if (!submit_op1(emit, inst_token(SVGA3DOP_MOV), + emit->true_color_output[i], + src(emit->temp_color_output[0]))) { + return FALSE; + } + } else { if (!submit_op1( emit, inst_token(SVGA3DOP_MOV), |