From 3ce2d21558fa0568ab7d332a5c300a661e444f44 Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 4 Aug 2020 19:21:19 -0700 Subject: Added more renderpass-related checks --- Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index d1df47e3..6d353e35 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -147,6 +147,11 @@ void DeviceContextGLImpl::SetPipelineState(IPipelineState* pPipelineState) void DeviceContextGLImpl::TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) { + if (m_pActiveRenderPass) + { + LOG_ERROR_MESSAGE("State transitions are not allowed inside a render pass."); + return; + } } void DeviceContextGLImpl::CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode) @@ -1037,6 +1042,11 @@ void DeviceContextGLImpl::ClearRenderTarget(ITextureView* pView, const float* RG void DeviceContextGLImpl::Flush() { + if (m_pActiveRenderPass != nullptr) + { + LOG_ERROR_MESSAGE("Flushing device context inside an active render pass."); + } + glFlush(); } @@ -1396,6 +1406,7 @@ void DeviceContextGLImpl::GenerateMips(ITextureView* pTexView) void DeviceContextGLImpl::TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers) { + VERIFY(m_pActiveRenderPass == nullptr, "State transitions are not allowed inside a render pass"); } void DeviceContextGLImpl::ResolveTextureSubresource(ITexture* pSrcTexture, -- cgit v1.2.3