From 2a733f3d513a7279c1df4efe88fc5386ced2ed14 Mon Sep 17 00:00:00 2001 From: kartofen Date: Fri, 10 Nov 2023 21:30:33 +0200 Subject: uniform buffer added --- src/graphics.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/graphics.h') diff --git a/src/graphics.h b/src/graphics.h index 71a8889..ff03e12 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -39,6 +39,7 @@ typedef struct graphics { struct pipeline { VkRenderPass render_pass; + VkDescriptorSetLayout descriptor_layout; // VkDescriptorSetLayout *descriptor_layouts; VkPipelineLayout layout; VkPipeline pipeline; } pipeline; @@ -60,6 +61,12 @@ typedef struct graphics { VkCommandBuffer buffer; } command_graphics, command_transfer; + struct descriptor { + VkDescriptorPool pool; + VkDescriptorSetLayout layout; + VkDescriptorSet set; + } ubo_descriptor; + struct sync { VkSemaphore semph_image_available; VkSemaphore semph_render_finished; @@ -69,6 +76,12 @@ typedef struct graphics { buffer_t vertex_buffer; buffer_t index_buffer; + struct { + buffer_t buffer; + void *mapped_data; + int (*update_ubo)(void *ubo); + } ubo; + } * graphics_t; struct graphics_info { @@ -83,6 +96,9 @@ struct graphics_info { u32 *indices; size_t nindices; + size_t ubo_size; + int (*update_ubo)(void *ubo); + int (*surface_func)(VkInstance instance, VkSurfaceKHR *surface); }; -- cgit v1.2.3