summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2015-01-14 12:41:16 +0100
committerAxel Davy <[email protected]>2015-02-06 00:07:19 +0100
commit75676886e4dd43c1e9ab85891d1ab6b2bf1fad92 (patch)
treefeb250fbc71f1e257a930971bfae311ee627b6ee /src/gallium/state_trackers
parent0a4aaf1d411360c2a557fb016ffcb41f2701b9a2 (diff)
st/nine: Implement ATOC hack
ATOC is an hack for Alpha to coverage that is supported by NV and Intel. You need to check the support for it with CheckDeviceFormat. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/adapter9.c4
-rw-r--r--src/gallium/state_trackers/nine/device9.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/adapter9.c b/src/gallium/state_trackers/nine/adapter9.c
index 84578aca5ea..459aac3695f 100644
--- a/src/gallium/state_trackers/nine/adapter9.c
+++ b/src/gallium/state_trackers/nine/adapter9.c
@@ -307,6 +307,10 @@ NineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This,
return screen->get_param(screen, PIPE_CAP_MULTISAMPLE_Z_RESOLVE) ?
D3D_OK : D3DERR_NOTAVAILABLE;
+ /* ATOC hack */
+ if (CheckFormat == D3DFMT_ATOC && RType == D3DRTYPE_SURFACE)
+ return D3D_OK;
+
if (Usage & D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING)
bind |= PIPE_BIND_BLENDABLE;
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 63f9f16586e..46b4c5a6c44 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -2075,6 +2075,14 @@ NineDevice9_SetRenderState( struct NineDevice9 *This,
}
}
+ /* NV hack */
+ if (State == D3DRS_ADAPTIVETESS_Y &&
+ (Value == D3DFMT_ATOC || (Value == D3DFMT_UNKNOWN && state->rs[NINED3DRS_ALPHACOVERAGE]))) {
+ state->rs[NINED3DRS_ALPHACOVERAGE] = (Value == D3DFMT_ATOC);
+ state->changed.group |= NINE_STATE_BLEND;
+ return D3D_OK;
+ }
+
user_assert(State < Elements(state->rs), D3DERR_INVALIDCALL);
if (likely(state->rs[State] != Value) || unlikely(This->is_recording)) {