diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-10-20 07:13:28 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-10-20 07:13:28 +0000 |
| commit | 457e3c83ce5b08e95ae1cc07e9bc82296a003a28 (patch) | |
| tree | d51f9435e91e96042fd38ec1b7629e50f126e1d6 /Graphics/GraphicsEngineD3D12 | |
| parent | Added HLSLVersion, GLSLVersion and GLESSLVersion to ShaderCreateInfo struct (... (diff) | |
| download | DiligentCore-457e3c83ce5b08e95ae1cc07e9bc82296a003a28.tar.gz DiligentCore-457e3c83ce5b08e95ae1cc07e9bc82296a003a28.zip | |
Added DRAW_FLAG_RESOURCE_BUFFERS_INTACT flag (API Version 240036)
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h | 8 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h index 2bcb8004..b9561b3b 100644 --- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h @@ -288,12 +288,16 @@ private: VALUE_TYPE CommittedIBFormat = VT_UNDEFINED; Uint32 CommittedD3D12IndexDataStartOffset = 0; - // Flag indicating if currently committed D3D12 vertex buffers are up to date + // Indicates if currently committed D3D12 vertex buffers are up to date bool bCommittedD3D12VBsUpToDate = false; - // Fl indicating if currently committed D3D11 index buffer is up to date + // Indicates if currently committed D3D11 index buffer is up to date bool bCommittedD3D12IBUpToDate = false; + // Indicates if root views have been committed since the time SRB + // has been committed. + bool bRootViewsCommitted = false; + class ShaderResourceCacheD3D12* pCommittedResourceCache = nullptr; }m_State; diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 1a3a4985..c1608c4a 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -229,6 +229,7 @@ namespace Diligent } } m_State.pCommittedResourceCache = nullptr; + m_State.bRootViewsCommitted = false; } void DeviceContextD3D12Impl::TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) @@ -250,6 +251,7 @@ namespace Diligent m_pPipelineState->CommitAndTransitionShaderResources(pShaderResourceBinding, Ctx, true, StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_TRANSITION, StateTransitionMode == RESOURCE_STATE_TRANSITION_MODE_VERIFY); + m_State.bRootViewsCommitted = false; } void DeviceContextD3D12Impl::SetStencilRef(Uint32 StencilRef) @@ -392,7 +394,11 @@ namespace Diligent if (m_State.pCommittedResourceCache != nullptr) { - m_pPipelineState->GetRootSignature().CommitRootViews(*m_State.pCommittedResourceCache, GraphCtx, false, this); + if (!m_State.bRootViewsCommitted || (Flags & DRAW_FLAG_RESOURCE_BUFFERS_INTACT) == 0) + { + m_pPipelineState->GetRootSignature().CommitRootViews(*m_State.pCommittedResourceCache, GraphCtx, false, this); + m_State.bRootViewsCommitted = true; + } } #ifdef DEVELOPMENT else |
