summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-05 02:21:19 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-05 02:21:19 +0000
commit3ce2d21558fa0568ab7d332a5c300a661e444f44 (patch)
treed0e437d0d88658844e0134b1c8ac6ef27e96a296 /Graphics/GraphicsEngineD3D11
parentImplemented input attachments in Vulkan backend; added test (diff)
downloadDiligentCore-3ce2d21558fa0568ab7d332a5c300a661e444f44.tar.gz
DiligentCore-3ce2d21558fa0568ab7d332a5c300a661e444f44.zip
Added more renderpass-related checks
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 857ed7c5..c6f9d289 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -627,6 +627,12 @@ void DeviceContextD3D11Impl::TransitionShaderResources(IPipelineState* pPipeline
{
DEV_CHECK_ERR(pPipelineState != nullptr, "Pipeline state must not be null");
DEV_CHECK_ERR(pShaderResourceBinding != nullptr, "Shader resource binding must not be null");
+ if (m_pActiveRenderPass)
+ {
+ LOG_ERROR_MESSAGE("State transitions are not allowed inside a render pass.");
+ return;
+ }
+
TransitionAndCommitShaderResources<true, false>(pPipelineState, pShaderResourceBinding, false);
}
@@ -955,6 +961,11 @@ void DeviceContextD3D11Impl::ClearRenderTarget(ITextureView* pView, const float*
void DeviceContextD3D11Impl::Flush()
{
+ if (m_pActiveRenderPass != nullptr)
+ {
+ LOG_ERROR_MESSAGE("Flushing device context inside an active render pass.");
+ }
+
m_pd3d11DeviceContext->Flush();
}
@@ -1721,6 +1732,8 @@ void DeviceContextD3D11Impl::ReleaseCommittedShaderResources()
void DeviceContextD3D11Impl::FinishCommandList(ICommandList** ppCommandList)
{
+ VERIFY(m_pActiveRenderPass == nullptr, "Finishing command list inside an active render pass.");
+
CComPtr<ID3D11CommandList> pd3d11CmdList;
m_pd3d11DeviceContext->FinishCommandList(
FALSE, // A Boolean flag that determines whether the runtime saves deferred context state before it
@@ -1963,6 +1976,8 @@ void DeviceContextD3D11Impl::InvalidateState()
void DeviceContextD3D11Impl::TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers)
{
+ VERIFY(m_pActiveRenderPass == nullptr, "State transitions are not allowed inside a render pass");
+
for (Uint32 i = 0; i < BarrierCount; ++i)
{
const auto& Barrier = pResourceBarriers[i];