RHI: Implement CreateRenderPass/CreateFramebuffer in D3D12 and OpenGL backends
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLTextureUnitAllocator.h"
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLUniformBufferManager.h"
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLFramebuffer.h"
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLRenderPass.h"
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLResourceView.h"
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLDescriptorPool.h"
|
||||
#include "XCEngine/RHI/OpenGL/OpenGLDescriptorSet.h"
|
||||
@@ -418,6 +419,32 @@ RHISampler* OpenGLDevice::CreateSampler(const SamplerDesc& desc) {
|
||||
return sampler;
|
||||
}
|
||||
|
||||
RHIRenderPass* OpenGLDevice::CreateRenderPass(
|
||||
uint32_t colorAttachmentCount,
|
||||
const AttachmentDesc* colorAttachments,
|
||||
const AttachmentDesc* depthStencilAttachment) {
|
||||
auto* renderPass = new OpenGLRenderPass();
|
||||
if (!renderPass->Initialize(colorAttachmentCount, colorAttachments, depthStencilAttachment)) {
|
||||
delete renderPass;
|
||||
return nullptr;
|
||||
}
|
||||
return renderPass;
|
||||
}
|
||||
|
||||
RHIFramebuffer* OpenGLDevice::CreateFramebuffer(
|
||||
class RHIRenderPass* renderPass,
|
||||
uint32_t width, uint32_t height,
|
||||
uint32_t colorAttachmentCount,
|
||||
RHIResourceView** colorAttachments,
|
||||
RHIResourceView* depthStencilAttachment) {
|
||||
auto* framebuffer = new OpenGLFramebuffer();
|
||||
if (!framebuffer->Initialize(renderPass, width, height, colorAttachmentCount, colorAttachments, depthStencilAttachment)) {
|
||||
delete framebuffer;
|
||||
return nullptr;
|
||||
}
|
||||
return framebuffer;
|
||||
}
|
||||
|
||||
RHIDescriptorPool* OpenGLDevice::CreateDescriptorPool(const DescriptorPoolDesc& desc) {
|
||||
auto* pool = new OpenGLDescriptorPool();
|
||||
if (pool->Initialize(desc)) {
|
||||
|
||||
Reference in New Issue
Block a user