diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-06-27 04:14:20 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-06-27 04:14:20 +0000 |
| commit | ecd151d725ec446be7718995ed110de1678d7d8f (patch) | |
| tree | 95955d04de4b7d76488d06ac963833751eea5b81 /Graphics/GraphicsEngineD3D11 | |
| parent | Improved SRB data allocation in D3D11 backend; removed AdaptiveFixedBlockAllo... (diff) | |
| download | DiligentCore-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.h | 4 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp | 6 |
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(); |
