key->sprite_origin_lower_left = (svga->curr.rast->templ.sprite_coord_mode
== PIPE_SPRITE_COORD_LOWER_LEFT);
+ /* SVGA_NEW_FRAME_BUFFER */
+ if (fs->base.info.color0_writes_all_cbufs) {
+ /* Replicate color0 output to N colorbuffers */
+ key->write_color0_to_n_cbufs = svga->curr.framebuffer.nr_cbufs;
+ }
+
return PIPE_OK;
}
* SVGA_NEW_RAST
* SVGA_NEW_NEED_SWTNL
* SVGA_NEW_SAMPLER
+ * SVGA_NEW_FRAME_BUFFER
*/
ret = make_fs_key( svga, fs, &key );
if (ret != PIPE_OK)
SVGA_NEW_NEED_SWTNL |
SVGA_NEW_RAST |
SVGA_NEW_SAMPLER |
+ SVGA_NEW_FRAME_BUFFER |
SVGA_NEW_BLEND),
emit_hw_fs
};
{
switch (semantic.Name) {
case TGSI_SEMANTIC_COLOR:
- if (emit->unit == PIPE_SHADER_FRAGMENT &&
- emit->key.fkey.white_fragments) {
-
- emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
- emit->nr_hw_temp++ );
- emit->temp_color_output[idx] = emit->output_map[idx];
- emit->true_color_output[idx] = dst_register(SVGA3DREG_COLOROUT,
- semantic.Index);
+ if (emit->unit == PIPE_SHADER_FRAGMENT) {
+ if (emit->key.fkey.white_fragments) {
+ /* Used for XOR logicop mode */
+ emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
+ emit->nr_hw_temp++ );
+ emit->temp_color_output[idx] = emit->output_map[idx];
+ emit->true_color_output[idx] = dst_register(SVGA3DREG_COLOROUT,
+ semantic.Index);
+ }
+ else if (emit->key.fkey.write_color0_to_n_cbufs) {
+ /* We'll write color output [0] to all render targets.
+ * Prepare all the output registers here, but only when the
+ * semantic.Index == 0 so we don't do this more than once.
+ */
+ if (semantic.Index == 0) {
+ unsigned i;
+ for (i = 0; i < emit->key.fkey.write_color0_to_n_cbufs; i++) {
+ emit->output_map[i] = dst_register(SVGA3DREG_TEMP,
+ emit->nr_hw_temp++);
+ emit->temp_color_output[i] = emit->output_map[i];
+ emit->true_color_output[i] = dst_register(SVGA3DREG_COLOROUT,
+ i);
+ }
+ }
+ }
+ else {
+ emit->output_map[idx] =
+ dst_register(SVGA3DREG_COLOROUT, semantic.Index);
+ }
}
else {
emit->output_map[idx] = dst_register( SVGA3DREG_COLOROUT,
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),