From 04330a7e1d0198e721fd8d10379ab751b6826a35 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 3 Mar 2019 13:16:34 -0800 Subject: Cleaned up QueryInterface declarations --- .../GraphicsEngineD3D11/include/BufferD3D11Impl.h | 2 +- .../GraphicsEngineD3D11/include/BufferViewD3D11Impl.h | 2 +- .../include/DeviceContextD3D11Impl.h | 2 +- .../include/PipelineStateD3D11Impl.h | 19 ++++++++++++++++++- .../include/RenderDeviceD3D11Impl.h | 2 +- .../GraphicsEngineD3D11/include/SamplerD3D11Impl.h | 2 +- .../GraphicsEngineD3D11/include/SwapChainD3D11Impl.h | 2 +- .../GraphicsEngineD3D11/include/TextureBaseD3D11.h | 2 +- .../include/TextureViewD3D11Impl.h | 2 +- .../src/DeviceContextD3D11Impl.cpp | 4 ++-- 10 files changed, 28 insertions(+), 11 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h index 8b39f607..71b91345 100644 --- a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h @@ -58,7 +58,7 @@ public: ~BufferD3D11Impl(); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; virtual ID3D11Buffer* GetD3D11Buffer()override final{ return m_pd3d11Buffer; } diff --git a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h index 208dd1ee..d705536e 100644 --- a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h @@ -48,7 +48,7 @@ public: ID3D11View* pD3D11View, bool bIsDefaultView); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface ) final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject **ppInterface) final; virtual ID3D11View* GetD3D11View()override final { diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h index df013869..d9a0e44d 100755 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h @@ -59,7 +59,7 @@ public: ID3D11DeviceContext* pd3d11DeviceContext, const struct EngineD3D11Attribs& EngineAttribs, bool bIsDeferred); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; virtual void SetPipelineState(IPipelineState* pPipelineState)override final; diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h index af93c8eb..04e0edc0 100644 --- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h @@ -48,7 +48,7 @@ public: const PipelineStateDesc& PipelineDesc); ~PipelineStateD3D11Impl(); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; /// Implementation of the IPipelineStateD3D11::GetD3D11BlendState() method. virtual ID3D11BlendState* GetD3D11BlendState()override final; @@ -77,12 +77,29 @@ public: return m_SRBMemAllocator; } + const ShaderResourceLayoutD3D11& GetStaticResourceLayout(Uint32 s)const + { + VERIFY_EXPR(s < m_NumShaders); + return m_pStaticResourceLayouts[s]; + } + + ShaderResourceCacheD3D11& GetStaticResourceCache(Uint32 s) + { + VERIFY_EXPR(s < m_NumShaders); + return m_pStaticResourceCaches[s]; + } + + private: CComPtr m_pd3d11BlendState; CComPtr m_pd3d11RasterizerState; CComPtr m_pd3d11DepthStencilState; CComPtr m_pd3d11InputLayout; + // The caches are indexed by the shader order in the PSO, not shader index + ShaderResourceCacheD3D11* m_pStaticResourceCaches = nullptr; + ShaderResourceLayoutD3D11* m_pStaticResourceLayouts= nullptr; + // SRB memory allocator must be defined before the default shader res binding SRBMemoryAllocator m_SRBMemAllocator; }; diff --git a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h index 0e7f66ad..87189352 100644 --- a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h @@ -45,7 +45,7 @@ public: const EngineD3D11Attribs& EngineAttribs, ID3D11Device* pd3d11Device, Uint32 NumDeferredContexts ); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; virtual void CreateBuffer(const BufferDesc& BuffDesc, const BufferData* pBuffData, IBuffer** ppBuffer)override final; diff --git a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h index 5745bf18..4cac7884 100644 --- a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h @@ -46,7 +46,7 @@ public: const SamplerDesc& SamplerDesc); ~SamplerD3D11Impl(); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject** ppInterface ) final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; virtual ID3D11SamplerState* GetD3D11SamplerState()override final{ return m_pd3dSampler; } diff --git a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h index 7dd8680e..98d92676 100644 --- a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h @@ -47,7 +47,7 @@ public: void* pNativeWndHandle); ~SwapChainD3D11Impl(); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; virtual void Present(Uint32 SyncInterval)override final; virtual void Resize( Uint32 NewWidth, Uint32 NewHeight )override final; diff --git a/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h b/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h index 56ef5bc3..1333bd8e 100644 --- a/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h +++ b/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h @@ -51,7 +51,7 @@ public: const TextureData* pInitData = nullptr); ~TextureBaseD3D11(); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; virtual ID3D11Resource* GetD3D11Texture()override final{ return m_pd3d11Texture; } diff --git a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h index 3fcea2da..423b6dee 100644 --- a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h @@ -49,7 +49,7 @@ public: ID3D11View* pD3D11View, bool bIsDefaultView); - virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override final; + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; virtual ID3D11View* GetD3D11View()override final { diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index 03327e15..0c205533 100755 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -214,7 +214,7 @@ namespace Diligent #ifdef DEVELOPMENT auto* pShaderD3D11 = ValidatedCast(ppdbgShaders[s]); - VERIFY_EXPR( ShaderTypeInd == static_cast(pShaderD3D11->GetShaderTypeIndex()) ); + VERIFY_EXPR( ShaderTypeInd == static_cast(GetShaderTypeIndex(pShaderD3D11->GetDesc().ShaderType)) ); #endif auto& Cache = pShaderResBindingD3D11->GetResourceCache(s); @@ -360,7 +360,7 @@ namespace Diligent #ifdef DEVELOPMENT auto* pShaderD3D11 = ValidatedCast(ppdbgShaders[s]); - VERIFY_EXPR( ShaderTypeInd == static_cast(pShaderD3D11->GetShaderTypeIndex()) ); + VERIFY_EXPR( ShaderTypeInd == static_cast(GetShaderTypeIndex(pShaderD3D11->GetDesc().ShaderType)) ); #endif auto& Cache = pShaderResBindingD3D11->GetResourceCache(s); -- cgit v1.2.3