summaryrefslogtreecommitdiff
path: root/servers/rendering/rendering_device.h
diff options
context:
space:
mode:
authorjfons <joan.fonssanchez@gmail.com>2022-02-17 10:56:22 +0100
committerjfons <joan.fonssanchez@gmail.com>2022-04-01 12:12:49 +0200
commite69d762dd0c6b74cb0e25f38c5da2cc4068ea62b (patch)
tree5980e751ab0519ecc2243bcf074d9da813a6f93c /servers/rendering/rendering_device.h
parent4263f02f28af79324667674ad4f2ededddf19047 (diff)
Add color pass flags to Forward Clustered renderer
This commit removes a lot of enum values related to the color render pass in favor of a new flag-bases approach. This means instead of hard-coding all the possible option combinations into enums, we can write our logic by checking a bit-mask. The changes in rendering_device_vulkan.cpp add support for unused attachments. That means RenderingDeviceVulkan::framebuffer_create() can take null RIDs in the attachments vector, which will result in VK_ATTACHMENT_UNUSED entries in the render pass. This is used in this same PR to establish fixed locations for the color pass attachments (only color and separate specular so far, but TAA will add motion vectors as well). This way the attachment locations in the shader can stay the same regardless of which attachments are actually used. Right now all the combinations of flags are generated, but we will need to add a way to limit the amount of combinations in the future.
Diffstat (limited to 'servers/rendering/rendering_device.h')
-rw-r--r--servers/rendering/rendering_device.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h
index ecbb11efca..1902b5f74a 100644
--- a/servers/rendering/rendering_device.h
+++ b/servers/rendering/rendering_device.h
@@ -528,6 +528,7 @@ public:
/*********************/
struct AttachmentFormat {
+ enum { UNUSED_ATTACHMENT = 0xFFFFFFFF };
DataFormat format;
TextureSamples samples;
uint32_t usage_flags;