From bde6f5eed1cec3639e5c81d1e5ee34ecf3fe7486 Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 24 Jun 2021 10:58:36 -0300 Subject: Implement Framebuffer Subpass support * Required for better optimizing mobile platforms * Will be used by the Vulkan mobile renderer. --- servers/rendering/rendering_device_binds.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'servers/rendering/rendering_device_binds.h') diff --git a/servers/rendering/rendering_device_binds.h b/servers/rendering/rendering_device_binds.h index 912674e309..dc59568ce9 100644 --- a/servers/rendering/rendering_device_binds.h +++ b/servers/rendering/rendering_device_binds.h @@ -128,6 +128,34 @@ protected: } }; +class RDFramebufferPass : public RefCounted { + GDCLASS(RDFramebufferPass, RefCounted) + friend class RenderingDevice; + + RD::FramebufferPass base; + +public: + RD_SETGET(PackedInt32Array, color_attachments) + RD_SETGET(PackedInt32Array, input_attachments) + RD_SETGET(PackedInt32Array, resolve_attachments) + RD_SETGET(PackedInt32Array, preserve_attachments) + RD_SETGET(int32_t, depth_attachment) +protected: + enum { + ATTACHMENT_UNUSED = -1 + }; + + static void _bind_methods() { + RD_BIND(Variant::PACKED_INT32_ARRAY, RDFramebufferPass, color_attachments); + RD_BIND(Variant::PACKED_INT32_ARRAY, RDFramebufferPass, input_attachments); + RD_BIND(Variant::PACKED_INT32_ARRAY, RDFramebufferPass, resolve_attachments); + RD_BIND(Variant::PACKED_INT32_ARRAY, RDFramebufferPass, preserve_attachments); + RD_BIND(Variant::INT, RDFramebufferPass, depth_attachment); + + BIND_CONSTANT(ATTACHMENT_UNUSED); + } +}; + class RDSamplerState : public RefCounted { GDCLASS(RDSamplerState, RefCounted) friend class RenderingDevice; -- cgit v1.2.3