New abstractions: - RHIFramebuffer: Framebuffer interface with Initialize/Bind/GetHandle - RHIRenderPass: RenderPass interface with AttachmentDesc for load/store actions - D3D12Framebuffer/D3D12RenderPass: D3D12 implementation - OpenGLFramebuffer/OpenGLRenderPass: OpenGL implementation (adapted from existing) RHICommandList changes: - Added BeginRenderPass(RHIRenderPass*, RHIFramebuffer*, Rect, clearValues...) - Added EndRenderPass() Implementation notes: - D3D12: Uses OMSetRenderTargets + ClearRenderTargetView (fallback from native RenderPass API) - OpenGL: Uses glBindFramebuffer + glClearBufferfv for LoadOp handling - Old SetRenderTargets/ClearRenderTarget retained for backward compatibility All 845 tests pass.
28 lines
725 B
C++
28 lines
725 B
C++
#pragma once
|
|
|
|
#include "RHITypes.h"
|
|
#include "RHIEnums.h"
|
|
#include "RHIResourceView.h"
|
|
#include <cstdint>
|
|
|
|
namespace XCEngine {
|
|
namespace RHI {
|
|
|
|
class RHIFramebuffer {
|
|
public:
|
|
virtual ~RHIFramebuffer() = default;
|
|
|
|
virtual void Shutdown() = 0;
|
|
|
|
virtual bool Initialize(class RHIRenderPass* renderPass, uint32_t width, uint32_t height,
|
|
uint32_t colorAttachmentCount, RHIResourceView** colorAttachments,
|
|
RHIResourceView* depthStencilAttachment) = 0;
|
|
|
|
virtual void* GetNativeHandle() = 0;
|
|
virtual uint32_t GetWidth() const = 0;
|
|
virtual uint32_t GetHeight() const = 0;
|
|
virtual bool IsValid() const = 0;
|
|
};
|
|
|
|
} // namespace RHI
|
|
} // namespace XCEngine
|