RHI: Add CreateRenderPass/CreateFramebuffer to RHIDevice interface

This commit is contained in:
2026-03-25 13:02:57 +08:00
parent cad6f586fb
commit 2313124cc5
4 changed files with 39 additions and 2 deletions

View File

@@ -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;

View File

@@ -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; }

View File

@@ -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;

View File

@@ -4,6 +4,8 @@
#include "RHICapabilities.h"
#include "RHIDescriptorPool.h"
#include "RHIDescriptorSet.h"
#include "RHIRenderPass.h"
#include "RHIFramebuffer.h"
#include <string>
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;