瀏覽代碼

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

Asad M. Zaman 22 年之前
父節點
當前提交
458d86dcbf
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx

+ 4 - 2
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();
 }
 
 ////////////////////////////////////////////////////////////////////