From ea51b1121835ce26a04b2f695b69691df7f054bd Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Wed, 12 Jul 2006 01:49:36 +0000 Subject: [PATCH] Fix fullscreen with stencil. Problem was caused by attempted optimization by using a 16-bit depth buffer. --- panda/src/dxgsg9/wdxGraphicsPipe9.cxx | 61 +++++++++++++++------------ 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx index 1c648694c6..30e9d18853 100755 --- a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx @@ -94,7 +94,7 @@ make_output(const string &name, GraphicsOutput *host, int retry, bool &precertify) { - + if (!_is_valid) { return NULL; } @@ -103,7 +103,7 @@ make_output(const string &name, if (gsg != 0) { DCAST_INTO_R(wdxgsg, gsg, NULL); } - + // First thing to try: a visible window. if (retry == 0) { @@ -118,7 +118,7 @@ make_output(const string &name, return new wdxGraphicsWindow9(this, name, fb_prop, win_prop, flags, gsg, host); } - + // Second thing to try: a wdxGraphicsBuffer9 if (retry == 1) { @@ -139,7 +139,7 @@ make_output(const string &name, return new wdxGraphicsBuffer9(this, name, fb_prop, win_prop, flags, gsg, host); } - + // Nothing else left to try. return NULL; } @@ -553,15 +553,14 @@ search_for_valid_displaymode(DXScreenData &scrn, *p_supported_screen_depths_mask = 0x0; *pCouldntFindAnyValidZBuf = false; - #define TOTAL_D3D_FORMATS 6 + #define TOTAL_D3D_FORMATS 5 static D3DFORMAT d3d_format_array [TOTAL_D3D_FORMATS] = { D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5, - D3DFMT_A1R5G5B5, - D3DFMT_A2R10G10B10, // we may want this first in the list for XBOX 360 and HDR + D3DFMT_A2R10G10B10, // we may want this first in the list for XBOX 360 or HDR }; // search for an adapter with a valid D3DFORMAT @@ -653,7 +652,7 @@ search_for_valid_displaymode(DXScreenData &scrn, } bool bIs16bppRenderTgt = IS_16BPP_DISPLAY_FORMAT(dispmode.Format); - float RendTgtMinMemReqmt; + float RendTgtMinMemReqmt = 0.0f; // if we have a valid memavail value, try to determine if we have // enough space @@ -725,25 +724,28 @@ search_for_valid_displaymode(DXScreenData &scrn, } } - if ((!bDoMemBasedChecks) || (MinMemReqmt