From 32963fce07aaa2156120eafb1a21c8b8b77f3a40 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Wed, 6 Nov 2024 16:37:48 -0700 Subject: [PATCH] Fixed linux run --- client/shader/hex.vert | 5 +++++ client/src/hex.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/shader/hex.vert b/client/shader/hex.vert index 036886d..e8cfdd2 100644 --- a/client/shader/hex.vert +++ b/client/shader/hex.vert @@ -1,5 +1,6 @@ #version 450 #extension GL_EXT_buffer_reference : require +#extension GL_EXT_buffer_reference_uvec2 : require #include "hex_common.glsl" @@ -16,6 +17,10 @@ vec4 int2color(uint color_int) { void main() { int region_index = gl_InstanceIndex/region_hex_count; Region region = pc.context.regions[region_index]; + if(uvec2(region) == uvec2(0)) { + gl_Position = vec4(0, 0, 0, 0); + return; + } if(region.map != pc.context.current_map) { gl_Position = vec4(0, 0, 0, 0); return; diff --git a/client/src/hex.c b/client/src/hex.c index fd1fa3d..72b9392 100644 --- a/client/src/hex.c +++ b/client/src/hex.c @@ -2,6 +2,7 @@ #include "gpu.h" #include "vulkan/vulkan_core.h" #include +#include VkResult create_ray_pipeline( RenderContext* gpu, @@ -498,7 +499,7 @@ VkResult set_hex_region(int32_t q, int32_t r, int32_t y, uint32_t map, HexRegion uint32_t i = 0; for(; i < MAX_LOADED_REGIONS; i++) { if(hex->regions[i] == NULL) { - hex->regions[i] = malloc(sizeof(GPUHexRegion)); + hex->regions[i] = malloc(sizeof(HexRegion)); *region = hex->regions[i]; break; }