From b04db611ed0eb7ec9e1b7d988f3031fe63a1de52 Mon Sep 17 00:00:00 2001 From: gramanas Date: Tue, 21 May 2024 11:56:12 +0300 Subject: hot reload shaders bby --- src/state.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/state.h') 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 +#include +#include + +#define CGLM_FORCE_DEPTH_ZERO_TO_ONE #include "../lib/cglm/include/cglm/cglm.h" -#include #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; } -- cgit v1.2.3