/* NV hack */
if (unlikely(State == D3DRS_ADAPTIVETESS_Y)) {
if (Value == D3DFMT_ATOC || (Value == D3DFMT_UNKNOWN && state->rs[NINED3DRS_ALPHACOVERAGE])) {
- state->rs[NINED3DRS_ALPHACOVERAGE] = (Value == D3DFMT_ATOC);
+ state->rs[NINED3DRS_ALPHACOVERAGE] = (Value == D3DFMT_ATOC) ? 3 : 0;
+ state->rs[NINED3DRS_ALPHACOVERAGE] &= state->rs[D3DRS_ALPHATESTENABLE] ? 3 : 2;
state->changed.group |= NINE_STATE_BLEND;
return D3D_OK;
}
}
+ if (unlikely(State == D3DRS_ALPHATESTENABLE && (state->rs[NINED3DRS_ALPHACOVERAGE] & 2))) {
+ DWORD alphacoverage_prev = state->rs[NINED3DRS_ALPHACOVERAGE];
+ state->rs[NINED3DRS_ALPHACOVERAGE] = (Value ? 3 : 2);
+ if (state->rs[NINED3DRS_ALPHACOVERAGE] != alphacoverage_prev)
+ state->changed.group |= NINE_STATE_BLEND;
+ }
state->rs[State] = nine_fix_render_state_value(State, Value);
state->changed.rs[State / 32] |= 1 << (State % 32);
blend.dither = !!rs[D3DRS_DITHERENABLE];
/* blend.alpha_to_one = 0; */
- blend.alpha_to_coverage = !!rs[NINED3DRS_ALPHACOVERAGE];
+ blend.alpha_to_coverage = rs[NINED3DRS_ALPHACOVERAGE] & 1;
blend.rt[0].blend_enable = !!rs[D3DRS_ALPHABLENDENABLE];
if (blend.rt[0].blend_enable) {
#define NINED3DRS_VSPOINTSIZE (D3DRS_BLENDOPALPHA + 1)
#define NINED3DRS_RTMASK (D3DRS_BLENDOPALPHA + 2)
+/* ALPHACOVERAGE:
+ * bit 0: enable alpha coverage
+ * bit 1: ATOC is on
+ */
#define NINED3DRS_ALPHACOVERAGE (D3DRS_BLENDOPALPHA + 3)
#define D3DRS_LAST D3DRS_BLENDOPALPHA