diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-07-04 01:40:30 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-07-04 01:40:30 +0000 |
| commit | cc80b5d69e2ecc84492561938815a934a7e39e24 (patch) | |
| tree | f682643cd33f565dcf08232a9d78623d856ef3bf /Graphics/GraphicsEngineVulkan | |
| parent | Updated projection functions in the math lib to take IsGL instead of IsDirect... (diff) | |
| download | DiligentCore-cc80b5d69e2ecc84492561938815a934a7e39e24.tar.gz DiligentCore-cc80b5d69e2ecc84492561938815a934a7e39e24.zip | |
Fixed DeviceContextVkImpl::CommitRenderPassAndFramebuffer() to check if framebuffer is different rather than rely on render pass. Fixed few issues in TextureVkImpl::CreateImageView()
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 14 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index e8f83022..7cc2e827 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -557,7 +557,7 @@ namespace Diligent if(pVkDSV == m_pBoundDepthStencil) { // Render pass may not be currently committed - VERIFY_EXPR(m_RenderPass != VK_NULL_HANDLE); + VERIFY_EXPR(m_RenderPass != VK_NULL_HANDLE && m_Framebuffer != VK_NULL_HANDLE); CommitRenderPassAndFramebuffer(); VkClearAttachment ClearAttachment = {}; @@ -680,7 +680,7 @@ namespace Diligent if(attachmentIndex != InvalidAttachmentIndex) { // Render pass may not be currently committed - VERIFY_EXPR(m_RenderPass != VK_NULL_HANDLE); + VERIFY_EXPR(m_RenderPass != VK_NULL_HANDLE && m_Framebuffer != VK_NULL_HANDLE); CommitRenderPassAndFramebuffer(); VkClearAttachment ClearAttachment = {}; @@ -904,15 +904,15 @@ namespace Diligent void DeviceContextVkImpl::CommitRenderPassAndFramebuffer() { const auto& CmdBufferState = m_CommandBuffer.GetState(); - if(CmdBufferState.RenderPass != m_RenderPass) + if (CmdBufferState.Framebuffer != m_Framebuffer) { - if(CmdBufferState.RenderPass != VK_NULL_HANDLE) + if (CmdBufferState.RenderPass != VK_NULL_HANDLE) m_CommandBuffer.EndRenderPass(); - if(m_RenderPass != VK_NULL_HANDLE) + if (m_Framebuffer != VK_NULL_HANDLE) { - VERIFY_EXPR(m_Framebuffer != VK_NULL_HANDLE); - if(m_pBoundDepthStencil) + VERIFY_EXPR(m_RenderPass != VK_NULL_HANDLE); + if (m_pBoundDepthStencil) { auto* pDSVVk = m_pBoundDepthStencil.RawPtr<TextureViewVkImpl>(); auto* pDepthBuffer = pDSVVk->GetTexture(); diff --git a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp index d7a29937..5ec367eb 100644 --- a/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/TextureVkImpl.cpp @@ -604,7 +604,7 @@ VulkanUtilities::ImageViewWrapper TextureVkImpl::CreateImageView(TextureViewDesc else { ImageViewCI.viewType = VK_IMAGE_VIEW_TYPE_3D; - if (ViewDesc.FirstDepthSlice != 0 && ViewDesc.NumDepthSlices == m_Desc.Depth) + if (ViewDesc.FirstDepthSlice != 0 || ViewDesc.NumDepthSlices != m_Desc.Depth) { LOG_ERROR_MESSAGE("In Vulkan SRVs and UAVs of a 3D texture must reference all depth slices."); ViewDesc.FirstDepthSlice = 0; |
