From 5981d4a4e67c01f291b9a05614aa1de2cb064713 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 2 Jul 2018 22:09:39 -0700 Subject: Fixed issues with RTV/DSV clears and 3D texture views in Vulkan --- Graphics/GraphicsEngine/include/DeviceContextBase.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Graphics/GraphicsEngine') 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 :: 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 :: 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 } -- cgit v1.2.3