]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/renderpass.h
Refactor render pass operations into a helper struct
[libs/gl.git] / source / backends / vulkan / renderpass.h
diff --git a/source/backends/vulkan/renderpass.h b/source/backends/vulkan/renderpass.h
new file mode 100644 (file)
index 0000000..e59dc16
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef MSP_GL_RENDERPASS_H_
+#define MSP_GL_RENDERPASS_H_
+
+#include <vector>
+#include "handles.h"
+
+namespace Msp {
+namespace GL {
+
+class Device;
+class Framebuffer;
+union ClearValue;
+
+struct RenderPass
+{
+       const Framebuffer *framebuffer = 0;
+       Rect render_area;
+       bool clear = false;
+       const ClearValue *clear_values = 0;
+       bool to_present = false;
+       bool discard_fb_contents = false;
+       VkRenderPass handle = 0;
+
+       void update(Device &);
+
+       std::uint64_t compute_hash() const;
+       bool discards_framebuffer_contents() const;
+       void fill_creation_info(std::vector<char> &) const;
+       void fill_begin_info(std::vector<char> &) const;
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif