From 120ed1c52f1157b7dc407fd3399c8f949a04fb6c Mon Sep 17 00:00:00 2001 From: Andrew Mac Date: Thu, 19 Nov 2015 22:51:58 -0400 Subject: [PATCH] Fix blit for depth textures. --- src/renderer_d3d11.cpp | 2 +- src/renderer_d3d9.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index f41b155c..f1009d47 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -4901,7 +4901,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); , 0 , src.m_ptr , srcZ*src.m_numMips+blit.m_srcMip - , &box + , isDepth((TextureFormat::Enum)src.m_textureFormat) ? NULL : &box ); } } diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 8fe2a7a4..951edf3f 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -3649,9 +3649,9 @@ namespace bgfx { namespace d3d9 // GetRenderTargetData (dst must be SYSTEMMEM) HRESULT hr = m_device->StretchRect(srcSurface - , &srcRect + , isDepth((TextureFormat::Enum)src.m_textureFormat) ? NULL : &srcRect , dstSurface - , &dstRect + , isDepth((TextureFormat::Enum)src.m_textureFormat) ? NULL : &dstRect , D3DTEXF_NONE ); if (FAILED(hr) )