Reviewed-by: Jerome Glisse <jglisse@redhat.com>
struct r600_shader_key {
unsigned color_two_side:1;
unsigned alpha_to_one:1;
- unsigned dual_src_blend:1;
unsigned nr_cbufs:4;
};
case TGSI_PROCESSOR_FRAGMENT:
if (shader->output[i].name == TGSI_SEMANTIC_COLOR) {
/* never export more colors than the number of CBs */
- if (next_pixel_base && next_pixel_base >= key.nr_cbufs + key.dual_src_blend) {
+ if (next_pixel_base && next_pixel_base >= key.nr_cbufs) {
/* skip export */
j--;
continue;
key.alpha_to_one = rctx->alpha_to_one &&
rctx->multisample_enable &&
!rctx->framebuffer.cb0_is_integer;
- key.dual_src_blend = rctx->dual_src_blend;
key.nr_cbufs = rctx->framebuffer.state.nr_cbufs;
+ /* Dual-source blending only makes sense with nr_cbufs == 1. */
+ if (key.nr_cbufs == 1 && rctx->dual_src_blend)
+ key.nr_cbufs = 2;
}
return key;
}