frontend/nine: Fix ATOC handling

The previous code was incorrectly checking the previous
value of alphatestenable.
In addition, remove an optimization that cannot hit (as we
filter out redundant state settings).

cc: mesa-stable

Fixes: 1272640d5 ("st/nine: Fix alpha to coverage states")
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>
This commit is contained in:
Axel Davy 2022-07-29 21:15:01 +02:00
parent e5124e83ba
commit 4f953ad512

View file

@ -1437,11 +1437,8 @@ CSMT_ITEM_NO_WAIT(nine_context_set_render_state,
}
}
if (unlikely(State == D3DRS_ALPHATESTENABLE && (context->rs[NINED3DRS_ALPHACOVERAGE] & 2))) {
DWORD alphacoverage_prev = context->rs[NINED3DRS_ALPHACOVERAGE];
context->rs[NINED3DRS_ALPHACOVERAGE] &= 6;
context->rs[NINED3DRS_ALPHACOVERAGE] |= (context->rs[D3DRS_ALPHATESTENABLE] ? 1 : 0);
if (context->rs[NINED3DRS_ALPHACOVERAGE] != alphacoverage_prev)
context->changed.group |= NINE_STATE_BLEND;
context->rs[NINED3DRS_ALPHACOVERAGE] |= (Value ? 1 : 0);
}
context->rs[State] = nine_fix_render_state_value(State, Value);