aco: fix PS epilog dual-source blending with only one color output

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40005>
This commit is contained in:
Rhys Perry 2026-02-20 12:01:11 +00:00 committed by Marge Bot
parent 783c065f3b
commit 82420ebc2c
2 changed files with 12 additions and 3 deletions

View file

@ -606,8 +606,8 @@ create_fs_dual_src_export_gfx11(isel_context* ctx, const struct aco_export_mrt*
aco_ptr<Instruction> exp{
create_instruction(aco_opcode::p_dual_src_export_gfx11, Format::PSEUDO, 10, 6)};
for (unsigned i = 0; i < 4; i++) {
exp->operands[i] = mrt0 ? mrt0->out[i] : Operand(v1);
exp->operands[i + 4] = mrt1 ? mrt1->out[i] : Operand(v1);
exp->operands[i] = mrt0->out[i];
exp->operands[i + 4] = mrt1->out[i];
}
instr_exact_mask(exp.get()) = Operand();

View file

@ -449,8 +449,17 @@ select_ps_epilog(Program* program, void* pinfo, ac_shader_config* config,
}
if (mrt_num) {
if (einfo->mrt0_is_dual_src && mrt_num == 1) {
mrts[mrt_num++] = mrts[0];
std::fill(mrts[1].out, mrts[1].out + 3, Operand(v1));
u_foreach_bit (i, mrts[1].enabled_channels)
mrts[1].out[i] = bld.copy(bld.def(v1), Operand::c32(0));
if (einfo->colors[1].used)
std::swap(mrts[0], mrts[1]);
mrts[1].target++;
}
if (ctx.options->gfx_level >= GFX11 && einfo->mrt0_is_dual_src) {
assert(mrt_num == 2);
create_fs_dual_src_export_gfx11(&ctx, &mrts[0], &mrts[1]);
} else {
for (unsigned i = 0; i < mrt_num; i++)