From 1aaf5a53b8a161370607e88639b609cd34a27592 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Wed, 1 Oct 2025 15:48:35 +0100 Subject: [PATCH] Add input bindings for bone indices and weights --- gpu.c | 12 ++++++++++++ vert.glsl | 2 ++ 2 files changed, 14 insertions(+) diff --git a/gpu.c b/gpu.c index 8e25373..646fc9a 100644 --- a/gpu.c +++ b/gpu.c @@ -501,6 +501,18 @@ void gpu_init(gpu_ctx_t *ctx, const gpu_config_t *config, model_t model) .format = VK_FORMAT_R32G32B32_SFLOAT, .offset = offsetof(vertex_t, normal), }, + { + .binding = 0, + .location = 2, + .format = VK_FORMAT_R16G16B16A16_UINT, + .offset = offsetof(vertex_t, bones), + }, + { + .binding = 0, + .location = 3, + .format = VK_FORMAT_R32G32B32A32_SFLOAT, + .offset = offsetof(vertex_t, weights), + }, }; const VkPipelineVertexInputStateCreateInfo vertex_input_config = { .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, diff --git a/vert.glsl b/vert.glsl index 60496e3..56e63a4 100644 --- a/vert.glsl +++ b/vert.glsl @@ -2,6 +2,8 @@ layout(location = 0) in vec3 position; layout(location = 1) in vec3 normal; +layout(location = 2) in uvec4 bone_indices; +layout(location = 3) in vec4 weights; layout(location = 0) out vec3 frag_normal;