From 6bf69ec4effe26511bdcb0fa99298262571ae2a3 Mon Sep 17 00:00:00 2001 From: Laura Hermanns Date: Mon, 3 Jul 2023 16:51:37 -0400 Subject: [PATCH] Added more *.inl files for interfaces to Backend/ folder. --- include/LLGL/Backend/CommandQueue.inl | 41 +++++++ include/LLGL/Backend/PipelineLayout.inl | 26 +++++ include/LLGL/Backend/RenderSystem.Buffer.inl | 60 +++++++++++ .../Backend/RenderSystem.CommandBuffer.inl | 20 ++++ .../Backend/RenderSystem.CommandQueue.inl | 16 +++ include/LLGL/Backend/RenderSystem.Fence.inl | 20 ++++ .../Backend/RenderSystem.PipelineLayout.inl | 20 ++++ .../Backend/RenderSystem.PipelineState.inl | 30 ++++++ .../LLGL/Backend/RenderSystem.QueryHeap.inl | 20 ++++ .../LLGL/Backend/RenderSystem.RenderPass.inl | 20 ++++ .../Backend/RenderSystem.RenderTarget.inl | 20 ++++ .../Backend/RenderSystem.ResourceHeap.inl | 27 +++++ include/LLGL/Backend/RenderSystem.Sampler.inl | 20 ++++ include/LLGL/Backend/RenderSystem.Shader.inl | 20 ++++ .../LLGL/Backend/RenderSystem.SwapChain.inl | 21 ++++ include/LLGL/Backend/RenderSystem.Texture.inl | 33 ++++++ include/LLGL/Backend/RenderSystem.inl | 25 +++++ include/LLGL/Backend/RenderTarget.inl | 34 ++++++ include/LLGL/Backend/Shader.inl | 18 ++++ include/LLGL/Backend/Texture.inl | 26 +++++ sources/Renderer/DebugLayer/DbgCommandQueue.h | 27 +---- sources/Renderer/DebugLayer/DbgRenderSystem.h | 102 +----------------- .../RenderState/DbgPipelineLayout.h | 9 +- .../Renderer/DebugLayer/Shader/DbgShader.h | 6 +- .../DebugLayer/Texture/DbgRenderTarget.h | 11 +- .../Renderer/DebugLayer/Texture/DbgTexture.h | 10 +- .../Renderer/Direct3D11/D3D11CommandQueue.h | 23 +--- .../Renderer/Direct3D11/D3D11RenderSystem.h | 102 +----------------- .../RenderState/D3D11PipelineLayout.h | 5 +- .../Renderer/Direct3D11/Shader/D3D11Shader.h | 6 +- .../Direct3D11/Texture/D3D11RenderTarget.h | 11 +- .../Direct3D11/Texture/D3D11Texture.h | 10 +- .../Direct3D12/Command/D3D12CommandQueue.h | 25 +---- .../Renderer/Direct3D12/D3D12RenderSystem.h | 102 +----------------- .../RenderState/D3D12PipelineLayout.h | 9 +- .../Renderer/Direct3D12/Shader/D3D12Shader.h | 6 +- .../Direct3D12/Texture/D3D12RenderTarget.h | 11 +- .../Direct3D12/Texture/D3D12Texture.h | 10 +- .../Renderer/Metal/Command/MTCommandQueue.h | 27 +---- sources/Renderer/Metal/MTRenderSystem.h | 102 +----------------- .../Metal/RenderState/MTPipelineLayout.h | 7 +- sources/Renderer/Metal/Shader/MTShader.h | 8 +- .../Renderer/Metal/Texture/MTRenderTarget.h | 15 +-- sources/Renderer/Metal/Texture/MTTexture.h | 8 +- .../Renderer/Null/Command/NullCommandQueue.h | 21 +--- sources/Renderer/Null/NullRenderSystem.h | 100 +---------------- .../Null/RenderState/NullPipelineLayout.h | 9 +- sources/Renderer/Null/Shader/NullShader.h | 6 +- .../Renderer/Null/Texture/NullRenderTarget.h | 11 +- sources/Renderer/Null/Texture/NullTexture.h | 8 +- .../Renderer/OpenGL/Command/GLCommandQueue.h | 25 +---- sources/Renderer/OpenGL/GLRenderSystem.h | 102 +----------------- .../OpenGL/RenderState/GLPipelineLayout.h | 5 +- .../Renderer/OpenGL/Texture/GLRenderTarget.h | 11 +- sources/Renderer/OpenGL/Texture/GLTexture.h | 12 +-- .../Vulkan/RenderState/VKPipelineLayout.h | 5 +- sources/Renderer/Vulkan/Shader/VKShader.h | 7 +- .../Renderer/Vulkan/Texture/VKRenderTarget.h | 13 +-- sources/Renderer/Vulkan/Texture/VKTexture.h | 12 +-- sources/Renderer/Vulkan/VKCommandQueue.h | 19 +--- sources/Renderer/Vulkan/VKRenderSystem.h | 102 +----------------- 61 files changed, 646 insertions(+), 991 deletions(-) create mode 100644 include/LLGL/Backend/CommandQueue.inl create mode 100644 include/LLGL/Backend/PipelineLayout.inl create mode 100644 include/LLGL/Backend/RenderSystem.Buffer.inl create mode 100644 include/LLGL/Backend/RenderSystem.CommandBuffer.inl create mode 100644 include/LLGL/Backend/RenderSystem.CommandQueue.inl create mode 100644 include/LLGL/Backend/RenderSystem.Fence.inl create mode 100644 include/LLGL/Backend/RenderSystem.PipelineLayout.inl create mode 100644 include/LLGL/Backend/RenderSystem.PipelineState.inl create mode 100644 include/LLGL/Backend/RenderSystem.QueryHeap.inl create mode 100644 include/LLGL/Backend/RenderSystem.RenderPass.inl create mode 100644 include/LLGL/Backend/RenderSystem.RenderTarget.inl create mode 100644 include/LLGL/Backend/RenderSystem.ResourceHeap.inl create mode 100644 include/LLGL/Backend/RenderSystem.Sampler.inl create mode 100644 include/LLGL/Backend/RenderSystem.Shader.inl create mode 100644 include/LLGL/Backend/RenderSystem.SwapChain.inl create mode 100644 include/LLGL/Backend/RenderSystem.Texture.inl create mode 100644 include/LLGL/Backend/RenderSystem.inl create mode 100644 include/LLGL/Backend/RenderTarget.inl create mode 100644 include/LLGL/Backend/Shader.inl create mode 100644 include/LLGL/Backend/Texture.inl diff --git a/include/LLGL/Backend/CommandQueue.inl b/include/LLGL/Backend/CommandQueue.inl new file mode 100644 index 0000000000..7457512531 --- /dev/null +++ b/include/LLGL/Backend/CommandQueue.inl @@ -0,0 +1,41 @@ +/* + * CommandQueue.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Command Buffers ----- */ + +virtual void Submit( + LLGL::CommandBuffer& commandBuffer +) override final; + +/* ----- Queries ----- */ + +virtual bool QueryResult( + LLGL::QueryHeap& queryHeap, + std::uint32_t firstQuery, + std::uint32_t numQueries, + void* data, + std::size_t dataSize +) override final; + +/* ----- Fences ----- */ + +virtual void Submit( + LLGL::Fence& fence +) override final; + +virtual bool WaitFence( + LLGL::Fence& fence, + std::uint64_t timeout +) override final; + +virtual void WaitIdle( + void +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/PipelineLayout.inl b/include/LLGL/Backend/PipelineLayout.inl new file mode 100644 index 0000000000..72309a6cf8 --- /dev/null +++ b/include/LLGL/Backend/PipelineLayout.inl @@ -0,0 +1,26 @@ +/* + * PipelineLayout.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +virtual std::uint32_t GetNumHeapBindings( + void +) const override final; + +virtual std::uint32_t GetNumBindings( + void +) const override final; + +virtual std::uint32_t GetNumStaticSamplers( + void +) const override final; + +virtual std::uint32_t GetNumUniforms( + void +) const override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.Buffer.inl b/include/LLGL/Backend/RenderSystem.Buffer.inl new file mode 100644 index 0000000000..369fe1821a --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.Buffer.inl @@ -0,0 +1,60 @@ +/* + * RenderSystem.Buffer.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Buffers ------ */ + +virtual LLGL::Buffer* CreateBuffer( + const LLGL::BufferDescriptor& bufferDesc, + const void* initialData = nullptr +) override final; + +virtual LLGL::BufferArray* CreateBufferArray( + std::uint32_t numBuffers, + LLGL::Buffer* const * bufferArray +) override final; + +virtual void Release( + LLGL::Buffer& buffer +) override final; + +virtual void Release( + LLGL::BufferArray& bufferArray +) override final; + +virtual void WriteBuffer( + LLGL::Buffer& buffer, + std::uint64_t offset, + const void* data, + std::uint64_t dataSize +) override final; + +virtual void ReadBuffer( + LLGL::Buffer& buffer, + std::uint64_t offset, + void* data, + std::uint64_t dataSize +) override final; + +virtual void* MapBuffer( + LLGL::Buffer& buffer, + const LLGL::CPUAccess access +) override final; + +virtual void* MapBuffer( + LLGL::Buffer& buffer, + const LLGL::CPUAccess access, + std::uint64_t offset, + std::uint64_t length +) override final; + +virtual void UnmapBuffer( + LLGL::Buffer& buffer +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.CommandBuffer.inl b/include/LLGL/Backend/RenderSystem.CommandBuffer.inl new file mode 100644 index 0000000000..bad011cde1 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.CommandBuffer.inl @@ -0,0 +1,20 @@ +/* + * RenderSystem.CommandBuffer.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Command buffers ----- */ + +virtual LLGL::CommandBuffer* CreateCommandBuffer( + const LLGL::CommandBufferDescriptor& commandBufferDesc = {} +) override final; + +virtual void Release( + LLGL::CommandBuffer& commandBuffer +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.CommandQueue.inl b/include/LLGL/Backend/RenderSystem.CommandQueue.inl new file mode 100644 index 0000000000..9896c268a0 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.CommandQueue.inl @@ -0,0 +1,16 @@ +/* + * RenderSystem.CommandQueue.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Command queues ----- */ + +virtual LLGL::CommandQueue* GetCommandQueue( + void +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.Fence.inl b/include/LLGL/Backend/RenderSystem.Fence.inl new file mode 100644 index 0000000000..37c0042560 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.Fence.inl @@ -0,0 +1,20 @@ +/* + * RenderSystem.Fence.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Fences ----- */ + +virtual LLGL::Fence* CreateFence( + void +) override final; + +virtual void Release( + LLGL::Fence& fence +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.PipelineLayout.inl b/include/LLGL/Backend/RenderSystem.PipelineLayout.inl new file mode 100644 index 0000000000..1059585439 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.PipelineLayout.inl @@ -0,0 +1,20 @@ +/* + * RenderSystem.PipelineLayouts.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Pipeline Layouts ----- */ + +virtual LLGL::PipelineLayout* CreatePipelineLayout( + const LLGL::PipelineLayoutDescriptor& pipelineLayoutDesc +) override final; + +virtual void Release( + LLGL::PipelineLayout& pipelineLayout +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.PipelineState.inl b/include/LLGL/Backend/RenderSystem.PipelineState.inl new file mode 100644 index 0000000000..7cd64ea881 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.PipelineState.inl @@ -0,0 +1,30 @@ +/* + * RenderSystem.PipelineState.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Pipeline States ----- */ + +virtual LLGL::PipelineState* CreatePipelineState( + const LLGL::Blob& serializedCache +) override final; + +virtual LLGL::PipelineState* CreatePipelineState( + const LLGL::GraphicsPipelineDescriptor& pipelineStateDesc, + LLGL::Blob* serializedCache = nullptr +) override final; + +virtual LLGL::PipelineState* CreatePipelineState( + const LLGL::ComputePipelineDescriptor& pipelineStateDesc, + LLGL::Blob* serializedCache = nullptr +) override final; + +virtual void Release( + LLGL::PipelineState& pipelineState +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.QueryHeap.inl b/include/LLGL/Backend/RenderSystem.QueryHeap.inl new file mode 100644 index 0000000000..fb504014a1 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.QueryHeap.inl @@ -0,0 +1,20 @@ +/* + * RenderSystem.QueryHeap.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Query heaps ----- */ + +virtual LLGL::QueryHeap* CreateQueryHeap( + const LLGL::QueryHeapDescriptor& queryHeapDesc +) override final; + +virtual void Release( + LLGL::QueryHeap& queryHeap +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.RenderPass.inl b/include/LLGL/Backend/RenderSystem.RenderPass.inl new file mode 100644 index 0000000000..2ef2d2fe4b --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.RenderPass.inl @@ -0,0 +1,20 @@ +/* + * RenderSystem.RenderPass.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Render Passes ----- */ + +virtual LLGL::RenderPass* CreateRenderPass( + const LLGL::RenderPassDescriptor& renderPassDesc +) override final; + +virtual void Release( + LLGL::RenderPass& renderPass +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.RenderTarget.inl b/include/LLGL/Backend/RenderSystem.RenderTarget.inl new file mode 100644 index 0000000000..84296d2bf3 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.RenderTarget.inl @@ -0,0 +1,20 @@ +/* + * RenderSystem.RenderTarget.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Render Targets ----- */ + +virtual LLGL::RenderTarget* CreateRenderTarget( + const LLGL::RenderTargetDescriptor& renderTargetDesc +) override final; + +virtual void Release( + LLGL::RenderTarget& renderTarget +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.ResourceHeap.inl b/include/LLGL/Backend/RenderSystem.ResourceHeap.inl new file mode 100644 index 0000000000..21d1b41728 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.ResourceHeap.inl @@ -0,0 +1,27 @@ +/* + * RenderSystem.ResourceHeap.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Resource Heaps ----- */ + +virtual LLGL::ResourceHeap* CreateResourceHeap( + const LLGL::ResourceHeapDescriptor& resourceHeapDesc, + const LLGL::ArrayView& initialResourceViews = {} +) override final; + +virtual void Release( + LLGL::ResourceHeap& resourceHeap +) override final; + +virtual std::uint32_t WriteResourceHeap( + LLGL::ResourceHeap& resourceHeap, + std::uint32_t firstDescriptor, + const LLGL::ArrayView& resourceViews +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.Sampler.inl b/include/LLGL/Backend/RenderSystem.Sampler.inl new file mode 100644 index 0000000000..9ddf878650 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.Sampler.inl @@ -0,0 +1,20 @@ +/* + * RenderSystem.Sampler.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Samplers ---- */ + +virtual LLGL::Sampler* CreateSampler( + const LLGL::SamplerDescriptor& samplerDesc +) override final; + +virtual void Release( + LLGL::Sampler& sampler +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.Shader.inl b/include/LLGL/Backend/RenderSystem.Shader.inl new file mode 100644 index 0000000000..e69a7c96f3 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.Shader.inl @@ -0,0 +1,20 @@ +/* + * RenderSystem.Shader.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Shaders ----- */ + +virtual LLGL::Shader* CreateShader( + const LLGL::ShaderDescriptor& shaderDesc +) override final; + +virtual void Release( + LLGL::Shader& shader +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.SwapChain.inl b/include/LLGL/Backend/RenderSystem.SwapChain.inl new file mode 100644 index 0000000000..6c202f72cd --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.SwapChain.inl @@ -0,0 +1,21 @@ +/* + * RenderSystem.SwapChain.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Swap-chain ----- */ + +virtual LLGL::SwapChain* CreateSwapChain( + const LLGL::SwapChainDescriptor& swapChainDesc, + const std::shared_ptr& surface = {} +) override final; + +virtual void Release( + LLGL::SwapChain& swapChain +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.Texture.inl b/include/LLGL/Backend/RenderSystem.Texture.inl new file mode 100644 index 0000000000..185b984654 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.Texture.inl @@ -0,0 +1,33 @@ +/* + * RenderSystem.Texture.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +/* ----- Textures ----- */ + +virtual LLGL::Texture* CreateTexture( + const LLGL::TextureDescriptor& textureDesc, + const LLGL::SrcImageDescriptor* imageDesc = nullptr +) override final; + +virtual void Release( + LLGL::Texture& texture +) override final; + +virtual void WriteTexture( + LLGL::Texture& texture, + const LLGL::TextureRegion& textureRegion, + const LLGL::SrcImageDescriptor& imageDesc +) override final; + +virtual void ReadTexture( + LLGL::Texture& texture, + const LLGL::TextureRegion& textureRegion, + const LLGL::DstImageDescriptor& imageDesc +) override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderSystem.inl b/include/LLGL/Backend/RenderSystem.inl new file mode 100644 index 0000000000..28670be395 --- /dev/null +++ b/include/LLGL/Backend/RenderSystem.inl @@ -0,0 +1,25 @@ +/* + * RenderSystem.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +// ================================================================================ diff --git a/include/LLGL/Backend/RenderTarget.inl b/include/LLGL/Backend/RenderTarget.inl new file mode 100644 index 0000000000..b5d7170790 --- /dev/null +++ b/include/LLGL/Backend/RenderTarget.inl @@ -0,0 +1,34 @@ +/* + * RenderTarget.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +virtual LLGL::Extent2D GetResolution( + void +) const override final; + +virtual std::uint32_t GetSamples( + void +) const override final; + +virtual std::uint32_t GetNumColorAttachments( + void +) const override final; + +virtual bool HasDepthAttachment( + void +) const override final; + +virtual bool HasStencilAttachment( + void +) const override final; + +virtual const LLGL::RenderPass* GetRenderPass( + void +) const override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/Shader.inl b/include/LLGL/Backend/Shader.inl new file mode 100644 index 0000000000..73838c07c0 --- /dev/null +++ b/include/LLGL/Backend/Shader.inl @@ -0,0 +1,18 @@ +/* + * Shader.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +virtual const LLGL::Report* GetReport( + void +) const override final; + +virtual bool Reflect( + LLGL::ShaderReflection& reflection +) const override final; + + + +// ================================================================================ diff --git a/include/LLGL/Backend/Texture.inl b/include/LLGL/Backend/Texture.inl new file mode 100644 index 0000000000..8a2f5ef4e0 --- /dev/null +++ b/include/LLGL/Backend/Texture.inl @@ -0,0 +1,26 @@ +/* + * Texture.inl + * + * Copyright (c) 2015 Lukas Hermanns. All rights reserved. + * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). + */ + +virtual LLGL::TextureDescriptor GetDesc( + void +) const override final; + +virtual LLGL::Format GetFormat( + void +) const override final; + +virtual LLGL::Extent3D GetMipExtent( + std::uint32_t mipLevel +) const override final; + +virtual LLGL::SubresourceFootprint GetSubresourceFootprint( + std::uint32_t mipLevel +) const override final; + + + +// ================================================================================ diff --git a/sources/Renderer/DebugLayer/DbgCommandQueue.h b/sources/Renderer/DebugLayer/DbgCommandQueue.h index 0d6d64b157..254740cc1c 100644 --- a/sources/Renderer/DebugLayer/DbgCommandQueue.h +++ b/sources/Renderer/DebugLayer/DbgCommandQueue.h @@ -25,7 +25,9 @@ class DbgCommandQueue final : public CommandQueue public: - /* ----- Common ----- */ + #include + + public: DbgCommandQueue( CommandQueue& instance, @@ -33,31 +35,8 @@ class DbgCommandQueue final : public CommandQueue RenderingDebugger* debugger ); - /* ----- Command Buffers ----- */ - - void Submit(CommandBuffer& commandBuffer) override; - - /* ----- Queries ----- */ - - bool QueryResult( - QueryHeap& queryHeap, - std::uint32_t firstQuery, - std::uint32_t numQueries, - void* data, - std::size_t dataSize - ) override; - - /* ----- Fences ----- */ - - void Submit(Fence& fence) override; - - bool WaitFence(Fence& fence, std::uint64_t timeout) override; - void WaitIdle() override; - public: - /* ----- Debugging members ----- */ - CommandQueue& instance; private: diff --git a/sources/Renderer/DebugLayer/DbgRenderSystem.h b/sources/Renderer/DebugLayer/DbgRenderSystem.h index 01713258d5..4698a179d2 100644 --- a/sources/Renderer/DebugLayer/DbgRenderSystem.h +++ b/sources/Renderer/DebugLayer/DbgRenderSystem.h @@ -38,107 +38,11 @@ class DbgRenderSystem final : public RenderSystem public: - /* ----- Common ----- */ + #include - DbgRenderSystem(RenderSystemPtr&& instance, RenderingProfiler* profiler, RenderingDebugger* debugger); - - /* ----- Swap-chain ------ */ - - SwapChain* CreateSwapChain(const SwapChainDescriptor& swapChainDesc, const std::shared_ptr& surface = nullptr) override; - - void Release(SwapChain& swapChain) override; - - /* ----- Command queues ----- */ - - CommandQueue* GetCommandQueue() override; - - /* ----- Command buffers ----- */ - - CommandBuffer* CreateCommandBuffer(const CommandBufferDescriptor& commandBufferDesc = {}) override; - - void Release(CommandBuffer& commandBuffer) override; - - /* ----- Buffers ------ */ - - Buffer* CreateBuffer(const BufferDescriptor& bufferDesc, const void* initialData = nullptr) override; - BufferArray* CreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray) override; - - void Release(Buffer& buffer) override; - void Release(BufferArray& bufferArray) override; - - void WriteBuffer(Buffer& buffer, std::uint64_t offset, const void* data, std::uint64_t dataSize) override; - void ReadBuffer(Buffer& buffer, std::uint64_t offset, void* data, std::uint64_t dataSize) override; - - void* MapBuffer(Buffer& buffer, const CPUAccess access) override; - void* MapBuffer(Buffer& buffer, const CPUAccess access, std::uint64_t offset, std::uint64_t length) override; - void UnmapBuffer(Buffer& buffer) override; - - /* ----- Textures ----- */ - - Texture* CreateTexture(const TextureDescriptor& textureDesc, const SrcImageDescriptor* imageDesc = nullptr) override; - - void Release(Texture& texture) override; - - void WriteTexture(Texture& texture, const TextureRegion& textureRegion, const SrcImageDescriptor& imageDesc) override; - void ReadTexture(Texture& texture, const TextureRegion& textureRegion, const DstImageDescriptor& imageDesc) override; - - /* ----- Sampler States ---- */ - - Sampler* CreateSampler(const SamplerDescriptor& samplerDesc) override; - - void Release(Sampler& sampler) override; - - /* ----- Resource Views ----- */ - - ResourceHeap* CreateResourceHeap(const ResourceHeapDescriptor& resourceHeapDesc, const ArrayView& initialResourceViews = {}) override; - - void Release(ResourceHeap& resourceHeap) override; - - std::uint32_t WriteResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstDescriptor, const ArrayView& resourceViews) override; - - /* ----- Render Passes ----- */ - - RenderPass* CreateRenderPass(const RenderPassDescriptor& renderPassDesc) override; - - void Release(RenderPass& renderPass) override; - - /* ----- Render Targets ----- */ - - RenderTarget* CreateRenderTarget(const RenderTargetDescriptor& renderTargetDesc) override; - - void Release(RenderTarget& renderTarget) override; - - /* ----- Shader ----- */ - - Shader* CreateShader(const ShaderDescriptor& shaderDesc) override; - - void Release(Shader& shader) override; - - /* ----- Pipeline Layouts ----- */ - - PipelineLayout* CreatePipelineLayout(const PipelineLayoutDescriptor& pipelineLayoutDesc) override; - - void Release(PipelineLayout& pipelineLayout) override; - - /* ----- Pipeline States ----- */ - - PipelineState* CreatePipelineState(const Blob& serializedCache) override; - PipelineState* CreatePipelineState(const GraphicsPipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - PipelineState* CreatePipelineState(const ComputePipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - - void Release(PipelineState& pipelineState) override; - - /* ----- Queries ----- */ - - QueryHeap* CreateQueryHeap(const QueryHeapDescriptor& queryHeapDesc) override; - - void Release(QueryHeap& queryHeap) override; - - /* ----- Fences ----- */ - - Fence* CreateFence() override; + public: - void Release(Fence& fence) override; + DbgRenderSystem(RenderSystemPtr&& instance, RenderingProfiler* profiler, RenderingDebugger* debugger); private: diff --git a/sources/Renderer/DebugLayer/RenderState/DbgPipelineLayout.h b/sources/Renderer/DebugLayer/RenderState/DbgPipelineLayout.h index 2518d756b5..3e6c493a65 100644 --- a/sources/Renderer/DebugLayer/RenderState/DbgPipelineLayout.h +++ b/sources/Renderer/DebugLayer/RenderState/DbgPipelineLayout.h @@ -23,12 +23,11 @@ class DbgPipelineLayout final : public PipelineLayout public: - void SetName(const char* name) override; + #include + + public: - std::uint32_t GetNumHeapBindings() const override; - std::uint32_t GetNumBindings() const override; - std::uint32_t GetNumStaticSamplers() const override; - std::uint32_t GetNumUniforms() const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/DebugLayer/Shader/DbgShader.h b/sources/Renderer/DebugLayer/Shader/DbgShader.h index f67db35c74..e511871846 100644 --- a/sources/Renderer/DebugLayer/Shader/DbgShader.h +++ b/sources/Renderer/DebugLayer/Shader/DbgShader.h @@ -21,11 +21,13 @@ namespace LLGL class DbgShader final : public Shader { + public: + + #include + public: void SetName(const char* name) override; - const Report* GetReport() const override; - bool Reflect(ShaderReflection& reflection) const override; public: diff --git a/sources/Renderer/DebugLayer/Texture/DbgRenderTarget.h b/sources/Renderer/DebugLayer/Texture/DbgRenderTarget.h index 75897857ca..15f1fce5da 100644 --- a/sources/Renderer/DebugLayer/Texture/DbgRenderTarget.h +++ b/sources/Renderer/DebugLayer/Texture/DbgRenderTarget.h @@ -26,16 +26,11 @@ class DbgRenderTarget final : public RenderTarget public: - void SetName(const char* name) override; - - Extent2D GetResolution() const override; - std::uint32_t GetSamples() const override; - std::uint32_t GetNumColorAttachments() const override; + #include - bool HasDepthAttachment() const override; - bool HasStencilAttachment() const override; + public: - const RenderPass* GetRenderPass() const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/DebugLayer/Texture/DbgTexture.h b/sources/Renderer/DebugLayer/Texture/DbgTexture.h index f08f197751..95b82f49f2 100644 --- a/sources/Renderer/DebugLayer/Texture/DbgTexture.h +++ b/sources/Renderer/DebugLayer/Texture/DbgTexture.h @@ -1,6 +1,6 @@ /* * DbgTexture.h - * + * * Copyright (c) 2015 Lukas Hermanns. All rights reserved. * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). */ @@ -21,13 +21,13 @@ namespace LLGL class DbgTexture final : public Texture { + public: + + #include + public: void SetName(const char* name) override; - TextureDescriptor GetDesc() const override; - Format GetFormat() const override; - Extent3D GetMipExtent(std::uint32_t mipLevel) const override; - SubresourceFootprint GetSubresourceFootprint(std::uint32_t mipLevel) const override; public: diff --git a/sources/Renderer/Direct3D11/D3D11CommandQueue.h b/sources/Renderer/Direct3D11/D3D11CommandQueue.h index 75fb4885f8..1942d279d6 100644 --- a/sources/Renderer/Direct3D11/D3D11CommandQueue.h +++ b/sources/Renderer/Direct3D11/D3D11CommandQueue.h @@ -27,28 +27,11 @@ class D3D11CommandQueue final : public CommandQueue public: - D3D11CommandQueue(ID3D11Device* device, ComPtr& context); - - /* ----- Command Buffers ----- */ - - void Submit(CommandBuffer& commandBuffer) override; - - /* ----- Queries ----- */ - - bool QueryResult( - QueryHeap& queryHeap, - std::uint32_t firstQuery, - std::uint32_t numQueries, - void* data, - std::size_t dataSize - ) override; - - /* ----- Fences ----- */ + #include - void Submit(Fence& fence) override; + public: - bool WaitFence(Fence& fence, std::uint64_t timeout) override; - void WaitIdle() override; + D3D11CommandQueue(ID3D11Device* device, ComPtr& context); private: diff --git a/sources/Renderer/Direct3D11/D3D11RenderSystem.h b/sources/Renderer/Direct3D11/D3D11RenderSystem.h index dbf326ab14..57c6a1ad4c 100644 --- a/sources/Renderer/Direct3D11/D3D11RenderSystem.h +++ b/sources/Renderer/Direct3D11/D3D11RenderSystem.h @@ -49,109 +49,13 @@ class D3D11RenderSystem final : public RenderSystem public: - /* ----- Common ----- */ + #include + + public: D3D11RenderSystem(const RenderSystemDescriptor& renderSystemDesc); ~D3D11RenderSystem(); - /* ----- Swap-chain ------ */ - - SwapChain* CreateSwapChain(const SwapChainDescriptor& swapChainDesc, const std::shared_ptr& surface = nullptr) override; - - void Release(SwapChain& swapChain) override; - - /* ----- Command queues ----- */ - - CommandQueue* GetCommandQueue() override; - - /* ----- Command buffers ----- */ - - CommandBuffer* CreateCommandBuffer(const CommandBufferDescriptor& commandBufferDesc = {}) override; - - void Release(CommandBuffer& commandBuffer) override; - - /* ----- Buffers ------ */ - - Buffer* CreateBuffer(const BufferDescriptor& bufferDesc, const void* initialData = nullptr) override; - BufferArray* CreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray) override; - - void Release(Buffer& buffer) override; - void Release(BufferArray& bufferArray) override; - - void WriteBuffer(Buffer& buffer, std::uint64_t offset, const void* data, std::uint64_t dataSize) override; - void ReadBuffer(Buffer& buffer, std::uint64_t offset, void* data, std::uint64_t dataSize) override; - - void* MapBuffer(Buffer& buffer, const CPUAccess access) override; - void* MapBuffer(Buffer& buffer, const CPUAccess access, std::uint64_t offset, std::uint64_t length) override; - void UnmapBuffer(Buffer& buffer) override; - - /* ----- Textures ----- */ - - Texture* CreateTexture(const TextureDescriptor& textureDesc, const SrcImageDescriptor* imageDesc = nullptr) override; - - void Release(Texture& texture) override; - - void WriteTexture(Texture& texture, const TextureRegion& textureRegion, const SrcImageDescriptor& imageDesc) override; - void ReadTexture(Texture& texture, const TextureRegion& textureRegion, const DstImageDescriptor& imageDesc) override; - - /* ----- Sampler States ---- */ - - Sampler* CreateSampler(const SamplerDescriptor& samplerDesc) override; - - void Release(Sampler& sampler) override; - - /* ----- Resource Heaps ----- */ - - ResourceHeap* CreateResourceHeap(const ResourceHeapDescriptor& resourceHeapDesc, const ArrayView& initialResourceViews = {}) override; - - void Release(ResourceHeap& resourceHeap) override; - - std::uint32_t WriteResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstDescriptor, const ArrayView& resourceViews) override; - - /* ----- Render Passes ----- */ - - RenderPass* CreateRenderPass(const RenderPassDescriptor& renderPassDesc) override; - - void Release(RenderPass& renderPass) override; - - /* ----- Render Targets ----- */ - - RenderTarget* CreateRenderTarget(const RenderTargetDescriptor& renderTargetDesc) override; - - void Release(RenderTarget& renderTarget) override; - - /* ----- Shader ----- */ - - Shader* CreateShader(const ShaderDescriptor& shaderDesc) override; - - void Release(Shader& shader) override; - - /* ----- Pipeline Layouts ----- */ - - PipelineLayout* CreatePipelineLayout(const PipelineLayoutDescriptor& pipelineLayoutDesc) override; - - void Release(PipelineLayout& pipelineLayout) override; - - /* ----- Pipeline States ----- */ - - PipelineState* CreatePipelineState(const Blob& serializedCache) override; - PipelineState* CreatePipelineState(const GraphicsPipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - PipelineState* CreatePipelineState(const ComputePipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - - void Release(PipelineState& pipelineState) override; - - /* ----- Queries ----- */ - - QueryHeap* CreateQueryHeap(const QueryHeapDescriptor& queryHeapDesc) override; - - void Release(QueryHeap& queryHeap) override; - - /* ----- Fences ----- */ - - Fence* CreateFence() override; - - void Release(Fence& fence) override; - public: /* ----- Internal functions ----- */ diff --git a/sources/Renderer/Direct3D11/RenderState/D3D11PipelineLayout.h b/sources/Renderer/Direct3D11/RenderState/D3D11PipelineLayout.h index 3ddd0a3fa1..eb5cea4426 100644 --- a/sources/Renderer/Direct3D11/RenderState/D3D11PipelineLayout.h +++ b/sources/Renderer/Direct3D11/RenderState/D3D11PipelineLayout.h @@ -37,10 +37,7 @@ class D3D11PipelineLayout final : public PipelineLayout public: - std::uint32_t GetNumHeapBindings() const override; - std::uint32_t GetNumBindings() const override; - std::uint32_t GetNumStaticSamplers() const override; - std::uint32_t GetNumUniforms() const override; + #include public: diff --git a/sources/Renderer/Direct3D11/Shader/D3D11Shader.h b/sources/Renderer/Direct3D11/Shader/D3D11Shader.h index 0f60b6f549..4dfe29bf36 100644 --- a/sources/Renderer/Direct3D11/Shader/D3D11Shader.h +++ b/sources/Renderer/Direct3D11/Shader/D3D11Shader.h @@ -72,11 +72,11 @@ class D3D11Shader final : public Shader public: - void SetName(const char* name) override; + #include - const Report* GetReport() const override; + public: - bool Reflect(ShaderReflection& reflection) const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Direct3D11/Texture/D3D11RenderTarget.h b/sources/Renderer/Direct3D11/Texture/D3D11RenderTarget.h index 69220e294b..6a539442b7 100644 --- a/sources/Renderer/Direct3D11/Texture/D3D11RenderTarget.h +++ b/sources/Renderer/Direct3D11/Texture/D3D11RenderTarget.h @@ -28,16 +28,11 @@ class D3D11RenderTarget final : public RenderTarget public: - void SetName(const char* name) override; - - Extent2D GetResolution() const override; - std::uint32_t GetSamples() const override; - std::uint32_t GetNumColorAttachments() const override; + #include - bool HasDepthAttachment() const override; - bool HasStencilAttachment() const override; + public: - const RenderPass* GetRenderPass() const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Direct3D11/Texture/D3D11Texture.h b/sources/Renderer/Direct3D11/Texture/D3D11Texture.h index a4b5648f8b..e9c08a8439 100644 --- a/sources/Renderer/Direct3D11/Texture/D3D11Texture.h +++ b/sources/Renderer/Direct3D11/Texture/D3D11Texture.h @@ -52,15 +52,11 @@ class D3D11Texture final : public Texture public: - void SetName(const char* name) override; - - Extent3D GetMipExtent(std::uint32_t mipLevel) const override; - - TextureDescriptor GetDesc() const override; + #include - Format GetFormat() const override; + public: - SubresourceFootprint GetSubresourceFootprint(std::uint32_t mipLevel) const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Direct3D12/Command/D3D12CommandQueue.h b/sources/Renderer/Direct3D12/Command/D3D12CommandQueue.h index fc1c90154e..502766ab25 100644 --- a/sources/Renderer/Direct3D12/Command/D3D12CommandQueue.h +++ b/sources/Renderer/Direct3D12/Command/D3D12CommandQueue.h @@ -27,6 +27,10 @@ class D3D12Device; class D3D12CommandQueue final : public CommandQueue { + public: + + #include + public: D3D12CommandQueue( @@ -36,27 +40,6 @@ class D3D12CommandQueue final : public CommandQueue void SetName(const char* name) override; - /* ----- Command Buffers ----- */ - - void Submit(CommandBuffer& commandBuffer) override; - - /* ----- Queries ----- */ - - bool QueryResult( - QueryHeap& queryHeap, - std::uint32_t firstQuery, - std::uint32_t numQueries, - void* data, - std::size_t dataSize - ) override; - - /* ----- Fences ----- */ - - void Submit(Fence& fence) override; - - bool WaitFence(Fence& fence, std::uint64_t timeout) override; - void WaitIdle() override; - public: // Submits the specified fence with a custom value. diff --git a/sources/Renderer/Direct3D12/D3D12RenderSystem.h b/sources/Renderer/Direct3D12/D3D12RenderSystem.h index c749a792fe..769322612b 100644 --- a/sources/Renderer/Direct3D12/D3D12RenderSystem.h +++ b/sources/Renderer/Direct3D12/D3D12RenderSystem.h @@ -53,109 +53,13 @@ class D3D12RenderSystem final : public RenderSystem public: - /* ----- Common ----- */ + #include + + public: D3D12RenderSystem(const RenderSystemDescriptor& renderSystemDesc); ~D3D12RenderSystem(); - /* ----- Swap-chain ------ */ - - SwapChain* CreateSwapChain(const SwapChainDescriptor& swapChainDesc, const std::shared_ptr& surface = nullptr) override; - - void Release(SwapChain& swapChain) override; - - /* ----- Command queues ----- */ - - CommandQueue* GetCommandQueue() override; - - /* ----- Command buffers ----- */ - - CommandBuffer* CreateCommandBuffer(const CommandBufferDescriptor& commandBufferDesc = {}) override; - - void Release(CommandBuffer& commandBuffer) override; - - /* ----- Buffers ------ */ - - Buffer* CreateBuffer(const BufferDescriptor& bufferDesc, const void* initialData = nullptr) override; - BufferArray* CreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray) override; - - void Release(Buffer& buffer) override; - void Release(BufferArray& bufferArray) override; - - void WriteBuffer(Buffer& buffer, std::uint64_t offset, const void* data, std::uint64_t dataSize) override; - void ReadBuffer(Buffer& buffer, std::uint64_t offset, void* data, std::uint64_t dataSize) override; - - void* MapBuffer(Buffer& buffer, const CPUAccess access) override; - void* MapBuffer(Buffer& buffer, const CPUAccess access, std::uint64_t offset, std::uint64_t length) override; - void UnmapBuffer(Buffer& buffer) override; - - /* ----- Textures ----- */ - - Texture* CreateTexture(const TextureDescriptor& textureDesc, const SrcImageDescriptor* imageDesc = nullptr) override; - - void Release(Texture& texture) override; - - void WriteTexture(Texture& texture, const TextureRegion& textureRegion, const SrcImageDescriptor& imageDesc) override; - void ReadTexture(Texture& texture, const TextureRegion& textureRegion, const DstImageDescriptor& imageDesc) override; - - /* ----- Sampler States ---- */ - - Sampler* CreateSampler(const SamplerDescriptor& samplerDesc) override; - - void Release(Sampler& sampler) override; - - /* ----- Resource Heaps ----- */ - - ResourceHeap* CreateResourceHeap(const ResourceHeapDescriptor& resourceHeapDesc, const ArrayView& initialResourceViews = {}) override; - - void Release(ResourceHeap& resourceHeap) override; - - std::uint32_t WriteResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstDescriptor, const ArrayView& resourceViews) override; - - /* ----- Render Passes ----- */ - - RenderPass* CreateRenderPass(const RenderPassDescriptor& renderPassDesc) override; - - void Release(RenderPass& renderPass) override; - - /* ----- Render Targets ----- */ - - RenderTarget* CreateRenderTarget(const RenderTargetDescriptor& renderTargetDesc) override; - - void Release(RenderTarget& renderTarget) override; - - /* ----- Shader ----- */ - - Shader* CreateShader(const ShaderDescriptor& shaderDesc) override; - - void Release(Shader& shader) override; - - /* ----- Pipeline Layouts ----- */ - - PipelineLayout* CreatePipelineLayout(const PipelineLayoutDescriptor& pipelineLayoutDesc) override; - - void Release(PipelineLayout& pipelineLayout) override; - - /* ----- Pipeline States ----- */ - - PipelineState* CreatePipelineState(const Blob& serializedCache) override; - PipelineState* CreatePipelineState(const GraphicsPipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - PipelineState* CreatePipelineState(const ComputePipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - - void Release(PipelineState& pipelineState) override; - - /* ----- Queries ----- */ - - QueryHeap* CreateQueryHeap(const QueryHeapDescriptor& queryHeapDesc) override; - - void Release(QueryHeap& queryHeap) override; - - /* ----- Fences ----- */ - - Fence* CreateFence() override; - - void Release(Fence& fence) override; - public: /* ----- Extended internal functions ----- */ diff --git a/sources/Renderer/Direct3D12/RenderState/D3D12PipelineLayout.h b/sources/Renderer/Direct3D12/RenderState/D3D12PipelineLayout.h index 44caf98fef..1ecfbaa934 100644 --- a/sources/Renderer/Direct3D12/RenderState/D3D12PipelineLayout.h +++ b/sources/Renderer/Direct3D12/RenderState/D3D12PipelineLayout.h @@ -110,12 +110,11 @@ class D3D12PipelineLayout final : public PipelineLayout public: - void SetName(const char* name) override; + #include + + public: - std::uint32_t GetNumHeapBindings() const override; - std::uint32_t GetNumBindings() const override; - std::uint32_t GetNumStaticSamplers() const override; - std::uint32_t GetNumUniforms() const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Direct3D12/Shader/D3D12Shader.h b/sources/Renderer/Direct3D12/Shader/D3D12Shader.h index 689dec3ab7..35f116c1b0 100644 --- a/sources/Renderer/Direct3D12/Shader/D3D12Shader.h +++ b/sources/Renderer/Direct3D12/Shader/D3D12Shader.h @@ -42,11 +42,11 @@ class D3D12Shader final : public Shader public: - D3D12Shader(const ShaderDescriptor& desc); + #include - const Report* GetReport() const override; + public: - bool Reflect(ShaderReflection& reflection) const override; + D3D12Shader(const ShaderDescriptor& desc); public: diff --git a/sources/Renderer/Direct3D12/Texture/D3D12RenderTarget.h b/sources/Renderer/Direct3D12/Texture/D3D12RenderTarget.h index e58a3c4975..42be66f252 100644 --- a/sources/Renderer/Direct3D12/Texture/D3D12RenderTarget.h +++ b/sources/Renderer/Direct3D12/Texture/D3D12RenderTarget.h @@ -30,16 +30,11 @@ class D3D12RenderTarget final : public RenderTarget public: - void SetName(const char* name) override; - - Extent2D GetResolution() const override; - std::uint32_t GetSamples() const override; - std::uint32_t GetNumColorAttachments() const override; + #include - bool HasDepthAttachment() const override; - bool HasStencilAttachment() const override; + public: - const RenderPass* GetRenderPass() const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Direct3D12/Texture/D3D12Texture.h b/sources/Renderer/Direct3D12/Texture/D3D12Texture.h index 69c359f849..1715852ce1 100644 --- a/sources/Renderer/Direct3D12/Texture/D3D12Texture.h +++ b/sources/Renderer/Direct3D12/Texture/D3D12Texture.h @@ -27,15 +27,11 @@ class D3D12Texture final : public Texture public: - void SetName(const char* name) override; - - Extent3D GetMipExtent(std::uint32_t mipLevel) const override; - - TextureDescriptor GetDesc() const override; + #include - Format GetFormat() const override; + public: - SubresourceFootprint GetSubresourceFootprint(std::uint32_t mipLevel) const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Metal/Command/MTCommandQueue.h b/sources/Renderer/Metal/Command/MTCommandQueue.h index 39b32cbae2..ed706b5e84 100644 --- a/sources/Renderer/Metal/Command/MTCommandQueue.h +++ b/sources/Renderer/Metal/Command/MTCommandQueue.h @@ -1,6 +1,6 @@ /* * MTCommandQueue.h - * + * * Copyright (c) 2015 Lukas Hermanns. All rights reserved. * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). */ @@ -23,32 +23,13 @@ class MTCommandQueue final : public CommandQueue public: - /* ----- Common ----- */ + #include + + public: MTCommandQueue(id device); ~MTCommandQueue(); - /* ----- Command Buffers ----- */ - - void Submit(CommandBuffer& commandBuffer) override; - - /* ----- Queries ----- */ - - bool QueryResult( - QueryHeap& queryHeap, - std::uint32_t firstQuery, - std::uint32_t numQueries, - void* data, - std::size_t dataSize - ) override; - - /* ----- Fences ----- */ - - void Submit(Fence& fence) override; - - bool WaitFence(Fence& fence, std::uint64_t timeout) override; - void WaitIdle() override; - public: // Returns the native MTLCommandQueue object. diff --git a/sources/Renderer/Metal/MTRenderSystem.h b/sources/Renderer/Metal/MTRenderSystem.h index 68b2b0af17..04f3469518 100644 --- a/sources/Renderer/Metal/MTRenderSystem.h +++ b/sources/Renderer/Metal/MTRenderSystem.h @@ -43,109 +43,13 @@ class MTRenderSystem final : public RenderSystem public: - /* ----- Common ----- */ + #include + + public: MTRenderSystem(); ~MTRenderSystem(); - /* ----- Swap-chain ----- */ - - SwapChain* CreateSwapChain(const SwapChainDescriptor& swapChainDesc, const std::shared_ptr& surface = nullptr) override; - - void Release(SwapChain& swapChain) override; - - /* ----- Command queues ----- */ - - CommandQueue* GetCommandQueue() override; - - /* ----- Command buffers ----- */ - - CommandBuffer* CreateCommandBuffer(const CommandBufferDescriptor& commandBufferDesc = {}) override; - - void Release(CommandBuffer& commandBuffer) override; - - /* ----- Buffers ------ */ - - Buffer* CreateBuffer(const BufferDescriptor& bufferDesc, const void* initialData = nullptr) override; - BufferArray* CreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray) override; - - void Release(Buffer& buffer) override; - void Release(BufferArray& bufferArray) override; - - void WriteBuffer(Buffer& buffer, std::uint64_t offset, const void* data, std::uint64_t dataSize) override; - void ReadBuffer(Buffer& buffer, std::uint64_t offset, void* data, std::uint64_t dataSize) override; - - void* MapBuffer(Buffer& buffer, const CPUAccess access) override; - void* MapBuffer(Buffer& buffer, const CPUAccess access, std::uint64_t offset, std::uint64_t length) override; - void UnmapBuffer(Buffer& buffer) override; - - /* ----- Textures ----- */ - - Texture* CreateTexture(const TextureDescriptor& textureDesc, const SrcImageDescriptor* imageDesc = nullptr) override; - - void Release(Texture& texture) override; - - void WriteTexture(Texture& texture, const TextureRegion& textureRegion, const SrcImageDescriptor& imageDesc) override; - void ReadTexture(Texture& texture, const TextureRegion& textureRegion, const DstImageDescriptor& imageDesc) override; - - /* ----- Sampler States ---- */ - - Sampler* CreateSampler(const SamplerDescriptor& samplerDesc) override; - - void Release(Sampler& sampler) override; - - /* ----- Resource Heaps ----- */ - - ResourceHeap* CreateResourceHeap(const ResourceHeapDescriptor& resourceHeapDesc, const ArrayView& initialResourceViews = {}) override; - - void Release(ResourceHeap& resourceHeap) override; - - std::uint32_t WriteResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstDescriptor, const ArrayView& resourceViews) override; - - /* ----- Render Passes ----- */ - - RenderPass* CreateRenderPass(const RenderPassDescriptor& renderPassDesc) override; - - void Release(RenderPass& renderPass) override; - - /* ----- Render Targets ----- */ - - RenderTarget* CreateRenderTarget(const RenderTargetDescriptor& renderTargetDesc) override; - - void Release(RenderTarget& renderTarget) override; - - /* ----- Shader ----- */ - - Shader* CreateShader(const ShaderDescriptor& shaderDesc) override; - - void Release(Shader& shader) override; - - /* ----- Pipeline Layouts ----- */ - - PipelineLayout* CreatePipelineLayout(const PipelineLayoutDescriptor& pipelineLayoutDesc) override; - - void Release(PipelineLayout& pipelineLayout) override; - - /* ----- Pipeline States ----- */ - - PipelineState* CreatePipelineState(const Blob& serializedCache) override; - PipelineState* CreatePipelineState(const GraphicsPipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - PipelineState* CreatePipelineState(const ComputePipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - - void Release(PipelineState& pipelineState) override; - - /* ----- Queries ----- */ - - QueryHeap* CreateQueryHeap(const QueryHeapDescriptor& queryHeapDesc) override; - - void Release(QueryHeap& queryHeap) override; - - /* ----- Fences ----- */ - - Fence* CreateFence() override; - - void Release(Fence& fence) override; - private: void CreateDeviceResources(); diff --git a/sources/Renderer/Metal/RenderState/MTPipelineLayout.h b/sources/Renderer/Metal/RenderState/MTPipelineLayout.h index 3f865dfd75..4a89adc9e3 100644 --- a/sources/Renderer/Metal/RenderState/MTPipelineLayout.h +++ b/sources/Renderer/Metal/RenderState/MTPipelineLayout.h @@ -1,6 +1,6 @@ /* * MTPipelineLayout.h - * + * * Copyright (c) 2015 Lukas Hermanns. All rights reserved. * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). */ @@ -28,10 +28,7 @@ class MTPipelineLayout final : public PipelineLayout public: - std::uint32_t GetNumHeapBindings() const override; - std::uint32_t GetNumBindings() const override; - std::uint32_t GetNumStaticSamplers() const override; - std::uint32_t GetNumUniforms() const override; + #include public: diff --git a/sources/Renderer/Metal/Shader/MTShader.h b/sources/Renderer/Metal/Shader/MTShader.h index c7084017a2..53ebc17db2 100644 --- a/sources/Renderer/Metal/Shader/MTShader.h +++ b/sources/Renderer/Metal/Shader/MTShader.h @@ -24,12 +24,12 @@ class MTShader final : public Shader public: - MTShader(id device, const ShaderDescriptor& desc); - ~MTShader(); + #include - const Report* GetReport() const override; + public: - bool Reflect(ShaderReflection& reflection) const override; + MTShader(id device, const ShaderDescriptor& desc); + ~MTShader(); public: diff --git a/sources/Renderer/Metal/Texture/MTRenderTarget.h b/sources/Renderer/Metal/Texture/MTRenderTarget.h index ad20d87283..62d0484d32 100644 --- a/sources/Renderer/Metal/Texture/MTRenderTarget.h +++ b/sources/Renderer/Metal/Texture/MTRenderTarget.h @@ -27,17 +27,14 @@ class MTRenderTarget final : public RenderTarget public: - MTRenderTarget(id device, const RenderTargetDescriptor& desc); - ~MTRenderTarget(); + #include - Extent2D GetResolution() const override; - std::uint32_t GetSamples() const override; - std::uint32_t GetNumColorAttachments() const override; + public: - bool HasDepthAttachment() const override; - bool HasStencilAttachment() const override; + MTRenderTarget(id device, const RenderTargetDescriptor& desc); + ~MTRenderTarget(); - const RenderPass* GetRenderPass() const override; + public: // Updates the native render pass descriptor with the specified clear values. Returns null on failure. MTLRenderPassDescriptor* GetAndUpdateNativeRenderPass( @@ -46,8 +43,6 @@ class MTRenderTarget final : public RenderTarget const ClearValue* clearValues ); - public: - // Returns the native render pass descriptor . inline MTLRenderPassDescriptor* GetNativeRenderPass() const { diff --git a/sources/Renderer/Metal/Texture/MTTexture.h b/sources/Renderer/Metal/Texture/MTTexture.h index 3f77dbbe5b..6a9ff48fbf 100644 --- a/sources/Renderer/Metal/Texture/MTTexture.h +++ b/sources/Renderer/Metal/Texture/MTTexture.h @@ -26,13 +26,7 @@ class MTTexture final : public Texture public: - Extent3D GetMipExtent(std::uint32_t mipLevel) const override; - - TextureDescriptor GetDesc() const override; - - Format GetFormat() const override; - - SubresourceFootprint GetSubresourceFootprint(std::uint32_t mipLevel) const override; + #include public: diff --git a/sources/Renderer/Null/Command/NullCommandQueue.h b/sources/Renderer/Null/Command/NullCommandQueue.h index d00e6c5dd4..dbb8755aad 100644 --- a/sources/Renderer/Null/Command/NullCommandQueue.h +++ b/sources/Renderer/Null/Command/NullCommandQueue.h @@ -21,26 +21,7 @@ class NullCommandQueue final : public CommandQueue public: - /* ----- Command Buffers ----- */ - - void Submit(CommandBuffer& commandBuffer) override; - - /* ----- Queries ----- */ - - bool QueryResult( - QueryHeap& queryHeap, - std::uint32_t firstQuery, - std::uint32_t numQueries, - void* data, - std::size_t dataSize - ) override; - - /* ----- Fences ----- */ - - void Submit(Fence& fence) override; - - bool WaitFence(Fence& fence, std::uint64_t timeout) override; - void WaitIdle() override; + #include }; diff --git a/sources/Renderer/Null/NullRenderSystem.h b/sources/Renderer/Null/NullRenderSystem.h index 3e27e2fb7d..3c66ae0f4f 100644 --- a/sources/Renderer/Null/NullRenderSystem.h +++ b/sources/Renderer/Null/NullRenderSystem.h @@ -38,105 +38,11 @@ class NullRenderSystem final : public RenderSystem public: - NullRenderSystem(const RenderSystemDescriptor& renderSystemDesc); - - /* ----- Swap-chain ------ */ - - SwapChain* CreateSwapChain(const SwapChainDescriptor& swapChainDesc, const std::shared_ptr& surface = nullptr) override; - - void Release(SwapChain& swapChain) override; - - /* ----- Command queues ----- */ - - CommandQueue* GetCommandQueue() override; - - /* ----- Command buffers ----- */ - - CommandBuffer* CreateCommandBuffer(const CommandBufferDescriptor& commandBufferDesc = {}) override; - - void Release(CommandBuffer& commandBuffer) override; - - /* ----- Buffers ------ */ - - Buffer* CreateBuffer(const BufferDescriptor& bufferDesc, const void* initialData = nullptr) override; - BufferArray* CreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray) override; - - void Release(Buffer& buffer) override; - void Release(BufferArray& bufferArray) override; - - void WriteBuffer(Buffer& buffer, std::uint64_t offset, const void* data, std::uint64_t dataSize) override; - void ReadBuffer(Buffer& buffer, std::uint64_t offset, void* data, std::uint64_t dataSize) override; - - void* MapBuffer(Buffer& buffer, const CPUAccess access) override; - void* MapBuffer(Buffer& buffer, const CPUAccess access, std::uint64_t offset, std::uint64_t length) override; - void UnmapBuffer(Buffer& buffer) override; - - /* ----- Textures ----- */ - - Texture* CreateTexture(const TextureDescriptor& textureDesc, const SrcImageDescriptor* imageDesc = nullptr) override; - - void Release(Texture& texture) override; - - void WriteTexture(Texture& texture, const TextureRegion& textureRegion, const SrcImageDescriptor& imageDesc) override; - void ReadTexture(Texture& texture, const TextureRegion& textureRegion, const DstImageDescriptor& imageDesc) override; - - /* ----- Sampler States ---- */ - - Sampler* CreateSampler(const SamplerDescriptor& samplerDesc) override; - - void Release(Sampler& sampler) override; - - /* ----- Resource Views ----- */ - - ResourceHeap* CreateResourceHeap(const ResourceHeapDescriptor& resourceHeapDesc, const ArrayView& initialResourceViews = {}) override; + #include - void Release(ResourceHeap& resourceHeap) override; - - std::uint32_t WriteResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstDescriptor, const ArrayView& resourceViews) override; - - /* ----- Render Passes ----- */ - - RenderPass* CreateRenderPass(const RenderPassDescriptor& renderPassDesc) override; - - void Release(RenderPass& renderPass) override; - - /* ----- Render Targets ----- */ - - RenderTarget* CreateRenderTarget(const RenderTargetDescriptor& renderTargetDesc) override; - - void Release(RenderTarget& renderTarget) override; - - /* ----- Shader ----- */ - - Shader* CreateShader(const ShaderDescriptor& shaderDesc) override; - - void Release(Shader& shader) override; - - /* ----- Pipeline Layouts ----- */ - - PipelineLayout* CreatePipelineLayout(const PipelineLayoutDescriptor& pipelineLayoutDesc) override; - - void Release(PipelineLayout& pipelineLayout) override; - - /* ----- Pipeline States ----- */ - - PipelineState* CreatePipelineState(const Blob& serializedCache) override; - PipelineState* CreatePipelineState(const GraphicsPipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - PipelineState* CreatePipelineState(const ComputePipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - - void Release(PipelineState& pipelineState) override; - - /* ----- Queries ----- */ - - QueryHeap* CreateQueryHeap(const QueryHeapDescriptor& queryHeapDesc) override; - - void Release(QueryHeap& queryHeap) override; - - /* ----- Fences ----- */ - - Fence* CreateFence() override; + public: - void Release(Fence& fence) override; + NullRenderSystem(const RenderSystemDescriptor& renderSystemDesc); private: diff --git a/sources/Renderer/Null/RenderState/NullPipelineLayout.h b/sources/Renderer/Null/RenderState/NullPipelineLayout.h index aeb55fc158..2c5550afc4 100644 --- a/sources/Renderer/Null/RenderState/NullPipelineLayout.h +++ b/sources/Renderer/Null/RenderState/NullPipelineLayout.h @@ -23,12 +23,11 @@ class NullPipelineLayout final : public PipelineLayout public: - void SetName(const char* name) override; + #include + + public: - std::uint32_t GetNumHeapBindings() const override; - std::uint32_t GetNumBindings() const override; - std::uint32_t GetNumStaticSamplers() const override; - std::uint32_t GetNumUniforms() const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Null/Shader/NullShader.h b/sources/Renderer/Null/Shader/NullShader.h index 44ff93ec07..45e6bb2702 100644 --- a/sources/Renderer/Null/Shader/NullShader.h +++ b/sources/Renderer/Null/Shader/NullShader.h @@ -20,11 +20,13 @@ namespace LLGL class NullShader final : public Shader { + public: + + #include + public: void SetName(const char* name) override; - const Report* GetReport() const override; - bool Reflect(ShaderReflection& reflection) const override; public: diff --git a/sources/Renderer/Null/Texture/NullRenderTarget.h b/sources/Renderer/Null/Texture/NullRenderTarget.h index 5d45dc298b..10dbec9939 100644 --- a/sources/Renderer/Null/Texture/NullRenderTarget.h +++ b/sources/Renderer/Null/Texture/NullRenderTarget.h @@ -24,16 +24,11 @@ class NullRenderTarget final : public RenderTarget public: - void SetName(const char* name) override; - - Extent2D GetResolution() const override; - std::uint32_t GetSamples() const override; - std::uint32_t GetNumColorAttachments() const override; + #include - bool HasDepthAttachment() const override; - bool HasStencilAttachment() const override; + public: - const RenderPass* GetRenderPass() const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Null/Texture/NullTexture.h b/sources/Renderer/Null/Texture/NullTexture.h index f4131770a8..4e43859adf 100644 --- a/sources/Renderer/Null/Texture/NullTexture.h +++ b/sources/Renderer/Null/Texture/NullTexture.h @@ -22,13 +22,13 @@ namespace LLGL class NullTexture final : public Texture { + public: + + #include + public: void SetName(const char* name) override; - TextureDescriptor GetDesc() const override; - Format GetFormat() const override; - Extent3D GetMipExtent(std::uint32_t mipLevel) const override; - SubresourceFootprint GetSubresourceFootprint(std::uint32_t mipLevel) const override; public: diff --git a/sources/Renderer/OpenGL/Command/GLCommandQueue.h b/sources/Renderer/OpenGL/Command/GLCommandQueue.h index 8db4947f9b..0984380899 100644 --- a/sources/Renderer/OpenGL/Command/GLCommandQueue.h +++ b/sources/Renderer/OpenGL/Command/GLCommandQueue.h @@ -1,6 +1,6 @@ /* * GLCommandQueue.h - * + * * Copyright (c) 2015 Lukas Hermanns. All rights reserved. * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). */ @@ -24,28 +24,11 @@ class GLCommandQueue final : public CommandQueue public: - GLCommandQueue(GLStateManager& stateManager); - - /* ----- Command Buffers ----- */ - - void Submit(CommandBuffer& commandBuffer) override; - - /* ----- Queries ----- */ + #include - bool QueryResult( - QueryHeap& queryHeap, - std::uint32_t firstQuery, - std::uint32_t numQueries, - void* data, - std::size_t dataSize - ) override; - - /* ----- Fences ----- */ - - void Submit(Fence& fence) override; + public: - bool WaitFence(Fence& fence, std::uint64_t timeout) override; - void WaitIdle() override; + GLCommandQueue(GLStateManager& stateManager); private: diff --git a/sources/Renderer/OpenGL/GLRenderSystem.h b/sources/Renderer/OpenGL/GLRenderSystem.h index 7c7cb77960..db321ab9b0 100644 --- a/sources/Renderer/OpenGL/GLRenderSystem.h +++ b/sources/Renderer/OpenGL/GLRenderSystem.h @@ -53,109 +53,13 @@ class GLRenderSystem final : public RenderSystem public: - /* ----- Common ----- */ + #include + + public: GLRenderSystem(const RenderSystemDescriptor& renderSystemDesc); ~GLRenderSystem(); - /* ----- Swap-chain ----- */ - - SwapChain* CreateSwapChain(const SwapChainDescriptor& swapChainDesc, const std::shared_ptr& surface = nullptr) override; - - void Release(SwapChain& swapChain) override; - - /* ----- Command queues ----- */ - - CommandQueue* GetCommandQueue() override; - - /* ----- Command buffers ----- */ - - CommandBuffer* CreateCommandBuffer(const CommandBufferDescriptor& commandBufferDesc = {}) override; - - void Release(CommandBuffer& commandBuffer) override; - - /* ----- Buffers ------ */ - - Buffer* CreateBuffer(const BufferDescriptor& bufferDesc, const void* initialData = nullptr) override; - BufferArray* CreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray) override; - - void Release(Buffer& buffer) override; - void Release(BufferArray& bufferArray) override; - - void WriteBuffer(Buffer& buffer, std::uint64_t offset, const void* data, std::uint64_t dataSize) override; - void ReadBuffer(Buffer& buffer, std::uint64_t offset, void* data, std::uint64_t dataSize) override; - - void* MapBuffer(Buffer& buffer, const CPUAccess access) override; - void* MapBuffer(Buffer& buffer, const CPUAccess access, std::uint64_t offset, std::uint64_t length) override; - void UnmapBuffer(Buffer& buffer) override; - - /* ----- Textures ----- */ - - Texture* CreateTexture(const TextureDescriptor& textureDesc, const SrcImageDescriptor* imageDesc = nullptr) override; - - void Release(Texture& texture) override; - - void WriteTexture(Texture& texture, const TextureRegion& textureRegion, const SrcImageDescriptor& imageDesc) override; - void ReadTexture(Texture& texture, const TextureRegion& textureRegion, const DstImageDescriptor& imageDesc) override; - - /* ----- Sampler States ---- */ - - Sampler* CreateSampler(const SamplerDescriptor& samplerDesc) override; - - void Release(Sampler& sampler) override; - - /* ----- Resource Heaps ----- */ - - ResourceHeap* CreateResourceHeap(const ResourceHeapDescriptor& resourceHeapDesc, const ArrayView& initialResourceViews = {}) override; - - void Release(ResourceHeap& resourceHeap) override; - - std::uint32_t WriteResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstDescriptor, const ArrayView& resourceViews) override; - - /* ----- Render Passes ----- */ - - RenderPass* CreateRenderPass(const RenderPassDescriptor& renderPassDesc) override; - - void Release(RenderPass& renderPass) override; - - /* ----- Render Targets ----- */ - - RenderTarget* CreateRenderTarget(const RenderTargetDescriptor& renderTargetDesc) override; - - void Release(RenderTarget& renderTarget) override; - - /* ----- Shader ----- */ - - Shader* CreateShader(const ShaderDescriptor& shaderDesc) override; - - void Release(Shader& shader) override; - - /* ----- Pipeline Layouts ----- */ - - PipelineLayout* CreatePipelineLayout(const PipelineLayoutDescriptor& pipelineLayoutDesc) override; - - void Release(PipelineLayout& pipelineLayout) override; - - /* ----- Pipeline States ----- */ - - PipelineState* CreatePipelineState(const Blob& serializedCache) override; - PipelineState* CreatePipelineState(const GraphicsPipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - PipelineState* CreatePipelineState(const ComputePipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - - void Release(PipelineState& pipelineState) override; - - /* ----- Queries ----- */ - - QueryHeap* CreateQueryHeap(const QueryHeapDescriptor& queryHeapDesc) override; - - void Release(QueryHeap& queryHeap) override; - - /* ----- Fences ----- */ - - Fence* CreateFence() override; - - void Release(Fence& fence) override; - private: void CreateGLContextDependentDevices(GLStateManager& stateManager); diff --git a/sources/Renderer/OpenGL/RenderState/GLPipelineLayout.h b/sources/Renderer/OpenGL/RenderState/GLPipelineLayout.h index 788922856d..372a359182 100644 --- a/sources/Renderer/OpenGL/RenderState/GLPipelineLayout.h +++ b/sources/Renderer/OpenGL/RenderState/GLPipelineLayout.h @@ -36,10 +36,7 @@ class GLPipelineLayout final : public PipelineLayout public: - std::uint32_t GetNumHeapBindings() const override; - std::uint32_t GetNumBindings() const override; - std::uint32_t GetNumStaticSamplers() const override; - std::uint32_t GetNumUniforms() const override; + #include public: diff --git a/sources/Renderer/OpenGL/Texture/GLRenderTarget.h b/sources/Renderer/OpenGL/Texture/GLRenderTarget.h index 36acec2c7a..a9ea9f1d84 100644 --- a/sources/Renderer/OpenGL/Texture/GLRenderTarget.h +++ b/sources/Renderer/OpenGL/Texture/GLRenderTarget.h @@ -30,16 +30,11 @@ class GLRenderTarget final : public RenderTarget public: - void SetName(const char* name) override; - - Extent2D GetResolution() const override; - std::uint32_t GetSamples() const override; - std::uint32_t GetNumColorAttachments() const override; + #include - bool HasDepthAttachment() const override; - bool HasStencilAttachment() const override; + public: - const RenderPass* GetRenderPass() const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/OpenGL/Texture/GLTexture.h b/sources/Renderer/OpenGL/Texture/GLTexture.h index 2425b15180..19fce44f48 100644 --- a/sources/Renderer/OpenGL/Texture/GLTexture.h +++ b/sources/Renderer/OpenGL/Texture/GLTexture.h @@ -1,6 +1,6 @@ /* * GLTexture.h - * + * * Copyright (c) 2015 Lukas Hermanns. All rights reserved. * Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). */ @@ -36,15 +36,11 @@ class GLTexture final : public Texture public: - void SetName(const char* name) override; - - Extent3D GetMipExtent(std::uint32_t mipLevel) const override; - - TextureDescriptor GetDesc() const override; + #include - Format GetFormat() const override; + public: - SubresourceFootprint GetSubresourceFootprint(std::uint32_t mipLevel) const override; + void SetName(const char* name) override; public: diff --git a/sources/Renderer/Vulkan/RenderState/VKPipelineLayout.h b/sources/Renderer/Vulkan/RenderState/VKPipelineLayout.h index 0eb4374578..95dabe43bf 100644 --- a/sources/Renderer/Vulkan/RenderState/VKPipelineLayout.h +++ b/sources/Renderer/Vulkan/RenderState/VKPipelineLayout.h @@ -38,10 +38,7 @@ class VKPipelineLayout final : public PipelineLayout public: - std::uint32_t GetNumHeapBindings() const override; - std::uint32_t GetNumBindings() const override; - std::uint32_t GetNumStaticSamplers() const override; - std::uint32_t GetNumUniforms() const override; + #include public: diff --git a/sources/Renderer/Vulkan/Shader/VKShader.h b/sources/Renderer/Vulkan/Shader/VKShader.h index ab3981dd15..06a14b2ca4 100644 --- a/sources/Renderer/Vulkan/Shader/VKShader.h +++ b/sources/Renderer/Vulkan/Shader/VKShader.h @@ -36,13 +36,12 @@ class VKShader final : public Shader public: - // Function interface which returns a binding slot ierator to re-assign bindings slots for a permuation of the SPIR-V module. - using PermutationBindingFunc = std::function& iter, std::uint32_t& dstSet)>; + #include public: - const Report* GetReport() const override; - bool Reflect(ShaderReflection& reflection) const override; + // Function interface which returns a binding slot ierator to re-assign bindings slots for a permuation of the SPIR-V module. + using PermutationBindingFunc = std::function& iter, std::uint32_t& dstSet)>; public: diff --git a/sources/Renderer/Vulkan/Texture/VKRenderTarget.h b/sources/Renderer/Vulkan/Texture/VKRenderTarget.h index ab9c9d2979..b2b8426969 100644 --- a/sources/Renderer/Vulkan/Texture/VKRenderTarget.h +++ b/sources/Renderer/Vulkan/Texture/VKRenderTarget.h @@ -27,6 +27,10 @@ class VKTexture; class VKRenderTarget final : public RenderTarget { + public: + + #include + public: VKRenderTarget( @@ -35,15 +39,6 @@ class VKRenderTarget final : public RenderTarget const RenderTargetDescriptor& desc ); - Extent2D GetResolution() const override; - std::uint32_t GetSamples() const override; - std::uint32_t GetNumColorAttachments() const override; - - bool HasDepthAttachment() const override; - bool HasStencilAttachment() const override; - - const RenderPass* GetRenderPass() const override; - public: // Returns true if this render target has multi-sampling enabled. diff --git a/sources/Renderer/Vulkan/Texture/VKTexture.h b/sources/Renderer/Vulkan/Texture/VKTexture.h index 406bb8eb80..15fb15ab38 100644 --- a/sources/Renderer/Vulkan/Texture/VKTexture.h +++ b/sources/Renderer/Vulkan/Texture/VKTexture.h @@ -26,6 +26,10 @@ class VKDeviceMemoryManager; class VKTexture final : public Texture { + public: + + #include + public: VKTexture( @@ -34,14 +38,6 @@ class VKTexture final : public Texture const TextureDescriptor& desc ); - Extent3D GetMipExtent(std::uint32_t mipLevel) const override; - - TextureDescriptor GetDesc() const override; - - Format GetFormat() const override; - - SubresourceFootprint GetSubresourceFootprint(std::uint32_t mipLevel) const override; - public: // Creates an additional texture view of the specified texture range and uses the same format as this texture object. diff --git a/sources/Renderer/Vulkan/VKCommandQueue.h b/sources/Renderer/Vulkan/VKCommandQueue.h index 5b459201ba..ef17ad78ec 100644 --- a/sources/Renderer/Vulkan/VKCommandQueue.h +++ b/sources/Renderer/Vulkan/VKCommandQueue.h @@ -30,24 +30,11 @@ class VKCommandQueue final : public CommandQueue public: - /* ----- Common ----- */ + #include - VKCommandQueue(VkDevice device, VkQueue queue); - - /* ----- Command Buffers ----- */ - - void Submit(CommandBuffer& commandBuffer) override; - - /* ----- Queries ----- */ - - bool QueryResult(QueryHeap& queryHeap, std::uint32_t firstQuery, std::uint32_t numQueries, void* data, std::size_t dataSize) override; - - /* ----- Fences ----- */ - - void Submit(Fence& fence) override; + public: - bool WaitFence(Fence& fence, std::uint64_t timeout) override; - void WaitIdle() override; + VKCommandQueue(VkDevice device, VkQueue queue); private: diff --git a/sources/Renderer/Vulkan/VKRenderSystem.h b/sources/Renderer/Vulkan/VKRenderSystem.h index e5efdbbbb4..7c2c0df8d2 100644 --- a/sources/Renderer/Vulkan/VKRenderSystem.h +++ b/sources/Renderer/Vulkan/VKRenderSystem.h @@ -51,109 +51,13 @@ class VKRenderSystem final : public RenderSystem public: - /* ----- Common ----- */ + #include + + public: VKRenderSystem(const RenderSystemDescriptor& renderSystemDesc); ~VKRenderSystem(); - /* ----- Swap-chain ----- */ - - SwapChain* CreateSwapChain(const SwapChainDescriptor& swapChainDesc, const std::shared_ptr& surface = nullptr) override; - - void Release(SwapChain& swapChain) override; - - /* ----- Command queues ----- */ - - CommandQueue* GetCommandQueue() override; - - /* ----- Command buffers ----- */ - - CommandBuffer* CreateCommandBuffer(const CommandBufferDescriptor& commandBufferDesc = {}) override; - - void Release(CommandBuffer& commandBuffer) override; - - /* ----- Buffers ------ */ - - Buffer* CreateBuffer(const BufferDescriptor& bufferDesc, const void* initialData = nullptr) override; - BufferArray* CreateBufferArray(std::uint32_t numBuffers, Buffer* const * bufferArray) override; - - void Release(Buffer& buffer) override; - void Release(BufferArray& bufferArray) override; - - void WriteBuffer(Buffer& buffer, std::uint64_t offset, const void* data, std::uint64_t dataSize) override; - void ReadBuffer(Buffer& buffer, std::uint64_t offset, void* data, std::uint64_t dataSize) override; - - void* MapBuffer(Buffer& buffer, const CPUAccess access) override; - void* MapBuffer(Buffer& buffer, const CPUAccess access, std::uint64_t offset, std::uint64_t length) override; - void UnmapBuffer(Buffer& buffer) override; - - /* ----- Textures ----- */ - - Texture* CreateTexture(const TextureDescriptor& textureDesc, const SrcImageDescriptor* imageDesc = nullptr) override; - - void Release(Texture& texture) override; - - void WriteTexture(Texture& texture, const TextureRegion& textureRegion, const SrcImageDescriptor& imageDesc) override; - void ReadTexture(Texture& texture, const TextureRegion& textureRegion, const DstImageDescriptor& imageDesc) override; - - /* ----- Sampler States ---- */ - - Sampler* CreateSampler(const SamplerDescriptor& samplerDesc) override; - - void Release(Sampler& sampler) override; - - /* ----- Resource Heaps ----- */ - - ResourceHeap* CreateResourceHeap(const ResourceHeapDescriptor& resourceHeapDesc, const ArrayView& initialResourceViews = {}) override; - - void Release(ResourceHeap& resourceHeap) override; - - std::uint32_t WriteResourceHeap(ResourceHeap& resourceHeap, std::uint32_t firstDescriptor, const ArrayView& resourceViews) override; - - /* ----- Render Passes ----- */ - - RenderPass* CreateRenderPass(const RenderPassDescriptor& renderPassDesc) override; - - void Release(RenderPass& renderPass) override; - - /* ----- Render Targets ----- */ - - RenderTarget* CreateRenderTarget(const RenderTargetDescriptor& renderTargetDesc) override; - - void Release(RenderTarget& renderTarget) override; - - /* ----- Shader ----- */ - - Shader* CreateShader(const ShaderDescriptor& shaderDesc) override; - - void Release(Shader& shader) override; - - /* ----- Pipeline Layouts ----- */ - - PipelineLayout* CreatePipelineLayout(const PipelineLayoutDescriptor& pipelineLayoutDesc) override; - - void Release(PipelineLayout& pipelineLayout) override; - - /* ----- Pipeline States ----- */ - - PipelineState* CreatePipelineState(const Blob& serializedCache) override; - PipelineState* CreatePipelineState(const GraphicsPipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - PipelineState* CreatePipelineState(const ComputePipelineDescriptor& pipelineStateDesc, Blob* serializedCache = nullptr) override; - - void Release(PipelineState& pipelineState) override; - - /* ----- Queries ----- */ - - QueryHeap* CreateQueryHeap(const QueryHeapDescriptor& queryHeapDesc) override; - - void Release(QueryHeap& queryHeap) override; - - /* ----- Fences ----- */ - - Fence* CreateFence() override; - - void Release(Fence& fence) override; - private: void CreateInstance(const RendererConfigurationVulkan* config);