diff --git a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx index 415502c374..d9545fe66d 100644 --- a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx @@ -270,7 +270,12 @@ bool wdxGraphicsWindow8:: open_window() { PT(DXGraphicsDevice8) dxdev; WindowProperties props; - bool discard_device = false; + + // For now, let's make this configurable. If this is true, then you + // can't open multiple different windows with the same GSG, but you + // may have more luck opening different windows with different + // GSG's. + bool discard_device = ConfigVariableBool("always-discard-device", true); // GSG creation/initialization. if (_gsg == 0) { diff --git a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx index 1a5c8e17c9..36376bc5b9 100755 --- a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx @@ -418,6 +418,10 @@ bool wdxGraphicsPipe9:: find_best_depth_format(DXScreenData &Display, D3DDISPLAYMODE &Test_display_mode, D3DFORMAT *pBestFmt, bool bWantStencil, bool bForce16bpp, bool bVerboseMode) const { + if (dxgsg9_cat.is_debug()) { + bVerboseMode = true; + } + // list fmts in order of preference #define NUM_TEST_ZFMTS 3 static D3DFORMAT NoStencilPrefList[NUM_TEST_ZFMTS] = {D3DFMT_D32, D3DFMT_D24X8, D3DFMT_D16}; @@ -544,6 +548,9 @@ search_for_valid_displaymode(DXScreenData &scrn, D3DFORMAT *pSuggestedPixFmt, bool bForce16bppZBuffer, bool bVerboseMode) { + if (dxgsg9_cat.is_debug()) { + bVerboseMode = true; + } assert(IS_VALID_PTR(scrn._d3d9)); @@ -590,7 +597,7 @@ search_for_valid_displaymode(DXScreenData &scrn, (scrn._max_available_video_memory != UNKNOWN_VIDMEM_SIZE) && (!special_check_fullscreen_resolution(scrn, RequestedX_Size, RequestedY_Size))); - if (bVerboseMode || wdxdisplay9_cat.is_spam()) { + if (bVerboseMode) { wdxdisplay9_cat.info() << "DoMemBasedChecks = " << bDoMemBasedChecks << endl; } @@ -674,7 +681,7 @@ search_for_valid_displaymode(DXScreenData &scrn, ((float)RequestedX_Size) * ((float)RequestedY_Size) * bytes_per_pixel * 2 + REQD_TEXMEM; - if (bVerboseMode || wdxdisplay9_cat.is_spam()) + if (bVerboseMode) wdxdisplay9_cat.info() << "Testing Mode (" < scrn._max_available_video_memory) { - if (bVerboseMode || wdxdisplay9_cat.is_debug()) + if (bVerboseMode) wdxdisplay9_cat.info() << "not enough VidMem for render tgt, skipping display fmt " << D3DFormatStr(dispmode.Format) << " (" @@ -707,7 +714,7 @@ search_for_valid_displaymode(DXScreenData &scrn, float zbytes_per_pixel = (IS_16BPP_ZBUFFER(zformat) ? 2 : 4); float MinMemReqmt = RendTgtMinMemReqmt + ((float)RequestedX_Size)*((float)RequestedY_Size)*zbytes_per_pixel; - if (bVerboseMode || wdxdisplay9_cat.is_spam()) + if (bVerboseMode) wdxdisplay9_cat.info() << "Testing Mode w/Z (" << RequestedX_Size << "x" << RequestedY_Size << ", " << D3DFormatStr(dispmode.Format) @@ -715,7 +722,7 @@ search_for_valid_displaymode(DXScreenData &scrn, << scrn._max_available_video_memory << endl; if (MinMemReqmt > scrn._max_available_video_memory) { - if (bVerboseMode || wdxdisplay9_cat.is_debug()) + if (bVerboseMode) wdxdisplay9_cat.info() << "not enough VidMem for RendTgt+zbuf, skipping display fmt " << D3DFormatStr(dispmode.Format) << " (" << (int)MinMemReqmt @@ -750,7 +757,7 @@ search_for_valid_displaymode(DXScreenData &scrn, } } - if (bVerboseMode || wdxdisplay9_cat.is_spam()) + if (bVerboseMode) wdxdisplay9_cat.info() << "Validated Mode (" << RequestedX_Size << "x" << RequestedY_Size << ", " << D3DFormatStr(dispmode.Format) << endl; @@ -797,7 +804,7 @@ search_for_valid_displaymode(DXScreenData &scrn, *pSuggestedPixFmt = D3DFMT_A2R10G10B10; } - if (bVerboseMode || wdxdisplay9_cat.is_spam()) { + if (bVerboseMode) { wdxdisplay9_cat.info() << "search_for_valid_device returns fmt: " << D3DFormatStr(*pSuggestedPixFmt) << endl; diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx index df4af42d7a..592bffb84b 100755 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx @@ -275,9 +275,13 @@ bool wdxGraphicsWindow9:: open_window() { PT(DXGraphicsDevice9) dxdev; WindowProperties props; - bool discard_device = false; - // GSG creation/initialization. + // For now, let's make this configurable. If this is true, then you + // can't open multiple different windows with the same GSG, but you + // may have more luck opening different windows with different + // GSG's. + bool discard_device = ConfigVariableBool("always-discard-device", true); + if (_gsg == 0) { _dxgsg = new DXGraphicsStateGuardian9(_pipe); _gsg = _dxgsg;