diff --git a/engine/include/XCEngine/RHI/D3D12/D3D12Device.h b/engine/include/XCEngine/RHI/D3D12/D3D12Device.h index 0ce3cdc6..e35081a0 100644 --- a/engine/include/XCEngine/RHI/D3D12/D3D12Device.h +++ b/engine/include/XCEngine/RHI/D3D12/D3D12Device.h @@ -74,6 +74,17 @@ public: RHIFence* CreateFence(const FenceDesc& desc) override; RHISampler* CreateSampler(const SamplerDesc& desc) override; + RHIRenderPass* CreateRenderPass( + uint32_t colorAttachmentCount, + const AttachmentDesc* colorAttachments, + const AttachmentDesc* depthStencilAttachment) override; + RHIFramebuffer* CreateFramebuffer( + class RHIRenderPass* renderPass, + uint32_t width, uint32_t height, + uint32_t colorAttachmentCount, + RHIResourceView** colorAttachments, + RHIResourceView* depthStencilAttachment) override; + RHIDescriptorPool* CreateDescriptorPool(const DescriptorPoolDesc& desc) override; RHIDescriptorSet* CreateDescriptorSet(RHIDescriptorPool* pool, const DescriptorSetLayoutDesc& layout) override; diff --git a/engine/include/XCEngine/RHI/D3D12/D3D12Framebuffer.h b/engine/include/XCEngine/RHI/D3D12/D3D12Framebuffer.h index c2209a3e..af2f37b3 100644 --- a/engine/include/XCEngine/RHI/D3D12/D3D12Framebuffer.h +++ b/engine/include/XCEngine/RHI/D3D12/D3D12Framebuffer.h @@ -23,9 +23,9 @@ public: void Shutdown() override; - bool Initialize(D3D12RenderPass* renderPass, uint32_t width, uint32_t height, + bool Initialize(class RHIRenderPass* renderPass, uint32_t width, uint32_t height, uint32_t colorAttachmentCount, RHIResourceView** colorAttachments, - RHIResourceView* depthStencilAttachment); + RHIResourceView* depthStencilAttachment) override; void* GetNativeHandle() override { return nullptr; } uint32_t GetWidth() const override { return m_width; } diff --git a/engine/include/XCEngine/RHI/OpenGL/OpenGLDevice.h b/engine/include/XCEngine/RHI/OpenGL/OpenGLDevice.h index 57c6b4a6..fdca9591 100644 --- a/engine/include/XCEngine/RHI/OpenGL/OpenGLDevice.h +++ b/engine/include/XCEngine/RHI/OpenGL/OpenGLDevice.h @@ -45,6 +45,17 @@ public: RHIFence* CreateFence(const FenceDesc& desc) override; RHISampler* CreateSampler(const SamplerDesc& desc) override; + RHIRenderPass* CreateRenderPass( + uint32_t colorAttachmentCount, + const AttachmentDesc* colorAttachments, + const AttachmentDesc* depthStencilAttachment) override; + RHIFramebuffer* CreateFramebuffer( + class RHIRenderPass* renderPass, + uint32_t width, uint32_t height, + uint32_t colorAttachmentCount, + RHIResourceView** colorAttachments, + RHIResourceView* depthStencilAttachment) override; + RHIDescriptorPool* CreateDescriptorPool(const DescriptorPoolDesc& desc) override; RHIDescriptorSet* CreateDescriptorSet(RHIDescriptorPool* pool, const DescriptorSetLayoutDesc& layout) override; diff --git a/engine/include/XCEngine/RHI/RHIDevice.h b/engine/include/XCEngine/RHI/RHIDevice.h index 45159d93..e65ac914 100644 --- a/engine/include/XCEngine/RHI/RHIDevice.h +++ b/engine/include/XCEngine/RHI/RHIDevice.h @@ -4,6 +4,8 @@ #include "RHICapabilities.h" #include "RHIDescriptorPool.h" #include "RHIDescriptorSet.h" +#include "RHIRenderPass.h" +#include "RHIFramebuffer.h" #include namespace XCEngine { @@ -20,6 +22,8 @@ class RHIPipelineLayout; class RHIFence; class RHISampler; class RHIResourceView; +class RHIRenderPass; +class RHIFramebuffer; class RHIDevice { public: @@ -39,6 +43,17 @@ public: virtual RHIFence* CreateFence(const FenceDesc& desc) = 0; virtual RHISampler* CreateSampler(const SamplerDesc& desc) = 0; + virtual RHIRenderPass* CreateRenderPass( + uint32_t colorAttachmentCount, + const AttachmentDesc* colorAttachments, + const AttachmentDesc* depthStencilAttachment) = 0; + virtual RHIFramebuffer* CreateFramebuffer( + class RHIRenderPass* renderPass, + uint32_t width, uint32_t height, + uint32_t colorAttachmentCount, + RHIResourceView** colorAttachments, + RHIResourceView* depthStencilAttachment) = 0; + virtual RHIDescriptorPool* CreateDescriptorPool(const DescriptorPoolDesc& desc) = 0; virtual RHIDescriptorSet* CreateDescriptorSet(RHIDescriptorPool* pool, const DescriptorSetLayoutDesc& layout) = 0;