summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-06-27 04:14:20 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-06-27 04:14:20 +0000
commitecd151d725ec446be7718995ed110de1678d7d8f (patch)
tree95955d04de4b7d76488d06ac963833751eea5b81 /Graphics/GraphicsEngineD3D11
parentImproved SRB data allocation in D3D11 backend; removed AdaptiveFixedBlockAllo... (diff)
downloadDiligentCore-ecd151d725ec446be7718995ed110de1678d7d8f.tar.gz
DiligentCore-ecd151d725ec446be7718995ed110de1678d7d8f.zip
Reworked shader memory alloction for resource layouts in D3D12 pipeline implementation
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h4
-rw-r--r--Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h
index 97ab9ba7..6823dbb0 100644
--- a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h
+++ b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h
@@ -63,8 +63,8 @@ public:
ID3DBlob* GetBytecode(){return m_pShaderByteCode;}
ShaderResourceLayoutD3D11& GetStaticResourceLayout(){return m_StaticResLayout;}
- const std::shared_ptr<const ShaderResourcesD3D11>& GetResources(){return m_pShaderResources;}
- Uint32 GetShaderTypeIndex(){return m_ShaderTypeIndex;}
+ const std::shared_ptr<const ShaderResourcesD3D11>& GetResources()const{return m_pShaderResources;}
+ Uint32 GetShaderTypeIndex()const{return m_ShaderTypeIndex;}
private:
diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
index 4241eb31..cd91edef 100644
--- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
@@ -119,7 +119,7 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCoun
std::array<size_t, MaxShadersInPipeline> ShaderResCacheDataSizes = {};
for (Uint32 s = 0; s < m_NumShaders; ++s)
{
- auto* pShader = ValidatedCast<ShaderD3D11Impl>(m_ppShaders[s]);
+ auto* pShader = GetShader<const ShaderD3D11Impl>(s);
const auto& ShaderResources = *pShader->GetResources();
std::array<SHADER_VARIABLE_TYPE, 2> AllowedVarTypes = { SHADER_VARIABLE_TYPE_MUTABLE, SHADER_VARIABLE_TYPE_DYNAMIC };
ShaderResLayoutDataSizes[s] = ShaderResourceLayoutD3D11::GetRequiredMemorySize(ShaderResources, AllowedVarTypes.data(), static_cast<Uint32>(AllowedVarTypes.size()));
@@ -201,8 +201,8 @@ bool PipelineStateD3D11Impl::IsCompatibleWith(const IPipelineState* pPSO)const
for (Uint32 s = 0; s < m_NumShaders; ++s)
{
- auto* pShader0 = ValidatedCast<ShaderD3D11Impl>(m_ppShaders[s]);
- auto* pShader1 = ValidatedCast<ShaderD3D11Impl>(pPSOD3D11->m_ppShaders[s]);
+ auto* pShader0 = GetShader<const ShaderD3D11Impl>(s);
+ auto* pShader1 = pPSOD3D11->GetShader<const ShaderD3D11Impl>(s);
if (pShader0->GetShaderTypeIndex() != pShader1->GetShaderTypeIndex())
return false;
const ShaderResourcesD3D11* pRes0 = pShader0->GetResources().get();