From 458d86dcbf18ee28bc4ad30194ef71a8481e5588 Mon Sep 17 00:00:00 2001 From: "Asad M. Zaman" Date: Fri, 12 Sep 2003 21:55:47 +0000 Subject: [PATCH] fixed a crash bug with certain cards that do not support stencil buffer. The crash would fail the display of the first frame. Example card, PowerVR kyro --- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 0614bc38e8..32473a8a1e 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -4767,8 +4767,10 @@ void DXGraphicsStateGuardian8::set_render_target() { _pD3DDevice->GetDepthStencilSurface(&pStencil); _pD3DDevice->SetRenderTarget(pBack,pStencil); - pBack->Release(); - pStencil->Release(); + if (pBack) + pBack->Release(); + if (pStencil) + pStencil->Release(); } ////////////////////////////////////////////////////////////////////