st/nine: ATOC has effect only with ALPHATESTENABLE

ATOC extension does something only when alpha test is enabled.
Use a second bit to encode the difference with ATIATOC.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
This commit is contained in:
Axel Davy
2016-04-03 10:52:22 +02:00
parent edc5cdced5
commit f297e7de0f
3 changed files with 13 additions and 2 deletions
+8 -1
View File
@@ -2429,11 +2429,18 @@ NineDevice9_SetRenderState( struct NineDevice9 *This,
/* 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);
+1 -1
View File
@@ -162,7 +162,7 @@ nine_convert_blend_state(struct pipe_blend_state *blend_state, const DWORD *rs)
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) {
@@ -33,6 +33,10 @@
#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