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; }