return D3D_OK;
}
+#define ALPHA_TO_COVERAGE_ENABLE MAKEFOURCC('A', '2', 'M', '1')
+#define ALPHA_TO_COVERAGE_DISABLE MAKEFOURCC('A', '2', 'M', '0')
+
HRESULT WINAPI
NineDevice9_SetRenderState( struct NineDevice9 *This,
D3DRENDERSTATETYPE State,
DBG("This=%p State=%u(%s) Value=%08x\n", This,
State, nine_d3drs_to_string(State), Value);
- if (State == D3DRS_POINTSIZE && Value == RESZ_CODE)
- return NineDevice9_ResolveZ(This);
+ /* Amd hacks (equivalent to GL extensions) */
+ if (State == D3DRS_POINTSIZE) {
+ if (Value == RESZ_CODE)
+ return NineDevice9_ResolveZ(This);
+
+ if (Value == ALPHA_TO_COVERAGE_ENABLE ||
+ Value == ALPHA_TO_COVERAGE_DISABLE) {
+ state->rs[NINED3DRS_ALPHACOVERAGE] = (Value == ALPHA_TO_COVERAGE_ENABLE);
+ state->changed.group |= NINE_STATE_BLEND;
+ return D3D_OK;
+ }
+ }
user_assert(State < Elements(state->rs), D3DERR_INVALIDCALL);
blend.dither = !!rs[D3DRS_DITHERENABLE];
/* blend.alpha_to_one = 0; */
- /* blend.alpha_to_coverage = 0; */ /* XXX */
+ blend.alpha_to_coverage = !!rs[NINED3DRS_ALPHACOVERAGE];
blend.rt[0].blend_enable = !!rs[D3DRS_ALPHABLENDENABLE];
if (blend.rt[0].blend_enable) {
[D3DRS_DESTBLENDALPHA] = D3DBLEND_ZERO,
[D3DRS_BLENDOPALPHA] = D3DBLENDOP_ADD,
[NINED3DRS_VSPOINTSIZE] = FALSE,
- [NINED3DRS_RTMASK] = 0xf
+ [NINED3DRS_RTMASK] = 0xf,
+ [NINED3DRS_ALPHACOVERAGE] = FALSE
};
static const DWORD nine_tex_stage_state_defaults[NINED3DTSS_LAST + 1] =
{
#define NINED3DRS_VSPOINTSIZE (D3DRS_BLENDOPALPHA + 1)
#define NINED3DRS_RTMASK (D3DRS_BLENDOPALPHA + 2)
#define NINED3DRS_ZBIASSCALE (D3DRS_BLENDOPALPHA + 3)
+#define NINED3DRS_ALPHACOVERAGE (D3DRS_BLENDOPALPHA + 4)
#define D3DRS_LAST D3DRS_BLENDOPALPHA
-#define NINED3DRS_LAST NINED3DRS_ZBIASSCALE /* 212 */
+#define NINED3DRS_LAST NINED3DRS_ALPHACOVERAGE /* 213 */
#define NINED3DSAMP_LAST NINED3DSAMP_SHADOW /* 15 */
#define NINED3DTSS_LAST D3DTSS_CONSTANT
#define NINED3DTS_LAST D3DTS_WORLDMATRIX(255)