diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2024-05-21 11:56:12 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2024-05-21 11:56:12 +0300 |
commit | b04db611ed0eb7ec9e1b7d988f3031fe63a1de52 (patch) | |
tree | 91be243faa9c06f22379e8e774b14463b285a47b /src/state.h | |
parent | 7c26dcc4480025b5d11e315273541b3fb2c34a09 (diff) | |
download | cgame-b04db611ed0eb7ec9e1b7d988f3031fe63a1de52.tar.gz cgame-b04db611ed0eb7ec9e1b7d988f3031fe63a1de52.tar.bz2 cgame-b04db611ed0eb7ec9e1b7d988f3031fe63a1de52.zip |
hot reload shaders bby
Diffstat (limited to 'src/state.h')
-rw-r--r-- | src/state.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/state.h b/src/state.h index 3890694..17be1c0 100644 --- a/src/state.h +++ b/src/state.h @@ -1,7 +1,10 @@ #include <SDL2/SDL.h> +#include <vulkan/vulkan.h> +#include <shaderc/shaderc.h> + +#define CGLM_FORCE_DEPTH_ZERO_TO_ONE #include "../lib/cglm/include/cglm/cglm.h" -#include <vulkan/vulkan.h> #pragma once @@ -22,6 +25,7 @@ typedef struct { mat4 model; mat4 view; mat4 proj; + vec2 resolution; } UniformBufferObject; typedef struct { @@ -98,6 +102,9 @@ typedef struct state { VkDeviceMemory vk_index_buffer_memory; VkDescriptorPool vk_descriptor_pool; + + shaderc_compilation_result_t prev_vert_result; + shaderc_compilation_result_t prev_frag_result; } state_t ; static void @@ -144,4 +151,7 @@ init_state(state_t * s) s->vk_physical_device = VK_NULL_HANDLE; s->vk_swap_chain_framebuffers_count = 0; + + s->prev_vert_result = NULL; + s->prev_frag_result = NULL; } |