Fixed linux run

main
noah metz 2024-11-06 16:37:48 -07:00
parent d2f1f5d5fd
commit 32963fce07
2 changed files with 7 additions and 1 deletions

@ -1,5 +1,6 @@
#version 450 #version 450
#extension GL_EXT_buffer_reference : require #extension GL_EXT_buffer_reference : require
#extension GL_EXT_buffer_reference_uvec2 : require
#include "hex_common.glsl" #include "hex_common.glsl"
@ -16,6 +17,10 @@ vec4 int2color(uint color_int) {
void main() { void main() {
int region_index = gl_InstanceIndex/region_hex_count; int region_index = gl_InstanceIndex/region_hex_count;
Region region = pc.context.regions[region_index]; 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) { if(region.map != pc.context.current_map) {
gl_Position = vec4(0, 0, 0, 0); gl_Position = vec4(0, 0, 0, 0);
return; return;

@ -2,6 +2,7 @@
#include "gpu.h" #include "gpu.h"
#include "vulkan/vulkan_core.h" #include "vulkan/vulkan_core.h"
#include <stdio.h> #include <stdio.h>
#include <string.h>
VkResult create_ray_pipeline( VkResult create_ray_pipeline(
RenderContext* gpu, 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; uint32_t i = 0;
for(; i < MAX_LOADED_REGIONS; i++) { for(; i < MAX_LOADED_REGIONS; i++) {
if(hex->regions[i] == NULL) { if(hex->regions[i] == NULL) {
hex->regions[i] = malloc(sizeof(GPUHexRegion)); hex->regions[i] = malloc(sizeof(HexRegion));
*region = hex->regions[i]; *region = hex->regions[i];
break; break;
} }