summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-03 05:09:39 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-03 05:09:39 +0000
commit5981d4a4e67c01f291b9a05614aa1de2cb064713 (patch)
treefcc57f5d7e5816ae7359b311d1bb22363ba6cabe /Graphics/GraphicsEngine
parentImproved bound RTV,DSV - PSO mismatch reporting in D3D11 backend (diff)
downloadDiligentCore-5981d4a4e67c01f291b9a05614aa1de2cb064713.tar.gz
DiligentCore-5981d4a4e67c01f291b9a05614aa1de2cb064713.zip
Fixed issues with RTV/DSV clears and 3D texture views in Vulkan
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/DeviceContextBase.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h
index a3889bbb..5015a539 100644
--- a/Graphics/GraphicsEngine/include/DeviceContextBase.h
+++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h
@@ -447,16 +447,16 @@ inline bool DeviceContextBase<BaseInterface> :: SetRenderTargets( Uint32 NumRend
{
auto *pTex = pRTView->GetTexture();
const auto &TexDesc = pTex->GetDesc();
- m_FramebufferWidth = TexDesc.Width >> RTVDesc.MostDetailedMip;
- m_FramebufferHeight = TexDesc.Height >> RTVDesc.MostDetailedMip;
+ m_FramebufferWidth = std::max(TexDesc.Width >> RTVDesc.MostDetailedMip, 1U);
+ m_FramebufferHeight = std::max(TexDesc.Height >> RTVDesc.MostDetailedMip, 1U);
m_FramebufferSlices = RTVDesc.NumArraySlices;
}
else
{
#ifdef _DEBUG
const auto &TexDesc = pRTView->GetTexture()->GetDesc();
- VERIFY(m_FramebufferWidth == TexDesc.Width >> RTVDesc.MostDetailedMip, "Inconsitent render target sizes");
- VERIFY(m_FramebufferHeight == TexDesc.Height >> RTVDesc.MostDetailedMip, "Inconsitent render target sizes");
+ VERIFY(m_FramebufferWidth == std::max(TexDesc.Width >> RTVDesc.MostDetailedMip, 1U), "Inconsitent render target sizes");
+ VERIFY(m_FramebufferHeight == std::max(TexDesc.Height >> RTVDesc.MostDetailedMip, 1U), "Inconsitent render target sizes");
VERIFY(m_FramebufferSlices == RTVDesc.NumArraySlices, "Inconsitent number of layers in bound render targets");
#endif
}
@@ -482,16 +482,16 @@ inline bool DeviceContextBase<BaseInterface> :: SetRenderTargets( Uint32 NumRend
{
auto *pTex = pDepthStencil->GetTexture();
const auto &TexDesc = pTex->GetDesc();
- m_FramebufferWidth = TexDesc.Width >> DSVDesc.MostDetailedMip;
- m_FramebufferHeight = TexDesc.Height >> DSVDesc.MostDetailedMip;
+ m_FramebufferWidth = std::max(TexDesc.Width >> DSVDesc.MostDetailedMip, 1U);
+ m_FramebufferHeight = std::max(TexDesc.Height >> DSVDesc.MostDetailedMip, 1U);
m_FramebufferSlices = DSVDesc.NumArraySlices;
}
else
{
#ifdef _DEBUG
const auto &TexDesc = pDepthStencil->GetTexture()->GetDesc();
- VERIFY(m_FramebufferWidth == TexDesc.Width >> DSVDesc.MostDetailedMip, "Inconsitent render target sizes");
- VERIFY(m_FramebufferHeight == TexDesc.Height >> DSVDesc.MostDetailedMip, "Inconsitent render target sizes");
+ VERIFY(m_FramebufferWidth == std::max(TexDesc.Width >> DSVDesc.MostDetailedMip, 1U), "Inconsitent render target sizes");
+ VERIFY(m_FramebufferHeight == std::max(TexDesc.Height >> DSVDesc.MostDetailedMip, 1U), "Inconsitent render target sizes");
VERIFY(m_FramebufferSlices == DSVDesc.NumArraySlices, "Inconsitent number of layers in bound render targets");
#endif
}