Permalink
Browse files

[WIN32] fixed: black screen on downscale

Happened in a specific case:
- HQ Scaler
- nVidia card
- screen size < video size

D3D in debug mode complains about a stencil buffer too small for the render target and the nVidia driver fails.
  • Loading branch information...
1 parent 749ac69 commit b02b8e85bff185023363e2b83d353100aaf53773 @CrystalP CrystalP committed Jan 30, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 xbmc/cores/VideoRenderers/WinRenderer.cpp
@@ -664,10 +664,20 @@ void CWinRenderer::Render(DWORD flags)
*/
CSingleLock lock(g_graphicsContext);
+ // Don't need a stencil/depth buffer and a buffer smaller than the render target causes D3D complaints and nVidia issues
+ // Save & restore when we're done.
+ LPDIRECT3DSURFACE9 pZBuffer;
+ LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice();
+ pD3DDevice->GetDepthStencilSurface(&pZBuffer);
+ pD3DDevice->SetDepthStencilSurface(NULL);
+
if (m_renderMethod == RENDER_SW)
RenderSW();
else if (m_renderMethod == RENDER_PS)
RenderPS();
+
+ pD3DDevice->SetDepthStencilSurface(pZBuffer);
+ pZBuffer->Release();
}
void CWinRenderer::RenderSW()

0 comments on commit b02b8e8

Please sign in to comment.