mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix Vulkan shadow shader descriptor set mismatch
This commit is contained in:
parent
57b049fb2a
commit
9d647e5622
2 changed files with 4 additions and 19 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue