aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/d3d/D3dDeviceInfo.cpp
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2007-04-12 17:29:50 +0000
committerChien Yang <[email protected]>2007-04-12 17:29:50 +0000
commit7871bb635f0337fc1124a84d7a557736d0f2b647 (patch)
treeb909638c3768aa3745cccea35df13b7ac902998b /src/native/d3d/D3dDeviceInfo.cpp
parent4a9c4dc77959be041aa9cdddf9e18c25426355a2 (diff)
Fix to Issue 226 submitted by aces.
Issue 226 - D3D : fail on stress test for the creation and destruction of Canvases git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@816 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/native/d3d/D3dDeviceInfo.cpp')
-rw-r--r--src/native/d3d/D3dDeviceInfo.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/native/d3d/D3dDeviceInfo.cpp b/src/native/d3d/D3dDeviceInfo.cpp
index f018663..28683a7 100644
--- a/src/native/d3d/D3dDeviceInfo.cpp
+++ b/src/native/d3d/D3dDeviceInfo.cpp
@@ -245,23 +245,26 @@ BOOL D3dDeviceInfo::supportAntialiasing() {
void D3dDeviceInfo::findDepthStencilFormat(int minZDepth, int minZDepthStencil)
-{
+{
+ // Fix to Issue 226 : D3D - fail on stress test for the creation and destruction of Canvases
+ //sanity check of stencil and depth
+ minZDepthStencil = min(minZDepthStencil, 8);
+ minZDepth = min(minZDepth, 32);
+
depthStencilFormat = D3DFMT_UNKNOWN;
- 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,
- // 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
+ 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,
+ // 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
}
@@ -270,14 +273,16 @@ D3DMULTISAMPLE_TYPE D3dDeviceInfo::getBestMultiSampleType()
DWORD bitmask = 0;
UINT i;
- // start with 4, if none found, try 3 and 2
- for (i=4; i < 16; i++) {
+ // Fix to Issue 226 : D3D - fail on stress test for the creation and destruction of Canvases
+ // start with 4 and up, if none found, try 3 and 2
+ for (i=4; i <= 16; i++) {
bitmask = (1 << i);
if (multiSampleSupport & bitmask) {
return (D3DMULTISAMPLE_TYPE) i;
}
}
+ // try 3 and 2
for (i=3; i >= 2; i--) {
bitmask = (1 << i);
if (multiSampleSupport & bitmask) {