From c7cc25364f15d5acd6ca070a5c87ec0d2ecb4bfd Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 5 Nov 2019 19:24:28 -0800 Subject: Direct3D11 backend: updated comments --- .../GraphicsEngineD3D11/include/BufferD3D11Impl.h | 4 +- .../include/BufferViewD3D11Impl.h | 4 +- .../include/CommandListD3D11Impl.h | 4 +- .../include/DeviceContextD3D11Impl.h | 56 ++++++++++++++++++---- .../GraphicsEngineD3D11/include/FenceD3D11Impl.h | 5 +- .../include/PipelineStateD3D11Impl.h | 30 +++++++++--- .../include/RenderDeviceD3D11Impl.h | 18 ++++++- .../GraphicsEngineD3D11/include/SamplerD3D11Impl.h | 4 +- .../GraphicsEngineD3D11/include/ShaderD3D11Impl.h | 6 ++- .../include/ShaderResourceBindingD3D11Impl.h | 8 +++- .../include/SwapChainD3D11Impl.h | 12 ++++- .../GraphicsEngineD3D11/include/Texture1D_D3D11.h | 2 +- .../GraphicsEngineD3D11/include/Texture2D_D3D11.h | 2 +- .../GraphicsEngineD3D11/include/Texture3D_D3D11.h | 2 +- .../GraphicsEngineD3D11/include/TextureBaseD3D11.h | 6 ++- .../include/TextureViewD3D11Impl.h | 5 +- 16 files changed, 133 insertions(+), 35 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h index ae06771e..80072c6e 100644 --- a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h @@ -37,7 +37,7 @@ namespace Diligent class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IBufferD3D11 interface +/// Buffer object implementation in Direct3D11 backend. class BufferD3D11Impl final : public BufferBase { public: @@ -60,8 +60,10 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IBufferD3D11::GetD3D11Buffer(). virtual ID3D11Buffer* GetD3D11Buffer()override final{ return m_pd3d11Buffer; } + /// Implementation of IBuffer::GetNativeHandle(). virtual void* GetNativeHandle()override final { return GetD3D11Buffer(); } void AddState(RESOURCE_STATE State) diff --git a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h index 8399de39..a6b4bebe 100644 --- a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h @@ -35,7 +35,8 @@ namespace Diligent { class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IBufferViewD3D11 interface + +/// Buffer view implementation in Direct3D11 backend. class BufferViewD3D11Impl final : public BufferViewBase { public: @@ -50,6 +51,7 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject **ppInterface) final; + /// Implementation of IBufferViewD3D11::GetD3D11View(). virtual ID3D11View* GetD3D11View()override final { return m_pD3D11View; diff --git a/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h index ac0b3b53..64ae68fe 100644 --- a/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h @@ -35,7 +35,7 @@ namespace Diligent class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::ICommandListD3D11 interface +/// Command list implementation in Direct3D11 backend. class CommandListD3D11Impl final : public CommandListBase { public: @@ -46,7 +46,7 @@ public: ID3D11CommandList* pd3d11CommandList); ~CommandListD3D11Impl(); - ID3D11CommandList *GetD3D11CommandList(){ return m_pd3d11CommandList; } + ID3D11CommandList* GetD3D11CommandList(){ return m_pd3d11CommandList; } private: CComPtr m_pd3d11CommandList; ///< D3D11 CommandList object diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h index 8dbd53ff..3ecb3388 100755 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h @@ -50,7 +50,7 @@ struct DeviceContextD3D11ImplTraits using DeviceType = RenderDeviceD3D11Impl; }; -/// Implementation of the Diligent::IDeviceContextD3D11 interface +/// Device context implementation in Direct3D11 backend. class DeviceContextD3D11Impl final : public DeviceContextBase { public: @@ -64,16 +64,22 @@ public: bool bIsDeferred); virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IDeviceContext::SetPipelineState() in Direct3D11 backend. virtual void SetPipelineState(IPipelineState* pPipelineState)override final; + /// Implementation of IDeviceContext::TransitionShaderResources() in Direct3D11 backend. virtual void TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding)override final; + /// Implementation of IDeviceContext::CommitShaderResources() in Direct3D11 backend. virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; + /// Implementation of IDeviceContext::SetStencilRef() in Direct3D11 backend. virtual void SetStencilRef(Uint32 StencilRef)override final; + /// Implementation of IDeviceContext::SetBlendFactors() in Direct3D11 backend. virtual void SetBlendFactors(const float* pBlendFactors = nullptr)override final; + /// Implementation of IDeviceContext::SetVertexBuffers() in Direct3D11 backend. virtual void SetVertexBuffers(Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, @@ -81,41 +87,56 @@ public: RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, SET_VERTEX_BUFFERS_FLAGS Flags)override final; + /// Implementation of IDeviceContext::InvalidateState() in Direct3D11 backend. virtual void InvalidateState()override final; + /// Implementation of IDeviceContext::SetIndexBuffer() in Direct3D11 backend. virtual void SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; + /// Implementation of IDeviceContext::SetViewports() in Direct3D11 backend. virtual void SetViewports(Uint32 NumViewports, const Viewport* pViewports, Uint32 RTWidth, Uint32 RTHeight)override final; + /// Implementation of IDeviceContext::SetScissorRects() in Direct3D11 backend. virtual void SetScissorRects(Uint32 NumRects, const Rect* pRects, Uint32 RTWidth, Uint32 RTHeight)override final; + /// Implementation of IDeviceContext::SetRenderTargets() in Direct3D11 backend. virtual void SetRenderTargets(Uint32 NumRenderTargets, ITextureView* ppRenderTargets[], ITextureView* pDepthStencil, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; + /// Implementation of IDeviceContext::Draw() in Direct3D11 backend. virtual void Draw (const DrawAttribs& Attribs)override final; + /// Implementation of IDeviceContext::DrawIndexed() in Direct3D11 backend. virtual void DrawIndexed (const DrawIndexedAttribs& Attribs)override final; + /// Implementation of IDeviceContext::DrawIndirect() in Direct3D11 backend. virtual void DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; + /// Implementation of IDeviceContext::DrawIndexedIndirect() in Direct3D11 backend. virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; + /// Implementation of IDeviceContext::DispatchCompute() in Direct3D11 backend. virtual void DispatchCompute(const DispatchComputeAttribs& Attribs)override final; + /// Implementation of IDeviceContext::DispatchComputeIndirect() in Direct3D11 backend. virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; + /// Implementation of IDeviceContext::ClearDepthStencil() in Direct3D11 backend. virtual void ClearDepthStencil(ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, Uint8 Stencil, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; + /// Implementation of IDeviceContext::ClearRenderTarget() in Direct3D11 backend. virtual void ClearRenderTarget(ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; + /// Implementation of IDeviceContext::UpdateBuffer() in Direct3D11 backend. virtual void UpdateBuffer(IBuffer* pBuffer, Uint32 Offset, Uint32 Size, const PVoid pData, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; + /// Implementation of IDeviceContext::CopyBuffer() in Direct3D11 backend. virtual void CopyBuffer(IBuffer* pSrcBuffer, Uint32 SrcOffset, RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, @@ -124,10 +145,13 @@ public: Uint32 Size, RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode)override final; + /// Implementation of IDeviceContext::MapBuffer() in Direct3D11 backend. virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData)override final; + /// Implementation of IDeviceContext::UnmapBuffer() in Direct3D11 backend. virtual void UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType)override final; + /// Implementation of IDeviceContext::UpdateTexture() in Direct3D11 backend. virtual void UpdateTexture(ITexture* pTexture, Uint32 MipLevel, Uint32 Slice, @@ -136,39 +160,51 @@ public: RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; + /// Implementation of IDeviceContext::CopyTexture() in Direct3D11 backend. virtual void CopyTexture(const CopyTextureAttribs& CopyAttribs)override final; - virtual void MapTextureSubresource( ITexture* pTexture, - Uint32 MipLevel, - Uint32 ArraySlice, - MAP_TYPE MapType, - MAP_FLAGS MapFlags, - const Box* pMapRegion, - MappedTextureSubresource& MappedData )override final; - + /// Implementation of IDeviceContext::MapTextureSubresource() in Direct3D11 backend. + virtual void MapTextureSubresource(ITexture* pTexture, + Uint32 MipLevel, + Uint32 ArraySlice, + MAP_TYPE MapType, + MAP_FLAGS MapFlags, + const Box* pMapRegion, + MappedTextureSubresource& MappedData)override final; + /// Implementation of IDeviceContext::UnmapTextureSubresource() in Direct3D11 backend. virtual void UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice)override final; + /// Implementation of IDeviceContext::GenerateMips() in Direct3D11 backend. virtual void GenerateMips(ITextureView* pTextureView)override final; + /// Implementation of IDeviceContext::FinishFrame() in Direct3D11 backend. virtual void FinishFrame()override final; + /// Implementation of IDeviceContext::TransitionResourceStates() in Direct3D11 backend. virtual void TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers)override final; + /// Implementation of IDeviceContext::FinishCommandList() in Direct3D11 backend. void FinishCommandList(class ICommandList** ppCommandList)override final; + /// Implementation of IDeviceContext::ExecuteCommandList() in Direct3D11 backend. virtual void ExecuteCommandList(class ICommandList* pCommandList)override final; + /// Implementation of IDeviceContext::SignalFence() in Direct3D11 backend. virtual void SignalFence(IFence* pFence, Uint64 Value)override final; + /// Implementation of IDeviceContext::WaitForFence() in Direct3D11 backend. virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext)override final; + /// Implementation of IDeviceContext::WaitForIdle() in Direct3D11 backend. virtual void WaitForIdle()override final; + /// Implementation of IDeviceContext::Flush() in Direct3D11 backend. virtual void Flush()override final; + /// Implementation of IDeviceContextD3D11::GetD3D11DeviceContext(). virtual ID3D11DeviceContext* GetD3D11DeviceContext()override final { return m_pd3d11DeviceContext; } - + void CommitRenderTargets(); /// Clears committed shader resource cache. This function diff --git a/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h index 5138e0b5..99eb7cea 100644 --- a/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h @@ -37,7 +37,7 @@ namespace Diligent class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IFenceD3D11 interface +/// Fence implementation in Direct3D11 backend. class FenceD3D11Impl final : public FenceBase { public: @@ -48,9 +48,10 @@ public: const FenceDesc& Desc); ~FenceD3D11Impl(); + /// Implementation of IFence::GetCompletedValue() in Direct3D11 backend. virtual Uint64 GetCompletedValue()override final; - /// Resets the fence to the specified value. + /// Implementation of IFence::Reset() in Direct3D11 backend. virtual void Reset(Uint64 Value)override final; void AddPendingQuery(CComPtr pCtx, CComPtr pQuery, Uint64 Value) diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h index 4a2c44f9..046974d2 100644 --- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h @@ -37,7 +37,8 @@ namespace Diligent { class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IPipelineStateD3D11 interface + +/// Pipeline state object implementation in Direct3D11 backend. class PipelineStateD3D11Impl final : public PipelineStateBase { public: @@ -50,36 +51,53 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; - + /// Implementation of IPipelineState::BindStaticResources() in Direct3D11 backend. virtual void BindStaticResources(Uint32 ShaderFlags, IResourceMapping* pResourceMapping, Uint32 Flags)override final; + /// Implementation of IPipelineState::GetStaticVariableCount() in Direct3D11 backend. virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; + /// Implementation of IPipelineState::GetStaticVariableByName() in Direct3D11 backend. virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; + /// Implementation of IPipelineState::GetStaticVariableByIndex() in Direct3D11 backend. virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; - virtual void CreateShaderResourceBinding( IShaderResourceBinding **ppShaderResourceBinding, bool InitStaticResources )override final; + /// Implementation of IPipelineState::CreateShaderResourceBinding() in Direct3D11 backend. + virtual void CreateShaderResourceBinding(IShaderResourceBinding **ppShaderResourceBinding, bool InitStaticResources)override final; + /// Implementation of IPipelineState::IsCompatibleWith() in Direct3D11 backend. virtual bool IsCompatibleWith(const IPipelineState *pPSO)const override final; - /// Implementation of the IPipelineStateD3D11::GetD3D11BlendState() method. + /// Implementation of IPipelineStateD3D11::GetD3D11BlendState() method. virtual ID3D11BlendState* GetD3D11BlendState()override final; - /// Implementation of the IPipelineStateD3D11::GetD3D11RasterizerState() method. + /// Implementation of IPipelineStateD3D11::GetD3D11RasterizerState() method. virtual ID3D11RasterizerState* GetD3D11RasterizerState()override final; - /// Implementation of the IPipelineStateD3D11::GetD3D11DepthStencilState() method. + /// Implementation of IPipelineStateD3D11::GetD3D11DepthStencilState() method. virtual ID3D11DepthStencilState* GetD3D11DepthStencilState()override final; + /// Implementation of IPipelineStateD3D11::GetD3D11InputLayout() method. virtual ID3D11InputLayout* GetD3D11InputLayout()override final; + /// Implementation of IPipelineStateD3D11::GetD3D11VertexShader() method. virtual ID3D11VertexShader* GetD3D11VertexShader()override final; + + /// Implementation of IPipelineStateD3D11::GetD3D11PixelShader() method. virtual ID3D11PixelShader* GetD3D11PixelShader()override final; + + /// Implementation of IPipelineStateD3D11::GetD3D11GeometryShader() method. virtual ID3D11GeometryShader* GetD3D11GeometryShader()override final; + + /// Implementation of IPipelineStateD3D11::GetD3D11DomainShader() method. virtual ID3D11DomainShader* GetD3D11DomainShader()override final; + + /// Implementation of IPipelineStateD3D11::GetD3D11HullShader() method. virtual ID3D11HullShader* GetD3D11HullShader()override final; + + /// Implementation of IPipelineStateD3D11::GetD3D11ComputeShader() method. virtual ID3D11ComputeShader* GetD3D11ComputeShader()override final; diff --git a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h index 44d3a7c5..bb3ec034 100644 --- a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h @@ -33,7 +33,7 @@ namespace Diligent { -/// Implementation of the Diligent::IRenderDeviceD3D11 interface +/// Render device implementation in Direct3D11 backend. class RenderDeviceD3D11Impl final : public RenderDeviceD3DBase { public: @@ -47,27 +47,43 @@ public: Uint32 NumDeferredContexts ); virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IRenderDevice::CreateBuffer() in Direct3D11 backend. virtual void CreateBuffer(const BufferDesc& BuffDesc, const BufferData* pBuffData, IBuffer** ppBuffer)override final; + /// Implementation of IRenderDevice::CreateShader() in Direct3D11 backend. virtual void CreateShader(const ShaderCreateInfo& ShaderCI, IShader** ppShader)override final; + /// Implementation of IRenderDevice::CreateTexture() in Direct3D11 backend. virtual void CreateTexture(const TextureDesc& TexDesc, const TextureData* pData, ITexture** ppTexture)override final; + /// Implementation of IRenderDevice::CreateSampler() in Direct3D11 backend. virtual void CreateSampler(const SamplerDesc& SamplerDesc, ISampler** ppSampler)override final; + /// Implementation of IRenderDevice::CreatePipelineState() in Direct3D11 backend. virtual void CreatePipelineState(const PipelineStateDesc &PipelineDesc, IPipelineState **ppPipelineState)override final; + /// Implementation of IRenderDevice::CreateFence() in Direct3D11 backend. virtual void CreateFence(const FenceDesc& Desc, IFence** ppFence)override final; + /// Implementation of IRenderDeviceD3D11::GetD3D11Device() in Direct3D11 backend. ID3D11Device* GetD3D11Device()override final{return m_pd3d11Device;} + /// Implementation of IRenderDeviceD3D11::CreateBufferFromD3DResource() in Direct3D11 backend. virtual void CreateBufferFromD3DResource(ID3D11Buffer* pd3d11Buffer, const BufferDesc& BuffDesc, RESOURCE_STATE InitialState, IBuffer** ppBuffer)override final; + + /// Implementation of IRenderDeviceD3D11::CreateTextureFromD3DResource() for 1D textures in Direct3D11 backend. virtual void CreateTextureFromD3DResource(ID3D11Texture1D* pd3d11Texture, RESOURCE_STATE InitialState, ITexture** ppTexture)override final; + + /// Implementation of IRenderDeviceD3D11::CreateTextureFromD3DResource() for 2D textures in Direct3D11 backend. virtual void CreateTextureFromD3DResource(ID3D11Texture2D* pd3d11Texture, RESOURCE_STATE InitialState, ITexture** ppTexture)override final; + + /// Implementation of IRenderDeviceD3D11::CreateTextureFromD3DResource() for 3D textures in Direct3D11 backend. virtual void CreateTextureFromD3DResource(ID3D11Texture3D* pd3d11Texture, RESOURCE_STATE InitialState, ITexture** ppTexture)override final; + /// Implementation of IRenderDevice::ReleaseStaleResources() in Direct3D11 backend. virtual void ReleaseStaleResources(bool ForceRelease = false)override final {} + /// Implementation of IRenderDevice::IdleGPU() in Direct3D11 backend. virtual void IdleGPU()override final; size_t GetCommandQueueCount()const { return 1; } diff --git a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h index 81d7dbab..0c97f209 100644 --- a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h @@ -35,7 +35,8 @@ namespace Diligent { class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::ISamplerD3D11 interface + +/// Sampler implementation in Direct3D11 backend. class SamplerD3D11Impl final : public SamplerBase { public: @@ -48,6 +49,7 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) override final; + /// Implementation of ISamplerD3D11::ISamplerD3D11() method. virtual ID3D11SamplerState* GetD3D11SamplerState()override final{ return m_pd3dSampler; } private: diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h index 3554be10..bb08d523 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h @@ -42,7 +42,7 @@ namespace Diligent class FixedBlockMemoryAllocator; class ResourceMapping; -/// Implementation of the Diligent::IShaderD3D11 interface +/// Shader implementation in Direct3D11 backend. class ShaderD3D11Impl final : public ShaderBase, public ShaderD3DBase { public: @@ -55,21 +55,25 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IShader::GetResourceCount() in Direct3D11 backend. virtual Uint32 GetResourceCount()const override final { return m_pShaderResources->GetTotalResources(); } + /// Implementation of IShader::GetResource() in Direct3D11 backend. virtual ShaderResourceDesc GetResource(Uint32 Index)const override final { return GetHLSLResource(Index); } + /// Implementation of IShaderD3D::GetHLSLResource() method. virtual HLSLShaderResourceDesc GetHLSLResource(Uint32 Index)const override final { return m_pShaderResources->GetHLSLShaderResourceDesc(Index); } + /// Implementation of IShaderD3D11::GetD3D11Shader() method. virtual ID3D11DeviceChild* GetD3D11Shader()override final { return m_pShader; diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.h index 92d78942..fad239d3 100755 --- a/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.h @@ -37,7 +37,8 @@ namespace Diligent { class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IShaderResourceBindingD3D11 interface + +/// Implementation of shader resource binding object in Direct3D11 backend. class ShaderResourceBindingD3D11Impl final : public ShaderResourceBindingBase { public: @@ -50,14 +51,19 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IShaderResourceBinding::BindResources() in Direct3D11 backend. virtual void BindResources(Uint32 ShaderFlags, IResourceMapping* pResMapping, Uint32 Flags)override final; + /// Implementation of IShaderResourceBinding::GetVariableByName() in Direct3D11 backend. virtual IShaderResourceVariable* GetVariableByName(SHADER_TYPE ShaderType, const char* Name)override final; + /// Implementation of IShaderResourceBinding::GetVariableCount() in Direct3D11 backend. virtual Uint32 GetVariableCount(SHADER_TYPE ShaderType) const override final; + /// Implementation of IShaderResourceBinding::GetVariableByIndex() in Direct3D11 backend. virtual IShaderResourceVariable* GetVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index)override final; + /// Implementation of IShaderResourceBinding::InitializeStaticResources() in Direct3D11 backend. virtual void InitializeStaticResources(const IPipelineState* pPipelineState)override final; ShaderResourceCacheD3D11& GetResourceCache (Uint32 Ind){VERIFY_EXPR(Ind < m_NumActiveShaders); return m_pBoundResourceCaches[Ind];} diff --git a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h index 4a0b3ab1..7d3f46b8 100644 --- a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h @@ -33,7 +33,8 @@ namespace Diligent { class IMemoryAllocator; -/// Implementation of the Diligent::ISwapChainD3D11 interface + +/// Swap chain implementation in Direct3D11 backend. class SwapChainD3D11Impl final : public SwapChainD3DBase { public: @@ -49,12 +50,19 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of ISwapChain::Present() in Direct3D11 backend. virtual void Present(Uint32 SyncInterval)override final; - virtual void Resize( Uint32 NewWidth, Uint32 NewHeight )override final; + /// Implementation of ISwapChain::Resize() in Direct3D11 backend. + virtual void Resize(Uint32 NewWidth, Uint32 NewHeight)override final; + + /// Implementation of ISwapChainD3D11::GetDXGISwapChain() in Direct3D11 backend. virtual IDXGISwapChain* GetDXGISwapChain()override final{ return m_pSwapChain; } + /// Implementation of ISwapChainD3D11::GetCurrentBackBufferRTV() in Direct3D11 backend. virtual ITextureViewD3D11* GetCurrentBackBufferRTV()override final{return m_pRenderTargetView;} + + /// Implementation of ISwapChainD3D11::GetDepthBufferDSV() in Direct3D11 backend. virtual ITextureViewD3D11* GetDepthBufferDSV() override final{return m_pDepthStencilView;} private: diff --git a/Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h b/Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h index 877d17e7..9bc827e9 100644 --- a/Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h +++ b/Graphics/GraphicsEngineD3D11/include/Texture1D_D3D11.h @@ -31,7 +31,7 @@ namespace Diligent { -/// Implementation of a 1D texture +/// Implementation of a 1D texture in Direct3D11 backend. class Texture1D_D3D11 final : public TextureBaseD3D11 { public: diff --git a/Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h b/Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h index 711102d3..9bcbd3a4 100644 --- a/Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h +++ b/Graphics/GraphicsEngineD3D11/include/Texture2D_D3D11.h @@ -31,7 +31,7 @@ namespace Diligent { -/// Implementation of a 2D texture +/// Implementation of a 2D texture in Direct3D11 backend. class Texture2D_D3D11 final : public TextureBaseD3D11 { public: diff --git a/Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h b/Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h index 23c62fa9..2ccbfb4f 100644 --- a/Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h +++ b/Graphics/GraphicsEngineD3D11/include/Texture3D_D3D11.h @@ -31,7 +31,7 @@ namespace Diligent { -/// Implementation of a 3D texture +/// Implementation of a 3D texture in Direct3D11 backend. class Texture3D_D3D11 final : public TextureBaseD3D11 { public: diff --git a/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h b/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h index f1d765ec..ca76b4d4 100644 --- a/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h +++ b/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h @@ -37,7 +37,7 @@ namespace Diligent class FixedBlockMemoryAllocator; -/// Base implementation of the Diligent::ITextureD3D11 interface +/// Base implementation of a texture object in Direct3D11 backend. class TextureBaseD3D11 : public TextureBase { public: @@ -53,11 +53,13 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of ITextureD3D11::GetD3D11Texture(). virtual ID3D11Resource* GetD3D11Texture()override final{ return m_pd3d11Texture; } + /// Implementation of ITexture::GetNativeHandle(). virtual void* GetNativeHandle()override final { return GetD3D11Texture(); } - void AddState (RESOURCE_STATE State) + void AddState(RESOURCE_STATE State) { m_State = static_cast(m_State & ~static_cast(RESOURCE_STATE_UNDEFINED)); m_State = static_cast(m_State | State); diff --git a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h index ff405a89..c7883c64 100644 --- a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h @@ -36,7 +36,7 @@ namespace Diligent class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::ITextureViewD3D11 interface +/// Texture view implementation in Direct3D11 backend. class TextureViewD3D11Impl final : public TextureViewBase { public: @@ -51,12 +51,13 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of ITextureViewD3D11::GetD3D11View(). virtual ID3D11View* GetD3D11View()override final { return m_pD3D11View; } -protected: +private: /// D3D11 view CComPtr m_pD3D11View; }; -- cgit v1.2.3