Fix Vulkan shadow shader descriptor set mismatch

This commit is contained in:
Kelsi 2026-02-22 06:28:18 -08:00
parent 57b049fb2a
commit 9d647e5622
2 changed files with 4 additions and 19 deletions

View file

@ -1,8 +1,8 @@
#version 450
layout(set = 1, binding = 0) uniform sampler2D uTexture;
layout(set = 0, binding = 0) uniform sampler2D uTexture;
layout(set = 1, binding = 1) uniform ShadowParams {
layout(set = 0, binding = 1) uniform ShadowParams {
int useBones;
int useTexture;
int alphaTest;

View file

@ -5,11 +5,7 @@ layout(push_constant) uniform Push {
mat4 model;
} push;
layout(set = 2, binding = 0) readonly buffer BoneSSBO {
mat4 bones[];
};
layout(set = 1, binding = 1) uniform ShadowParams {
layout(set = 0, binding = 1) uniform ShadowParams {
int useBones;
int useTexture;
int alphaTest;
@ -27,18 +23,7 @@ layout(location = 0) out vec2 TexCoord;
layout(location = 1) out vec3 WorldPos;
void main() {
vec4 pos = vec4(aPos, 1.0);
if (useBones != 0) {
ivec4 bi = ivec4(aBoneIndicesF);
mat4 skinMat = bones[bi.x] * aBoneWeights.x
+ bones[bi.y] * aBoneWeights.y
+ bones[bi.z] * aBoneWeights.z
+ bones[bi.w] * aBoneWeights.w;
pos = skinMat * pos;
}
vec4 worldPos = push.model * pos;
vec4 worldPos = push.model * vec4(aPos, 1.0);
WorldPos = worldPos.xyz;
TexCoord = aTexCoord;
gl_Position = push.lightSpaceMatrix * worldPos;