diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-11-09 02:31:01 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-11-09 02:31:01 +0000 |
| commit | ee5362d29ef7ffe7621962e69e879dfcf697cb10 (patch) | |
| tree | fad69da0474b525147d899c3ac7c16c077ef5805 /Graphics/GraphicsEngineD3D12 | |
| parent | Added APIVersion member to EngineCreateInfo struct (API Version 240040) (diff) | |
| download | DiligentCore-ee5362d29ef7ffe7621962e69e879dfcf697cb10.tar.gz DiligentCore-ee5362d29ef7ffe7621962e69e879dfcf697cb10.zip | |
Updated comments in Direct3D12 backend implementation
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
14 files changed, 115 insertions, 24 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h index 6e976537..dd2a9510 100644 --- a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h @@ -39,7 +39,7 @@ namespace Diligent class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IBufferD3D12 interface +/// Buffer object implementation in Direct3D12 backend. class BufferD3D12Impl final : public BufferBase<IBufferD3D12, RenderDeviceD3D12Impl, BufferViewD3D12Impl, FixedBlockMemoryAllocator>, public D3D12ResourceBase { public: @@ -50,6 +50,7 @@ public: class RenderDeviceD3D12Impl* pDeviceD3D12, const BufferDesc& BuffDesc, const BufferData* pBuffData = nullptr); + BufferD3D12Impl(IReferenceCounters* pRefCounters, FixedBlockMemoryAllocator& BuffViewObjMemAllocator, class RenderDeviceD3D12Impl* pDeviceD3D12, @@ -64,8 +65,10 @@ public: void DvpVerifyDynamicAllocation(class DeviceContextD3D12Impl* pCtx)const; #endif + /// Implementation of IBufferD3D12::GetD3D12Buffer(). virtual ID3D12Resource* GetD3D12Buffer(size_t& DataStartByteOffset, IDeviceContext* pContext)override final; + /// Implementation of IBuffer::GetNativeHandle(). virtual void* GetNativeHandle()override final { VERIFY(GetD3D12Resource() != nullptr, "The buffer is dynamic and has no pointer to D3D12 resource"); @@ -75,8 +78,10 @@ public: return pd3d12Buffer; } + /// Implementation of IBufferD3D12::SetD3D12ResourceState(). virtual void SetD3D12ResourceState(D3D12_RESOURCE_STATES state)override final; + /// Implementation of IBufferD3D12::GetD3D12ResourceState(). virtual D3D12_RESOURCE_STATES GetD3D12ResourceState()const override final; __forceinline D3D12_GPU_VIRTUAL_ADDRESS GetGPUAddress(Uint32 ContextId, class DeviceContextD3D12Impl* pCtx) diff --git a/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h index 166a492a..400e8846 100644 --- a/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h @@ -36,7 +36,8 @@ namespace Diligent { class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IBufferViewD3D12 interface + +/// Buffer view implementation in Direct3D12 backend. class BufferViewD3D12Impl final : public BufferViewBase<IBufferViewD3D12, RenderDeviceD3D12Impl> { public: @@ -51,6 +52,7 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IBufferViewD3D12::GetCPUDescriptorHandle(). virtual D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle()override final{return m_DescriptorHandle.GetCpuHandle();} protected: diff --git a/Graphics/GraphicsEngineD3D12/include/CommandContext.h b/Graphics/GraphicsEngineD3D12/include/CommandContext.h index a5e52727..b58e8f34 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandContext.h +++ b/Graphics/GraphicsEngineD3D12/include/CommandContext.h @@ -38,13 +38,13 @@ namespace Diligent struct DWParam { - DWParam( FLOAT f ) : Float(f) {} - DWParam( UINT u ) : Uint(u) {} - DWParam( INT i ) : Int(i) {} + DWParam( FLOAT f ) : Float{f} {} + DWParam( UINT u ) : Uint {u} {} + DWParam( INT i ) : Int {i} {} void operator= ( FLOAT f ) { Float = f; } - void operator= ( UINT u ) { Uint = u; } - void operator= ( INT i ) { Int = i; } + void operator= ( UINT u ) { Uint = u; } + void operator= ( INT i ) { Int = i; } union { diff --git a/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h index 8fe3342a..2c417a8a 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h @@ -35,7 +35,7 @@ namespace Diligent class DeviceContextD3D12Impl; class CommandContext; -/// Implementation of the Diligent::ICommandList interface +/// Command list implementation in Direct3D12 backend. class CommandListD3D12Impl final : public CommandListBase<ICommandList, RenderDeviceD3D12Impl> { public: diff --git a/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h index 647fffe8..bb14b79f 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h @@ -44,18 +44,22 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; - // Returns the fence value that will be signaled next time + // Implementation of ICommandQueueD3D12::GetNextFenceValue(). virtual Uint64 GetNextFenceValue()override final { return m_NextFenceValue; } - // Executes a given command list + // Implementation of ICommandQueueD3D12::Submit(). virtual Uint64 Submit(ID3D12GraphicsCommandList* commandList)override final; + // Implementation of ICommandQueueD3D12::GetD3D12CommandQueue(). virtual ID3D12CommandQueue* GetD3D12CommandQueue()override final { return m_pd3d12CmdQueue; } + // Implementation of ICommandQueueD3D12::WaitForIdle(). virtual Uint64 WaitForIdle()override final; + // Implementation of ICommandQueueD3D12::GetCompletedFenceValue(). virtual Uint64 GetCompletedFenceValue()override final; + // Implementation of ICommandQueueD3D12::SignalFence(). virtual void SignalFence(ID3D12Fence* pFence, Uint64 Value)override final; private: diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h index 1383d439..fb672aee 100644 --- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h @@ -49,7 +49,7 @@ struct DeviceContextD3D12ImplTraits using ICommandQueueType = ICommandQueueD3D12; }; -/// Implementation of the Diligent::IDeviceContext interface +/// Device context implementation in Direct3D12 backend. class DeviceContextD3D12Impl final : public DeviceContextNextGenBase<IDeviceContextD3D12, DeviceContextD3D12ImplTraits> { public: @@ -65,16 +65,22 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IDeviceContext::SetPipelineState() in Direct3D12 backend. virtual void SetPipelineState(IPipelineState* pPipelineState)override final; + /// Implementation of IDeviceContext::TransitionShaderResources() in Direct3D12 backend. virtual void TransitionShaderResources(IPipelineState* pPipelineState, IShaderResourceBinding* pShaderResourceBinding)override final; + /// Implementation of IDeviceContext::CommitShaderResources() in Direct3D12 backend. virtual void CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; + /// Implementation of IDeviceContext::SetStencilRef() in Direct3D12 backend. virtual void SetStencilRef(Uint32 StencilRef)override final; + /// Implementation of IDeviceContext::SetBlendFactors() in Direct3D12 backend. virtual void SetBlendFactors(const float* pBlendFactors = nullptr)override final; + /// Implementation of IDeviceContext::SetVertexBuffers() in Direct3D12 backend. virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, @@ -82,41 +88,56 @@ public: RESOURCE_STATE_TRANSITION_MODE StateTransitionMode, SET_VERTEX_BUFFERS_FLAGS Flags )override final; + /// Implementation of IDeviceContext::InvalidateState() in Direct3D12 backend. virtual void InvalidateState()override final; + /// Implementation of IDeviceContext::SetIndexBuffer() in Direct3D12 backend. virtual void SetIndexBuffer( IBuffer* pIndexBuffer, Uint32 ByteOffset, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode )override final; + /// Implementation of IDeviceContext::SetViewports() in Direct3D12 backend. virtual void SetViewports( Uint32 NumViewports, const Viewport* pViewports, Uint32 RTWidth, Uint32 RTHeight )override final; + /// Implementation of IDeviceContext::SetScissorRects() in Direct3D12 backend. virtual void SetScissorRects( Uint32 NumRects, const Rect* pRects, Uint32 RTWidth, Uint32 RTHeight )override final; + /// Implementation of IDeviceContext::SetRenderTargets() in Direct3D12 backend. virtual void SetRenderTargets( Uint32 NumRenderTargets, ITextureView* ppRenderTargets[], ITextureView* pDepthStencil, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode )override final; + /// Implementation of IDeviceContext::Draw() in Direct3D12 backend. virtual void Draw (const DrawAttribs& Attribs)override final; + /// Implementation of IDeviceContext::DrawIndexed() in Direct3D12 backend. virtual void DrawIndexed (const DrawIndexedAttribs& Attribs)override final; + /// Implementation of IDeviceContext::DrawIndirect() in Direct3D12 backend. virtual void DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; + /// Implementation of IDeviceContext::DrawIndexedIndirect() in Direct3D12 backend. virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; + /// Implementation of IDeviceContext::DispatchCompute() in Direct3D12 backend. virtual void DispatchCompute(const DispatchComputeAttribs& Attribs)override final; + /// Implementation of IDeviceContext::DispatchComputeIndirect() in Direct3D12 backend. virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; + /// Implementation of IDeviceContext::ClearDepthStencil() in Direct3D12 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 Direct3D12 backend. virtual void ClearRenderTarget( ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode )override final; + /// Implementation of IDeviceContext::UpdateBuffer() in Direct3D12 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 Direct3D12 backend. virtual void CopyBuffer(IBuffer* pSrcBuffer, Uint32 SrcOffset, RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, @@ -125,10 +146,13 @@ public: Uint32 Size, RESOURCE_STATE_TRANSITION_MODE DstBufferTransitionMode)override final; + /// Implementation of IDeviceContext::MapBuffer() in Direct3D12 backend. virtual void MapBuffer(IBuffer* pBuffer, MAP_TYPE MapType, MAP_FLAGS MapFlags, PVoid& pMappedData)override final; + /// Implementation of IDeviceContext::UnmapBuffer() in Direct3D12 backend. virtual void UnmapBuffer(IBuffer* pBuffer, MAP_TYPE MapType)override final; + /// Implementation of IDeviceContext::UpdateTexture() in Direct3D12 backend. virtual void UpdateTexture(ITexture* pTexture, Uint32 MipLevel, Uint32 Slice, @@ -137,8 +161,10 @@ public: RESOURCE_STATE_TRANSITION_MODE SrcBufferTransitionMode, RESOURCE_STATE_TRANSITION_MODE TextureTransitionMode)override final; + /// Implementation of IDeviceContext::CopyTexture() in Direct3D12 backend. virtual void CopyTexture(const CopyTextureAttribs& CopyAttribs)override final; + /// Implementation of IDeviceContext::MapTextureSubresource() in Direct3D12 backend. virtual void MapTextureSubresource( ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice, @@ -147,28 +173,40 @@ public: const Box* pMapRegion, MappedTextureSubresource& MappedData )override final; + /// Implementation of IDeviceContext::UnmapTextureSubresource() in Direct3D12 backend. virtual void UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice)override final; + /// Implementation of IDeviceContext::FinishFrame() in Direct3D12 backend. virtual void FinishFrame()override final; + /// Implementation of IDeviceContext::TransitionResourceStates() in Direct3D12 backend. virtual void TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers)override final; + /// Implementation of IDeviceContext::FinishCommandList() in Direct3D12 backend. virtual void FinishCommandList(class ICommandList** ppCommandList)override final; + /// Implementation of IDeviceContext::ExecuteCommandList() in Direct3D12 backend. virtual void ExecuteCommandList(class ICommandList* pCommandList)override final; + /// Implementation of IDeviceContext::SignalFence() in Direct3D12 backend. virtual void SignalFence(IFence* pFence, Uint64 Value)override final; + /// Implementation of IDeviceContext::WaitForFence() in Direct3D12 backend. virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext)override final; + /// Implementation of IDeviceContext::WaitForIdle() in Direct3D12 backend. virtual void WaitForIdle()override final; + /// Implementation of IDeviceContext::Flush() in Direct3D12 backend. virtual void Flush()override final; + /// Implementation of IDeviceContext::TransitionTextureState() in Direct3D12 backend. virtual void TransitionTextureState(ITexture *pTexture, D3D12_RESOURCE_STATES State)override final; + /// Implementation of IDeviceContext::TransitionBufferState() in Direct3D12 backend. virtual void TransitionBufferState(IBuffer *pBuffer, D3D12_RESOURCE_STATES State)override final; + /// Implementation of IDeviceContextD3D12::ID3D12GraphicsCommandList() in Direct3D12 backend. virtual ID3D12GraphicsCommandList* GetD3D12CommandList()override final; ///// Number of different shader types (Vertex, Pixel, Geometry, Domain, Hull, Compute) diff --git a/Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h index 4fd666f9..8eace8e1 100644 --- a/Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/FenceD3D12Impl.h @@ -36,7 +36,7 @@ namespace Diligent class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IFenceD3D12 interface +/// Fence implementation in Direct3D12 backend. class FenceD3D12Impl final : public FenceBase<IFenceD3D12, RenderDeviceD3D12Impl> { public: @@ -47,13 +47,16 @@ public: const FenceDesc& Desc); ~FenceD3D12Impl(); + /// Implementation of IFence::GetCompletedValue() in Direct3D12 backend. virtual Uint64 GetCompletedValue()override final; - /// Resets the fence to the specified value. + /// Implementation of IFence::GetCompletedValue() in Direct3D12 backend. virtual void Reset(Uint64 Value)override final; + /// Implementation of IFenceD3D12::GetD3D12Fence(). ID3D12Fence* GetD3D12Fence()override final{ return m_pd3d12Fence; } + /// Implementation of IFenceD3D12::WaitForCompletion(). virtual void WaitForCompletion(Uint64 Value)override final; private: diff --git a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h index f61b53db..bb8541c0 100644 --- a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h @@ -39,7 +39,8 @@ namespace Diligent { class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::IRenderDeviceD3D12 interface + +/// Pipeline state object implementation in Direct3D12 backend. class PipelineStateD3D12Impl final : public PipelineStateBase<IPipelineStateD3D12, RenderDeviceD3D12Impl> { public: @@ -50,21 +51,29 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IPipelineState::BindStaticResources() in Direct3D12 backend. virtual void BindStaticResources(Uint32 ShaderFlags, IResourceMapping* pResourceMapping, Uint32 Flags)override final; + /// Implementation of IPipelineState::GetStaticVariableCount() in Direct3D12 backend. virtual Uint32 GetStaticVariableCount(SHADER_TYPE ShaderType) const override final; + /// Implementation of IPipelineState::GetStaticVariableByName() in Direct3D12 backend. virtual IShaderResourceVariable* GetStaticVariableByName(SHADER_TYPE ShaderType, const Char* Name) override final; + /// Implementation of IPipelineState::GetStaticVariableByIndex() in Direct3D12 backend. virtual IShaderResourceVariable* GetStaticVariableByIndex(SHADER_TYPE ShaderType, Uint32 Index) override final; + /// Implementation of IPipelineState::CreateShaderResourceBinding() in Direct3D12 backend. virtual void CreateShaderResourceBinding( IShaderResourceBinding **ppShaderResourceBinding, bool InitStaticResources )override final; + /// Implementation of IPipelineState::IsCompatibleWith() in Direct3D12 backend. virtual bool IsCompatibleWith(const IPipelineState *pPSO)const override final; - virtual ID3D12PipelineState *GetD3D12PipelineState()const override final{return m_pd3d12PSO;} + /// Implementation of IPipelineStateD3D12::GetD3D12PipelineState(). + virtual ID3D12PipelineState* GetD3D12PipelineState()const override final{return m_pd3d12PSO;} - virtual ID3D12RootSignature *GetD3D12RootSignature()const override final{return m_RootSig.GetD3D12RootSignature(); } + /// Implementation of IPipelineStateD3D12::GetD3D12RootSignature(). + virtual ID3D12RootSignature* GetD3D12RootSignature()const override final{return m_RootSig.GetD3D12RootSignature(); } struct CommitAndTransitionResourcesAttribs { @@ -107,7 +116,6 @@ public: private: - /// D3D12 device CComPtr<ID3D12PipelineState> m_pd3d12PSO; RootSignature m_RootSig; diff --git a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h index b10ba472..c24dc306 100644 --- a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h @@ -39,7 +39,7 @@ namespace Diligent { -/// Implementation of the Diligent::IRenderDeviceD3D12 interface +/// Render device implementation in Direct3D12 backend. class RenderDeviceD3D12Impl final : public RenderDeviceNextGenBase< RenderDeviceD3DBase<IRenderDeviceD3D12>, ICommandQueueD3D12 > { public: @@ -56,29 +56,39 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IRenderDevice::CreatePipelineState() in Direct3D12 backend. virtual void CreatePipelineState(const PipelineStateDesc& PipelineDesc, IPipelineState** ppPipelineState)override final; + /// Implementation of IRenderDevice::CreateBuffer() in Direct3D12 backend. virtual void CreateBuffer(const BufferDesc& BuffDesc, const BufferData* pBuffData, IBuffer** ppBuffer)override final; + /// Implementation of IRenderDevice::CreateShader() in Direct3D12 backend. virtual void CreateShader(const ShaderCreateInfo& ShaderCreateInfo, IShader** ppShader)override final; + /// Implementation of IRenderDevice::CreateTexture() in Direct3D12 backend. virtual void CreateTexture(const TextureDesc& TexDesc, const TextureData* pData, ITexture** ppTexture)override final; void CreateTexture(const TextureDesc& TexDesc, ID3D12Resource* pd3d12Texture, RESOURCE_STATE InitialState, class TextureD3D12Impl** ppTexture); + /// Implementation of IRenderDevice::CreateSampler() in Direct3D12 backend. virtual void CreateSampler(const SamplerDesc& SamplerDesc, ISampler** ppSampler)override final; + /// Implementation of IRenderDevice::CreateFence() in Direct3D12 backend. virtual void CreateFence(const FenceDesc& Desc, IFence** ppFence)override final; + /// Implementation of IRenderDeviceD3D12::GetD3D12Device(). virtual ID3D12Device* GetD3D12Device()override final{return m_pd3d12Device;} + /// Implementation of IRenderDeviceD3D12::CreateTextureFromD3DResource(). virtual void CreateTextureFromD3DResource(ID3D12Resource* pd3d12Texture, RESOURCE_STATE InitialState, ITexture** ppTexture)override final; + /// Implementation of IRenderDeviceD3D12::CreateBufferFromD3DResource(). virtual void CreateBufferFromD3DResource(ID3D12Resource* pd3d12Buffer, const BufferDesc& BuffDesc, RESOURCE_STATE InitialState, IBuffer** ppBuffer)override final; DescriptorHeapAllocation AllocateDescriptor( D3D12_DESCRIPTOR_HEAP_TYPE Type, UINT Count = 1 ); DescriptorHeapAllocation AllocateGPUDescriptors( D3D12_DESCRIPTOR_HEAP_TYPE Type, UINT Count = 1 ); + /// Implementation of IRenderDevice::IdleGPU() in Direct3D12 backend. virtual void IdleGPU()override final; using PooledCommandContext = std::unique_ptr<CommandContext, STDDeleterRawMem<CommandContext> >; @@ -92,6 +102,8 @@ public: void DisposeCommandContext(PooledCommandContext&& Ctx); void FlushStaleResources(Uint32 CmdQueueIndex); + + /// Implementation of IRenderDevice::() in Direct3D12 backend. virtual void ReleaseStaleResources(bool ForceRelease = false)override final; D3D12DynamicMemoryManager& GetDynamicMemoryManager() {return m_DynamicMemoryManager;} diff --git a/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h index bdafc250..190b6a37 100644 --- a/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h @@ -36,7 +36,8 @@ namespace Diligent { class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::ISamplerD3D12 interface + +/// Sampler object implementation in Direct3D12 backend. class SamplerD3D12Impl final : public SamplerBase<ISamplerD3D12, RenderDeviceD3D12Impl> { public: @@ -49,6 +50,7 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of ISamplerD3D12::GetCPUDescriptorHandle(). virtual D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle()override{ return m_Descriptor.GetCpuHandle(); } private: diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h index 3ab377ea..dd1ad955 100644 --- a/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h @@ -39,7 +39,7 @@ namespace Diligent class ResourceMapping; -/// Implementation of the Diligent::IShaderD3D12 interface +/// Implementation of a shader object in Direct3D12 backend. class ShaderD3D12Impl final : public ShaderBase<IShaderD3D12, RenderDeviceD3D12Impl>, public ShaderD3DBase { public: @@ -52,16 +52,19 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of IShader::GetResourceCount() in Direct3D12 backend. virtual Uint32 GetResourceCount()const override final { return m_pShaderResources->GetTotalResources(); } + /// Implementation of IShader::GetResource() in Direct3D12 backend. virtual ShaderResourceDesc GetResource(Uint32 Index)const override final { return GetHLSLResource(Index); } + /// Implementation of IShaderD3D::GetHLSLResource() in Direct3D12 backend. virtual HLSLShaderResourceDesc GetHLSLResource(Uint32 Index)const override final { return m_pShaderResources->GetHLSLShaderResourceDesc(Index); diff --git a/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h index 9047896b..434fce0a 100644 --- a/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h @@ -35,7 +35,8 @@ namespace Diligent class ITextureViewD3D12; class IMemoryAllocator; -/// Implementation of the Diligent::ISwapChainD3D12 interface + +/// Swap chain implementation in Direct3D12 backend. class SwapChainD3D12Impl final : public SwapChainD3DBase<ISwapChainD3D12, IDXGISwapChain3> { public: @@ -51,11 +52,16 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of ISwapChain::Present() in Direct3D12 backend. virtual void Present(Uint32 SyncInterval)override final; + + /// Implementation of ISwapChain::Resize() in Direct3D12 backend. virtual void Resize( Uint32 NewWidth, Uint32 NewHeight )override final; + /// Implementation of ISwapChainD3D12::GetDXGISwapChain(). virtual IDXGISwapChain* GetDXGISwapChain()override final{ return m_pSwapChain; } + /// Implementation of ISwapChain::GetCurrentBackBufferRTV() in Direct3D12 backend. virtual ITextureViewD3D12* GetCurrentBackBufferRTV()override final { auto CurrentBackBufferIndex = m_pSwapChain->GetCurrentBackBufferIndex(); @@ -63,6 +69,7 @@ public: return m_pBackBufferRTV[CurrentBackBufferIndex]; } + /// Implementation of ISwapChain::GetDepthBufferDSV() in Direct3D12 backend. virtual ITextureViewD3D12* GetDepthBufferDSV()override final{return m_pDepthBufferDSV;} private: diff --git a/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h index e179a81d..d661850f 100644 --- a/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h @@ -38,7 +38,7 @@ namespace Diligent class FixedBlockMemoryAllocator; -/// Base implementation of the Diligent::ITextureD3D12 interface +/// Implementation of a texture object in Direct3D12 backend. class TextureD3D12Impl final : public TextureBase<ITextureD3D12, RenderDeviceD3D12Impl, TextureViewD3D12Impl, FixedBlockMemoryAllocator>, public D3D12ResourceBase { public: @@ -51,6 +51,7 @@ public: RenderDeviceD3D12Impl* pDeviceD3D12, const TextureDesc& TexDesc, const TextureData* pInitData = nullptr); + // Attaches to an existing D3D12 resource TextureD3D12Impl(IReferenceCounters* pRefCounters, FixedBlockMemoryAllocator& TexViewObjAllocator, @@ -62,12 +63,16 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; - virtual ID3D12Resource* GetD3D12Texture(){ return GetD3D12Resource(); } + /// Implementation of ITextureD3D12::GetD3D12Texture(). + virtual ID3D12Resource* GetD3D12Texture()override final{ return GetD3D12Resource(); } + /// Implementation of ITexture::GetNativeHandle() in Direct3D12 backend. virtual void* GetNativeHandle()override final { return GetD3D12Texture(); } + /// Implementation of ITextureD3D12::SetD3D12ResourceState(). virtual void SetD3D12ResourceState(D3D12_RESOURCE_STATES state)override final; + /// Implementation of ITextureD3D12::GetD3D12ResourceState(). virtual D3D12_RESOURCE_STATES GetD3D12ResourceState()const override final; D3D12_RESOURCE_DESC GetD3D12TextureDesc()const; diff --git a/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h index fcdff62d..eb032db8 100644 --- a/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h @@ -36,7 +36,8 @@ namespace Diligent { class FixedBlockMemoryAllocator; -/// Implementation of the Diligent::ITextureViewD3D12 interface + +/// Texture view object implementation in Direct3D12 backend. class TextureViewD3D12Impl final : public TextureViewBase<ITextureViewD3D12, RenderDeviceD3D12Impl> { public: @@ -54,6 +55,7 @@ public: virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; + /// Implementation of ITextureViewD3D12::GetCPUDescriptorHandle(). virtual D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle()override final { return m_Descriptor.GetCpuHandle(); |
