Add input bindings for bone indices and weights
This commit is contained in:
1 parent
998d5e88e1
commit
1aaf5a53b8
2 files changed
+14
No files matched your search
@@ -501,6 +501,18 @@ void gpu_init(gpu_ctx_t *ctx, const gpu_config_t *config, model_t model)
|
|||||||
.format = VK_FORMAT_R32G32B32_SFLOAT,
|
.format = VK_FORMAT_R32G32B32_SFLOAT,
|
||||||
.offset = offsetof(vertex_t, normal),
|
.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 = {
|
const VkPipelineVertexInputStateCreateInfo vertex_input_config = {
|
||||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
layout(location = 0) in vec3 position;
|
layout(location = 0) in vec3 position;
|
||||||
layout(location = 1) in vec3 normal;
|
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;
|
layout(location = 0) out vec3 frag_normal;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user