42 struct RenderPassInfo {
43 uint64_t colorAttachment;
45 uint64_t depthAttachment;
49 struct RenderPassInfoCompare {
50 bool operator()(
const RenderPassInfo& a,
const RenderPassInfo& b)
const {
51 if (a.colorAttachment != b.colorAttachment) {
52 return a.colorAttachment < b.colorAttachment;
55 if (a.colorLoadOperation != b.colorLoadOperation) {
56 return a.colorLoadOperation < b.colorLoadOperation;
59 if (a.depthAttachment != b.depthAttachment) {
60 return a.depthAttachment < b.depthAttachment;
63 return a.depthLoadOperation < b.depthLoadOperation;
67 std::map<RenderPassInfo, RenderPass*, RenderPassInfoCompare> renderPasses;
69 struct AttachmentlessRenderPassInfo {
74 struct AttachmentlessRenderPassInfoCompare {
75 bool operator()(
const AttachmentlessRenderPassInfo& a,
const AttachmentlessRenderPassInfo& b)
const {
76 if (a.size.x != b.size.x) {
77 return a.size.x < b.size.x;
80 if (a.size.y != b.size.y) {
81 return a.size.y < b.size.y;
84 return a.msaaSamples < b.msaaSamples;
88 std::map<AttachmentlessRenderPassInfo, RenderPass*, AttachmentlessRenderPassInfoCompare> attachmentlessRenderPasses;
91 virtual RenderPass* AllocateAttachmentlessRenderPass(
const glm::uvec2& size, uint32_t msaaSamples) = 0;
Responsible for allocating render passes and framebuffers.
Definition: RenderPassAllocator.hpp:11
RenderPass * CreateAttachmentlessRenderPass(const glm::uvec2 &size, uint32_t msaaSamples)
Create an attachmentless render pass.
Definition: RenderPassAllocator.cpp:43
void FreePasses(const Texture *attachment)
Free all render passes that contain the given attachment.
Definition: RenderPassAllocator.cpp:60
RenderPassAllocator()
Create a new render pass allocator.
Definition: RenderPassAllocator.cpp:8
RenderPass * CreateRenderPass(Texture *colorAttachment, RenderPass::LoadOperation colorLoadOperation, Texture *depthAttachment, RenderPass::LoadOperation depthLoadOperation)
Create a render pass.
Definition: RenderPassAllocator.cpp:22
virtual ~RenderPassAllocator()
Destructor.
Definition: RenderPassAllocator.cpp:12
A render pass.
Definition: RenderPass.hpp:11
LoadOperation
What to do with an image being rendered to before rendering to it.
Definition: RenderPass.hpp:14
A texture.
Definition: Texture.hpp:8
Definition: Editor.hpp:18