aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/d3d/D3dDeviceInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/native/d3d/D3dDeviceInfo.cpp')
-rw-r--r--src/native/d3d/D3dDeviceInfo.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/native/d3d/D3dDeviceInfo.cpp b/src/native/d3d/D3dDeviceInfo.cpp
index 7fffdf5..796889b 100644
--- a/src/native/d3d/D3dDeviceInfo.cpp
+++ b/src/native/d3d/D3dDeviceInfo.cpp
@@ -210,18 +210,25 @@ BOOL D3dDeviceInfo::supportAntialiasing() {
}
-void D3dDeviceInfo::findDepthStencilFormat(int minZDepth)
+void D3dDeviceInfo::findDepthStencilFormat(int minZDepth, int minZDepthStencil)
{
depthStencilFormat = D3DFMT_UNKNOWN;
- for (int i=0; i < D3DDEPTHFORMATSIZE; i++) {
- if (depthFormatSupport[i]) {
+ for (int i=0; i < D3DDEPTHFORMATSIZE; i++)
+ {
+ //printf("\ndepthFormatSupport %s, %b",getPixelFormatName(d3dDepthFormat[i]), depthFormatSupport[i]);
+ if (depthFormatSupport[i])
+ {
// prefer one with stencil buffer, follow by D3DFMT_D16_LOCKABLE,
- if (d3dDepthTable[i] >= minZDepth) {
- depthStencilFormat = (D3DFORMAT) d3dDepthFormat[i];
- break;
+ // printf("\n ZDepth %d, Stencil %d ",d3dDepthTable[i],d3dStencilDepthTable[i]);
+ if (d3dDepthTable[i] >= minZDepth && d3dStencilDepthTable[i] >= minZDepthStencil )
+ {
+ depthStencilFormat = (D3DFORMAT) d3dDepthFormat[i];
+ break;
}
- }
- }
+ }//if
+ }// for
+ // if none suitable found
+
}