summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/device9.c
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2015-01-14 12:33:21 +0100
committerAxel Davy <[email protected]>2015-02-06 00:07:19 +0100
commit0a4aaf1d411360c2a557fb016ffcb41f2701b9a2 (patch)
tree2167058c8079475a18db08dfb6a42e0e6848ade4 /src/gallium/state_trackers/nine/device9.c
parentbf0adf248f3562e6fb205b31d14f650ab0a14c8e (diff)
st/nine: Implement AMD alpha to coverage
This D3D hack is supposed to be supported by all AMD SM2+ cards. Apps use it without checking if they are on AMD. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/device9.c')
-rw-r--r--src/gallium/state_trackers/nine/device9.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index a446c8f233c..63f9f16586e 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -2049,6 +2049,9 @@ NineDevice9_ResolveZ( struct NineDevice9 *This )
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,
@@ -2059,8 +2062,18 @@ NineDevice9_SetRenderState( struct NineDevice9 *This,
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);