summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/adapter9.c
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2015-01-07 18:43:20 +0100
committerAxel Davy <[email protected]>2015-02-06 00:07:18 +0100
commit42ac71a4e20c04a2cd7cd441274e5c527012a03c (patch)
tree80ad4134ee3809b9a06639d61f8f96c515968b73 /src/gallium/state_trackers/nine/adapter9.c
parent5c61f6344a93e2bddb1984dcc735b8bc587c5db9 (diff)
st/nine: Implement RESZ hack
This D3D hack allows to resolve a multisampled depth buffer into a single sampled one. Note that the implementation is slightly incorrect. When querying the content of D3DRS_POINTSIZE, it should return the resz code if it has been set. This behaviour will be implemented when state changes will be reworked. For now the current behaviour is ok, since apps use the D3DCREATE_PUREDEVICE flag when creating the device, which means they won't read states and in exchange get better performance. Reviewed-by: Tiziano Bacocco <[email protected]> Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/adapter9.c')
-rw-r--r--src/gallium/state_trackers/nine/adapter9.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/adapter9.c b/src/gallium/state_trackers/nine/adapter9.c
index bdf547e78c4..6ff197e1dfe 100644
--- a/src/gallium/state_trackers/nine/adapter9.c
+++ b/src/gallium/state_trackers/nine/adapter9.c
@@ -305,6 +305,12 @@ NineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This,
RType == D3DRTYPE_TEXTURE))
return D3D_OK;
+ /* RESZ hack */
+ if (CheckFormat == D3DFMT_RESZ && bind == PIPE_BIND_RENDER_TARGET &&
+ RType == D3DRTYPE_SURFACE)
+ return screen->get_param(screen, PIPE_CAP_MULTISAMPLE_Z_RESOLVE) ?
+ D3D_OK : D3DERR_NOTAVAILABLE;
+
if (Usage & D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING)
bind |= PIPE_BIND_BLENDABLE;