Made navmesh compile on Windows

Small updates to remove warnings
Testing nonuniform descriptor access in shader
This commit is contained in:
2025-10-05 01:31:39 +01:00
parent 175f4da59b
commit 2c67896cf2
9 changed files with 22533 additions and 22521 deletions

View File

@@ -180,6 +180,7 @@ bool Vk_Setup(SDL_Window *window) {
features12.storageBuffer8BitAccess = VK_TRUE;
features12.uniformAndStorageBuffer8BitAccess = VK_TRUE;
features12.descriptorIndexing = VK_TRUE;
features12.runtimeDescriptorArray = VK_TRUE;
// @Todo: we will probably need to enable some of the 'nonuniform' indexing features

View File

@@ -1,12 +1,15 @@
#version 460 core
#extension GL_EXT_nonuniform_qualifier : enable
layout(location = 0) in vec2 frag_uv;
layout(location = 1) in vec4 frag_c;
layout(location = 2) in flat uint idx;
layout(location = 0) out vec4 framebuffer;
layout(binding = 1) uniform sampler2D u_image;
layout(binding = 1) uniform sampler2D u_image[];
void main() {
framebuffer = frag_c * texture(u_image, frag_uv);
framebuffer = frag_c * texture(u_image[idx], frag_uv);
}

View File

@@ -16,6 +16,7 @@ readonly buffer Vertices {
layout(location = 0) out vec2 frag_uv;
layout(location = 1) out vec4 frag_c;
layout(location = 2) out flat uint idx;
void main() {
Vertex v = vtx[gl_VertexIndex];
@@ -25,4 +26,6 @@ void main() {
frag_uv = v.uv;
frag_c = vec4((v.c >> 24) & 0xFF, (v.c >> 16) & 0xFF, (v.c >> 8) & 0xFF, (v.c >> 0) & 0xFF) / 255.0f;
frag_c = frag_c.abgr;
idx = v.pad;
}