From 2ad7e7a1985a90588a623faa3f279ff07c52f62b Mon Sep 17 00:00:00 2001 From: assiduous Date: Fri, 6 Oct 2023 18:11:55 -0700 Subject: [PATCH] IDeviceContext::TransitionShaderResources removed unused pPipelineState parameter (API254001) --- Graphics/GraphicsEngine/interface/APIInfo.h | 2 +- Graphics/GraphicsEngine/interface/DeviceContext.h | 2 -- .../include/DeviceContextD3D11Impl.hpp | 3 +-- .../GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp | 3 +-- .../include/DeviceContextD3D12Impl.hpp | 3 +-- .../GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 3 +-- .../GraphicsEngineOpenGL/include/DeviceContextGLImpl.hpp | 2 +- Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 2 +- .../GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp | 3 +-- Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 2 +- ReleaseHistory.md | 4 ++++ Tests/DiligentCoreAPITest/src/DrawCommandTest.cpp | 4 ++-- Tests/DiligentCoreAPITest/src/RenderStateCacheTest.cpp | 8 ++++---- Tests/IncludeTest/GraphicsEngine/DeviceContextH_test.c | 2 +- 14 files changed, 20 insertions(+), 23 deletions(-) diff --git a/Graphics/GraphicsEngine/interface/APIInfo.h b/Graphics/GraphicsEngine/interface/APIInfo.h index c5c8e7c50..3fde9f0d3 100644 --- a/Graphics/GraphicsEngine/interface/APIInfo.h +++ b/Graphics/GraphicsEngine/interface/APIInfo.h @@ -30,7 +30,7 @@ /// \file /// Diligent API information -#define DILIGENT_API_VERSION 254000 +#define DILIGENT_API_VERSION 254001 #include "../../../Primitives/interface/BasicTypes.h" diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h index ebb1309e1..88f036433 100644 --- a/Graphics/GraphicsEngine/interface/DeviceContext.h +++ b/Graphics/GraphicsEngine/interface/DeviceContext.h @@ -2122,7 +2122,6 @@ DILIGENT_BEGIN_INTERFACE(IDeviceContext, IObject) /// Transitions shader resources to the states required by Draw or Dispatch command. /// - /// \param [in] pPipelineState - Pipeline state object that was used to create the shader resource binding. /// \param [in] pShaderResourceBinding - Shader resource binding whose resources will be transitioned. /// /// \remarks This method explicitly transitions all resources except ones in unknown state to the states required @@ -2139,7 +2138,6 @@ DILIGENT_BEGIN_INTERFACE(IDeviceContext, IObject) /// Refer to http://diligentgraphics.com/2018/12/09/resource-state-management/ for detailed explanation /// of resource state management in Diligent Engine. VIRTUAL void METHOD(TransitionShaderResources)(THIS_ - IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) PURE; /// Commits shader resources to the device context. diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp index 1ce9d5908..d2084792c 100644 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.hpp @@ -69,8 +69,7 @@ class DeviceContextD3D11Impl final : public DeviceContextBase virtual void DILIGENT_CALL_TYPE SetPipelineState(IPipelineState* pPipelineState) override final; /// Implementation of IDeviceContext::TransitionShaderResources() in OpenGL backend. - virtual void DILIGENT_CALL_TYPE TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) override final; + virtual void DILIGENT_CALL_TYPE TransitionShaderResources(IShaderResourceBinding* pShaderResourceBinding) override final; /// Implementation of IDeviceContext::CommitShaderResources() in OpenGL backend. virtual void DILIGENT_CALL_TYPE CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 84aab703d..44cc770df 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -169,7 +169,7 @@ void DeviceContextGLImpl::SetPipelineState(IPipelineState* pPipelineState) PrepareCommittedResources(m_BindInfo, DvpCompatibleSRBCount); } -void DeviceContextGLImpl::TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding) +void DeviceContextGLImpl::TransitionShaderResources(IShaderResourceBinding* pShaderResourceBinding) { DEV_CHECK_ERR(!m_pActiveRenderPass, "State transitions are not allowed inside a render pass."); } diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp index a227ac143..d1359c85d 100644 --- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp +++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.hpp @@ -85,8 +85,7 @@ class DeviceContextVkImpl final : public DeviceContextNextGenBaseTransitionShaderResources(pPSO, pSRB); + pContext->TransitionShaderResources(pSRB); DrawAttribs drawAttrs{3, DRAW_FLAG_VERIFY_ALL}; pContext->Draw(drawAttrs); UpdateBuffer(pPositionsBuffView, Pos + 3, 0, sizeof(float4) * 3); UpdateBuffer(pColorsBuffView, Color4, 4, sizeof(float4) * 3); - pContext->TransitionShaderResources(pPSO, pSRB); + pContext->TransitionShaderResources(pSRB); pContext->Draw(drawAttrs); diff --git a/Tests/DiligentCoreAPITest/src/RenderStateCacheTest.cpp b/Tests/DiligentCoreAPITest/src/RenderStateCacheTest.cpp index 4ce662ed7..24072fc6f 100644 --- a/Tests/DiligentCoreAPITest/src/RenderStateCacheTest.cpp +++ b/Tests/DiligentCoreAPITest/src/RenderStateCacheTest.cpp @@ -114,7 +114,7 @@ void TestDraw(IShader* pVS, pPSO->CreateShaderResourceBinding(&_pSRB); VERIFY_EXPR(pTexSRV != nullptr); _pSRB->GetVariableByName(SHADER_TYPE_PIXEL, "g_Tex2D")->Set(pTexSRV); - pCtx->TransitionShaderResources(pPSO, _pSRB); + pCtx->TransitionShaderResources(_pSRB); pSRB = _pSRB; } @@ -519,7 +519,7 @@ void TestGraphicsPSO(bool UseRenderPass) RefCntAutoPtr pRefSRB; pRefPSO->CreateShaderResourceBinding(&pRefSRB); pRefSRB->GetVariableByName(SHADER_TYPE_PIXEL, "g_Tex2D")->Set(pTexSRV); - pCtx->TransitionShaderResources(pRefPSO, pRefSRB); + pCtx->TransitionShaderResources(pRefSRB); for (Uint32 HotReload = 0; HotReload < 2; ++HotReload) { @@ -1229,9 +1229,9 @@ void TestPipelineReload(bool UseRenderPass, bool CreateSrbBeforeReload = false, (UseSignatures ? pSRB1 : pSRB0)->GetVariableByName(SHADER_TYPE_PIXEL, "g_Tex2D_Mut")->Set(RefTextures.GetView(2)); pSRB0->GetVariableByName(SHADER_TYPE_PIXEL, "g_Tex2D_Dyn")->Set(RefTextures.GetView(3)); - pCtx->TransitionShaderResources(pPSO, pSRB0); + pCtx->TransitionShaderResources(pSRB0); if (pSRB1) - pCtx->TransitionShaderResources(pPSO, pSRB1); + pCtx->TransitionShaderResources(pSRB1); }; RefCntAutoPtr pSRB0, pSRB1; diff --git a/Tests/IncludeTest/GraphicsEngine/DeviceContextH_test.c b/Tests/IncludeTest/GraphicsEngine/DeviceContextH_test.c index f49ea32ed..8401fc98d 100644 --- a/Tests/IncludeTest/GraphicsEngine/DeviceContextH_test.c +++ b/Tests/IncludeTest/GraphicsEngine/DeviceContextH_test.c @@ -37,7 +37,7 @@ void TestDeviceContextCInterface(struct IDeviceContext* pCtx) IDeviceContext_Begin(pCtx, 0u); - IDeviceContext_TransitionShaderResources(pCtx, (struct IPipelineState*)NULL, (struct IShaderResourceBinding*)NULL); + IDeviceContext_TransitionShaderResources(pCtx, (struct IShaderResourceBinding*)NULL); IDeviceContext_TransitionResourceStates(pCtx, 1u, (const struct StateTransitionDesc*)NULL); IDeviceContext_SetPipelineState(pCtx, (struct IPipelineState*)NULL);