diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-04-05 15:28:29 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-04-05 15:28:29 +0000 |
| commit | 06a38ea982ed1856d6fb9c143068ee8c68f59cef (patch) | |
| tree | 680565d999d684f1d8bf51974208bc3df8b26a47 /Graphics | |
| parent | Implemented staging textures in Vk backend (diff) | |
| download | DiligentCore-06a38ea982ed1856d6fb9c143068ee8c68f59cef.tar.gz DiligentCore-06a38ea982ed1856d6fb9c143068ee8c68f59cef.zip | |
Replaced overloaded IPipelineState::GetStaticShaderVariable() with IPipelineState::GetStaticVariableByName() and IPipelineState::GetStaticVariableByIndex() (closed https://github.com/DiligentGraphics/DiligentCore/issues/82).
Diffstat (limited to 'Graphics')
10 files changed, 19 insertions, 19 deletions
diff --git a/Graphics/GraphicsEngine/interface/PipelineState.h b/Graphics/GraphicsEngine/interface/PipelineState.h index 3b749f60..aed9b145 100644 --- a/Graphics/GraphicsEngine/interface/PipelineState.h +++ b/Graphics/GraphicsEngine/interface/PipelineState.h @@ -274,7 +274,7 @@ public: /// \param [in] Name - Name of the variable. /// \remark The method does not increment the reference counter /// of the returned interface. - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) = 0; + virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) = 0; /// Returns static shader resource variable by its index. @@ -287,7 +287,7 @@ public: /// \remark Only static shader resource variables can be accessed through this method. /// Mutable and dynamic variables are accessed through Shader Resource /// Binding object - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) = 0; + virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) = 0; /// Creates a shader resource binding object diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h index c56d8479..52efc621 100644 --- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h @@ -55,9 +55,9 @@ public: virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) override final; + virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) override final; + virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; virtual void CreateShaderResourceBinding( IShaderResourceBinding **ppShaderResourceBinding, bool InitStaticResources )override final; diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp index ff165df6..322e146f 100644 --- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp @@ -342,7 +342,7 @@ Uint32 PipelineStateD3D11Impl::GetStaticVariableCount(SHADER_TYPE ShaderType) co return m_pStaticResourceLayouts[LayoutInd].GetTotalResourceCount(); } -IShaderResourceVariable* PipelineStateD3D11Impl::GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) +IShaderResourceVariable* PipelineStateD3D11Impl::GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) { const auto LayoutInd = m_ResourceLayoutIndex[GetShaderTypeIndex(ShaderType)]; if (LayoutInd < 0) @@ -351,7 +351,7 @@ IShaderResourceVariable* PipelineStateD3D11Impl::GetStaticShaderVariable(SHADER_ return m_pStaticResourceLayouts[LayoutInd].GetShaderVariable(Name); } -IShaderResourceVariable* PipelineStateD3D11Impl::GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) +IShaderResourceVariable* PipelineStateD3D11Impl::GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) { const auto LayoutInd = m_ResourceLayoutIndex[GetShaderTypeIndex(ShaderType)]; if (LayoutInd < 0) diff --git a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h index fa51b6d0..079978b6 100644 --- a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h @@ -54,9 +54,9 @@ public: virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) override final; + virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) override final; + virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; virtual void CreateShaderResourceBinding( IShaderResourceBinding **ppShaderResourceBinding, bool InitStaticResources )override final; diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp index d1f015f3..ac065da6 100644 --- a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp @@ -462,7 +462,7 @@ Uint32 PipelineStateD3D12Impl::GetStaticVariableCount(SHADER_TYPE ShaderType) co return m_pStaticVarManagers[LayoutInd].GetVariableCount(); } -IShaderResourceVariable* PipelineStateD3D12Impl::GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) +IShaderResourceVariable* PipelineStateD3D12Impl::GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) { const auto LayoutInd = m_ResourceLayoutIndex[GetShaderTypeIndex(ShaderType)]; if (LayoutInd < 0) @@ -471,7 +471,7 @@ IShaderResourceVariable* PipelineStateD3D12Impl::GetStaticShaderVariable(SHADER_ return m_pStaticVarManagers[LayoutInd].GetVariable(Name); } -IShaderResourceVariable* PipelineStateD3D12Impl::GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) +IShaderResourceVariable* PipelineStateD3D12Impl::GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) { const auto LayoutInd = m_ResourceLayoutIndex[GetShaderTypeIndex(ShaderType)]; if (LayoutInd < 0) diff --git a/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h index 0c98d838..5d82d633 100644 --- a/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h @@ -56,9 +56,9 @@ public: virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) override final; + virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) override final; + virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; virtual void CreateShaderResourceBinding( IShaderResourceBinding** ppShaderResourceBinding, bool InitStaticResources )override final; diff --git a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp index 8c8a106c..ea853b4b 100644 --- a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp @@ -208,7 +208,7 @@ Uint32 PipelineStateGLImpl::GetStaticVariableCount(SHADER_TYPE ShaderType) const } } -IShaderResourceVariable* PipelineStateGLImpl::GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) +IShaderResourceVariable* PipelineStateGLImpl::GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) { if (m_GLProgram) { @@ -221,7 +221,7 @@ IShaderResourceVariable* PipelineStateGLImpl::GetStaticShaderVariable(SHADER_TYP } } -IShaderResourceVariable* PipelineStateGLImpl::GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) +IShaderResourceVariable* PipelineStateGLImpl::GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) { if (m_GLProgram) { diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h index e9be63a3..d63279bd 100644 --- a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h @@ -70,9 +70,9 @@ public: virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) override final; + virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; - virtual IShaderResourceVariable* GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) override final; + virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; void CommitAndTransitionShaderResources(IShaderResourceBinding* pShaderResourceBinding, DeviceContextVkImpl* pCtxVkImpl, diff --git a/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp b/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp index 4282b578..e989a98c 100644 --- a/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp +++ b/Graphics/GraphicsEngineVulkan/src/GenerateMipsVkHelper.cpp @@ -157,7 +157,7 @@ namespace Diligent PSODesc.ResourceLayout.NumStaticSamplers = 1; m_DeviceVkImpl.CreatePipelineState(PSODesc, &PSOs[NonPowOfTwo]); - PSOs[NonPowOfTwo]->GetStaticShaderVariable(SHADER_TYPE_COMPUTE, "CB")->Set(m_ConstantsCB); + PSOs[NonPowOfTwo]->GetStaticVariableByName(SHADER_TYPE_COMPUTE, "CB")->Set(m_ConstantsCB); } return PSOs; diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp index 776db721..b4be5e89 100644 --- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp @@ -641,7 +641,7 @@ Uint32 PipelineStateVkImpl::GetStaticVariableCount(SHADER_TYPE ShaderType) const return StaticVarMgr.GetVariableCount(); } -IShaderResourceVariable* PipelineStateVkImpl::GetStaticShaderVariable(SHADER_TYPE ShaderType, const Char* Name) +IShaderResourceVariable* PipelineStateVkImpl::GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) { const auto LayoutInd = m_ResourceLayoutIndex[GetShaderTypeIndex(ShaderType)]; if (LayoutInd < 0) @@ -651,7 +651,7 @@ IShaderResourceVariable* PipelineStateVkImpl::GetStaticShaderVariable(SHADER_TYP return StaticVarMgr.GetVariable(Name); } -IShaderResourceVariable* PipelineStateVkImpl::GetStaticShaderVariable(SHADER_TYPE ShaderType, Uint32 Index) +IShaderResourceVariable* PipelineStateVkImpl::GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) { const auto LayoutInd = m_ResourceLayoutIndex[GetShaderTypeIndex(ShaderType)]; if (LayoutInd < 0) |
