summaryrefslogtreecommitdiff
path: root/src/renderer/backends/backend_vulkan.h
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-11 22:06:55 +1000
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-11 22:06:55 +1000
commit677ab09b0dc3b6d9c872b732f8e31543fa2d11bb (patch)
treef8aa923eb9d97c561341579fa4e575e4804ad9f4 /src/renderer/backends/backend_vulkan.h
parent08d7e23fd5ed95953822a72ba11d4b6cd96b2846 (diff)
WIP: shader data
Diffstat (limited to 'src/renderer/backends/backend_vulkan.h')
-rw-r--r--src/renderer/backends/backend_vulkan.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/renderer/backends/backend_vulkan.h b/src/renderer/backends/backend_vulkan.h
index 0b0a492..7bdf821 100644
--- a/src/renderer/backends/backend_vulkan.h
+++ b/src/renderer/backends/backend_vulkan.h
@@ -7,6 +7,7 @@
#include "ral.h"
// #include "vulkan_helpers.h"
+#define MAX_FRAMES_IN_FLIGHT 2
#define GPU_SWAPCHAIN_IMG_COUNT 2
/*
@@ -59,9 +60,26 @@ typedef struct gpu_pipeline_layout {
VkPipelineLayout handle;
} gpu_pipeline_layout;
+typedef struct desc_set_uniform_buffer {
+ VkBuffer buffers[MAX_FRAMES_IN_FLIGHT];
+ VkDeviceMemory uniform_buf_memorys[MAX_FRAMES_IN_FLIGHT];
+ void* uniform_buf_mem_mappings[MAX_FRAMES_IN_FLIGHT];
+ size_t size;
+} desc_set_uniform_buffer;
+
typedef struct gpu_pipeline {
VkPipeline handle;
VkPipelineLayout layout_handle;
+
+ // Descriptor gubbins
+ shader_data data_layouts[MAX_SHADER_DATA_LAYOUTS];
+ u32 data_layouts_count;
+
+ VkDescriptorSetLayout* desc_set_layouts;
+ // Based on group, we know which data to load
+ desc_set_uniform_buffer* uniform_pointers;
+ u32 desc_set_layouts_count;
+
} gpu_pipeline;
typedef struct gpu_renderpass {
@@ -71,6 +89,8 @@ typedef struct gpu_renderpass {
typedef struct gpu_cmd_encoder {
VkCommandBuffer cmd_buffer;
+ VkDescriptorPool descriptor_pool;
+ gpu_pipeline* pipeline;
} gpu_cmd_encoder;
typedef struct gpu_cmd_buffer {
@@ -82,3 +102,4 @@ typedef struct gpu_buffer {
VkDeviceMemory memory;
u64 size;
} gpu_buffer;
+