29 #include "RenderDeviceD3D12.h" 30 #include "PipelineStateD3D12.h" 31 #include "PipelineStateBase.h" 32 #include "RootSignature.h" 33 #include "ShaderResourceLayoutD3D12.h" 34 #include "AdaptiveFixedBlockAllocator.h" 40 class FixedBlockMemoryAllocator;
50 virtual void QueryInterface(
const Diligent::INTERFACE_ID &IID, IObject **ppInterface );
58 virtual ID3D12RootSignature *
GetD3D12RootSignature()const override final{
return m_RootSig.GetD3D12RootSignature(); }
60 ShaderResourceCacheD3D12* CommitAndTransitionShaderResources(
IShaderResourceBinding *pShaderResourceBinding,
61 class CommandContext &Ctx,
63 bool TransitionResources)
const;
65 const RootSignature& GetRootSignature()
const{
return m_RootSig;}
67 const ShaderResourceLayoutD3D12& GetShaderResLayout(
SHADER_TYPE ShaderType)
const;
69 bool dbgContainsShaderResources()
const;
71 IMemoryAllocator &GetResourceCacheDataAllocator(){
return m_ResourceCacheDataAllocator;}
72 IMemoryAllocator &GetShaderResourceLayoutDataAllocator(Uint32 ActiveShaderInd)
75 auto *pAllocator = m_ResLayoutDataAllocators.GetAllocator(ActiveShaderInd);
79 IShaderVariable *GetDummyShaderVar(){
return &m_DummyVar;}
83 void ParseShaderResourceLayout(IShader *pShader);
86 CComPtr<ID3D12PipelineState> m_pd3d12PSO;
87 RootSignature m_RootSig;
88 DummyShaderVariable m_DummyVar;
92 class ResLayoutDataAllocators
95 ~ResLayoutDataAllocators()
97 for(
size_t i=0; i < _countof(m_pAllocators); ++i)
98 if(m_pAllocators[i] !=
nullptr)
99 DESTROY_POOL_OBJECT(m_pAllocators[i]);
101 void Init(Uint32 NumActiveShaders, Uint32 SRBAllocationGranularity)
103 VERIFY_EXPR(NumActiveShaders <= _countof(m_pAllocators) );
104 for(Uint32 i=0; i < NumActiveShaders; ++i)
105 m_pAllocators[i] = NEW_POOL_OBJECT(AdaptiveFixedBlockAllocator,
"Shader resource layout data allocator",
GetRawAllocator(), SRBAllocationGranularity);
107 AdaptiveFixedBlockAllocator *GetAllocator(Uint32 ActiveShaderInd)
109 VERIFY_EXPR(ActiveShaderInd < _countof(m_pAllocators) );
110 return m_pAllocators[ActiveShaderInd];
113 AdaptiveFixedBlockAllocator *m_pAllocators[5] = {};
114 }m_ResLayoutDataAllocators;
116 ShaderResourceLayoutD3D12* m_pShaderResourceLayouts[6] = {};
117 AdaptiveFixedBlockAllocator m_ResourceCacheDataAllocator;
121 std::unique_ptr<class ShaderResourceBindingD3D12Impl, STDDeleter<ShaderResourceBindingD3D12Impl, FixedBlockMemoryAllocator> > m_pDefaultShaderResBinding;
Template class implementing base functionality for a pipeline state object.
Definition: PipelineStateBase.h:46
virtual void CreateShaderResourceBinding(IShaderResourceBinding **ppShaderResourceBinding) override
Creates a shader resource binding object.
Definition: PipelineStateD3D12Impl.cpp:260
virtual ID3D12PipelineState * GetD3D12PipelineState() const override final
Returns ID3D12PipelineState interface of the internal D3D12 pipeline state object object...
Definition: PipelineStateD3D12Impl.h:52
SHADER_TYPE
Describes the shader type.
Definition: Shader.h:46
Implementation of the Diligent::RootSignature class.
Definition: RootSignature.h:161
virtual void BindShaderResources(IResourceMapping *pResourceMapping, Uint32 Flags) override
Binds resources for all shaders in the pipeline state.
Definition: PipelineStateD3D12Impl.cpp:244
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
IMemoryAllocator & GetRawAllocator()
Returns raw memory allocator.
Definition: EngineMemory.cpp:46
Resouce mapping.
Definition: ResourceMapping.h:80
Shader resource binding interface.
Definition: ShaderResourceBinding.h:40
Implementation of the Diligent::IRenderDeviceD3D12 interface.
Definition: PipelineStateD3D12Impl.h:42
Uint32 m_NumShaders
Number of shaders that this PSO uses.
Definition: PipelineStateBase.h:191
virtual ID3D12RootSignature * GetD3D12RootSignature() const override final
Returns a pointer to the root signature object associated with this pipeline state.
Definition: PipelineStateD3D12Impl.h:58
Pipeline state description.
Definition: PipelineState.h:179
Implementation of the Diligent::IRenderDeviceD3D12 interface.
Definition: RenderDeviceD3D12Impl.h:43