Lines Matching refs:blend
74 struct si_state_blend *blend = sctx->queued.named.blend;
77 uint32_t cb_target_mask = sctx->framebuffer.colorbuf_enabled_4bit & blend->cb_target_mask;
86 if (blend->dual_src_blend && sctx->shader.ps.cso &&
112 blend->dcc_msaa_corruption_4bit & cb_target_mask && sctx->framebuffer.nr_samples >= 2;
293 PRINT_ERR("Unknown blend function %d\n", blend_func);
350 PRINT_ERR("Bad blend factor %d not supported!\n", blend_fact);
400 static void si_blend_check_commutativity(struct si_screen *sscreen, struct si_state_blend *blend,
417 blend->commutative_4bit |= chanmask;
421 * Get rid of DST in the blend factors by commuting the operands:
443 struct si_state_blend *blend = CALLOC_STRUCT(si_state_blend);
444 struct si_pm4_state *pm4 = &blend->pm4;
449 if (!blend)
452 blend->alpha_to_coverage = state->alpha_to_coverage;
453 blend->alpha_to_one = state->alpha_to_one;
454 blend->dual_src_blend = util_blend_state_is_dual(state, 0);
455 blend->logicop_enable = logicop_enable;
456 blend->allows_noop_optimization =
466 if (blend->dual_src_blend)
490 blend->need_src_alpha_4bit |= 0xf;
492 blend->cb_target_mask = 0;
493 blend->cb_target_enabled_4bit = 0;
515 if (i >= 1 && blend->dual_src_blend) {
530 if (blend->dual_src_blend && (eqRGB == PIPE_BLEND_MIN || eqRGB == PIPE_BLEND_MAX ||
538 blend->cb_target_mask |= (unsigned)state->rt[j].colormask << (4 * i);
540 blend->cb_target_enabled_4bit |= 0xf << (4 * i);
547 si_blend_check_commutativity(sctx->screen, blend, eqRGB, srcRGB, dstRGB, 0x7 << (4 * i));
548 si_blend_check_commutativity(sctx->screen, blend, eqA, srcA, dstA, 0x8 << (4 * i));
553 * First, get rid of DST in the blend factors:
587 /* Set blend state. */
602 blend->blend_enable_4bit |= 0xfu << (i * 4);
605 blend->dcc_msaa_corruption_4bit |= 0xfu << (i * 4);
612 blend->need_src_alpha_4bit |= 0xfu << (i * 4);
616 blend->dcc_msaa_corruption_4bit |= blend->cb_target_enabled_4bit;
618 if (blend->cb_target_mask) {
625 /* Disable RB+ blend optimizations for dual source blending.
628 if (blend->dual_src_blend) {
639 if (blend->dual_src_blend || logicop_enable || mode == V_028808_CB_RESOLVE)
644 return blend;
731 struct si_state_blend *old_blend = sctx->queued.named.blend;
732 struct si_state_blend *blend = (struct si_state_blend *)state;
734 if (!blend)
735 blend = (struct si_state_blend *)sctx->noop_blend;
737 si_pm4_bind_state(sctx, blend, blend);
739 if (old_blend->cb_target_mask != blend->cb_target_mask ||
740 old_blend->dual_src_blend != blend->dual_src_blend ||
741 (old_blend->dcc_msaa_corruption_4bit != blend->dcc_msaa_corruption_4bit &&
746 old_blend->blend_enable_4bit != blend->blend_enable_4bit)
749 if (old_blend->cb_target_mask != blend->cb_target_mask ||
750 old_blend->alpha_to_coverage != blend->alpha_to_coverage ||
751 old_blend->alpha_to_one != blend->alpha_to_one ||
752 old_blend->dual_src_blend != blend->dual_src_blend ||
753 old_blend->blend_enable_4bit != blend->blend_enable_4bit ||
754 old_blend->need_src_alpha_4bit != blend->need_src_alpha_4bit) {
762 (old_blend->alpha_to_coverage != blend->alpha_to_coverage ||
763 old_blend->blend_enable_4bit != blend->blend_enable_4bit ||
764 old_blend->cb_target_enabled_4bit != blend->cb_target_enabled_4bit))
768 ((old_blend->blend_enable_4bit != blend->blend_enable_4bit ||
769 old_blend->cb_target_enabled_4bit != blend->cb_target_enabled_4bit ||
770 old_blend->commutative_4bit != blend->commutative_4bit ||
771 old_blend->logicop_enable != blend->logicop_enable)))
775 if (unlikely(blend->allows_noop_optimization)) {
788 if (sctx->queued.named.blend == state)
791 si_pm4_free_state(sctx, (struct si_pm4_state*)state, SI_STATE_IDX(blend));
1599 sctx->queued.named.blend->blend_enable_4bit &&
2508 surf->spi_shader_col_format_blend = formats.blend;
2558 /* blend clamp should be set for all NORM/SRGB types */
2563 /* set blend bypass according to docs if SINT/UINT or
3682 struct si_state_blend *blend = sctx->queued.named.blend;
3690 colormask &= blend->cb_target_enabled_4bit;
3693 if (colormask && blend->logicop_enable)
3720 unsigned blendmask = colormask & blend->blend_enable_4bit;
3724 if (blendmask & ~blend->commutative_4bit)
5391 struct pipe_blend_state blend;
5393 memset(&blend, 0, sizeof(blend));
5394 blend.independent_blend_enable = true;
5395 blend.rt[0].colormask = 0xf;
5396 return si_create_blend_state_mode(&sctx->b, &blend, mode);