nv2a: Handle LSB mux flag

This commit is contained in:
Erik Abair 2022-02-02 23:57:26 -08:00 committed by mborgerson
parent f0abe3c4fc
commit cb0a92b46c
1 changed files with 7 additions and 2 deletions

View File

@ -479,8 +479,13 @@ static void add_stage_code(struct PixelShader *ps,
if (output.muxsum_op == PS_COMBINEROUTPUT_AB_CD_SUM) {
sum = mstring_from_fmt("(%s + %s)", mstring_get_str(ab), mstring_get_str(cd));
} else {
sum = mstring_from_fmt("((r0.a >= 0.5) ? %s(%s) : %s(%s))",
caster, mstring_get_str(cd), caster, mstring_get_str(ab));
if (ps->flags & PS_COMBINERCOUNT_MUX_MSB) {
sum = mstring_from_fmt("((r0.a >= 0.5) ? %s(%s) : %s(%s))",
caster, mstring_get_str(cd), caster, mstring_get_str(ab));
} else {
sum = mstring_from_fmt("(((uint(r0.a * 255.0) & 1u) == 1u) ? %s(%s) : %s(%s))",
caster, mstring_get_str(cd), caster, mstring_get_str(ab));
}
}
MString *sum_mapping = get_output(sum, output.mapping);