Fix fullscreen with stencil. Problem was caused by attempted optimization by using a 16-bit depth buffer.

This commit is contained in:
aignacio_sf 2006-07-12 01:59:33 +00:00
parent ea51b11218
commit 5d709e329a

View File

@ -631,7 +631,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
@ -703,25 +703,28 @@ search_for_valid_displaymode(DXScreenData &scrn,
}
}
if ((!bDoMemBasedChecks) || (MinMemReqmt<scrn._max_available_video_memory)) {
if (!IS_16BPP_ZBUFFER(zformat)) {
// see if things fit with a 16bpp zbuffer
// Optimizing for 16-bit depth does not work in all cases so turn it off.
if (false) {
if ((!bDoMemBasedChecks) || (MinMemReqmt<scrn._max_available_video_memory)) {
if (!IS_16BPP_ZBUFFER(zformat)) {
// see if things fit with a 16bpp zbuffer
if (!find_best_depth_format(scrn, dispmode, &zformat,
bWantStencil, true, bVerboseMode)) {
if (bVerboseMode)
wdxdisplay8_cat.info()
<< "FindBestDepthFmt rejected Mode[" << i << "] ("
<< RequestedX_Size << "x" << RequestedY_Size
<< ", " << D3DFormatStr(dispmode.Format) << endl;
*pCouldntFindAnyValidZBuf = true;
continue;
if (!find_best_depth_format(scrn, dispmode, &zformat,
bWantStencil, true, bVerboseMode)) {
if (bVerboseMode)
wdxdisplay8_cat.info()
<< "FindBestDepthFmt rejected Mode[" << i << "] ("
<< RequestedX_Size << "x" << RequestedY_Size
<< ", " << D3DFormatStr(dispmode.Format) << endl;
*pCouldntFindAnyValidZBuf = true;
continue;
}
// right now I'm not going to use these flags, just let the
// create fail out-of-mem and retry at 16bpp
*p_supported_screen_depths_mask |=
(IS_16BPP_DISPLAY_FORMAT(dispmode.Format) ? DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG : DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG);
}
// right now I'm not going to use these flags, just let the
// create fail out-of-mem and retry at 16bpp
*p_supported_screen_depths_mask |=
(IS_16BPP_DISPLAY_FORMAT(dispmode.Format) ? DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG : DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG);
}
}
}