summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-07 03:41:08 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-07 03:41:08 +0000
commita72d485f4b157d5c8fb488bc2afb3b9278e465b7 (patch)
treec542c04aee507fe12757f7d76dcf4f30df4513bf /Graphics/GraphicsEngineVulkan
parentAdded few debug checks (diff)
downloadDiligentCore-a72d485f4b157d5c8fb488bc2afb3b9278e465b7.tar.gz
DiligentCore-a72d485f4b157d5c8fb488bc2afb3b9278e465b7.zip
Treating subpass render target and depth stencil attachments as current RT and DS buffers
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 3162e3be..e5f37de3 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -1214,6 +1214,14 @@ void DeviceContextVkImpl::SetRenderTargets(Uint32 NumRen
ITextureView* pDepthStencil,
RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)
{
+#ifdef DILIGENT_DEVELOPMENT
+ if (m_pActiveRenderPass != nullptr)
+ {
+ LOG_ERROR_MESSAGE("Calling SetRenderTargets inside active render pass is invalid. End the render pass first");
+ return;
+ }
+#endif
+
if (TDeviceContextBase::SetRenderTargets(NumRenderTargets, ppRenderTargets, pDepthStencil))
{
FramebufferCache::FramebufferCacheKey FBKey;
@@ -1331,15 +1339,15 @@ void DeviceContextVkImpl::BeginRenderPass(const BeginRenderPassAttribs& Attribs)
void DeviceContextVkImpl::NextSubpass()
{
TDeviceContextBase::NextSubpass();
- EnsureVkCmdBuffer();
+ VERIFY_EXPR(m_CommandBuffer.GetVkCmdBuffer() != VK_NULL_HANDLE && m_CommandBuffer.GetState().RenderPass != VK_NULL_HANDLE);
m_CommandBuffer.NextSubpass();
}
void DeviceContextVkImpl::EndRenderPass(bool UpdateResourceStates)
{
TDeviceContextBase::EndRenderPass(UpdateResourceStates);
- EnsureVkCmdBuffer();
- m_CommandBuffer.EndRenderPass();
+ // TDeviceContextBase::EndRenderPass calls ResetRenderTargets() that in turn
+ // calls m_CommandBuffer.EndRenderPass()
if (m_State.NumCommands >= m_NumCommandsToFlush &&
!m_bIsDeferred && // Never flush deferred context