mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +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
|
#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 useBones;
|
||||||
int useTexture;
|
int useTexture;
|
||||||
int alphaTest;
|
int alphaTest;
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,7 @@ layout(push_constant) uniform Push {
|
||||||
mat4 model;
|
mat4 model;
|
||||||
} push;
|
} push;
|
||||||
|
|
||||||
layout(set = 2, binding = 0) readonly buffer BoneSSBO {
|
layout(set = 0, binding = 1) uniform ShadowParams {
|
||||||
mat4 bones[];
|
|
||||||
};
|
|
||||||
|
|
||||||
layout(set = 1, binding = 1) uniform ShadowParams {
|
|
||||||
int useBones;
|
int useBones;
|
||||||
int useTexture;
|
int useTexture;
|
||||||
int alphaTest;
|
int alphaTest;
|
||||||
|
|
@ -27,18 +23,7 @@ layout(location = 0) out vec2 TexCoord;
|
||||||
layout(location = 1) out vec3 WorldPos;
|
layout(location = 1) out vec3 WorldPos;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 pos = vec4(aPos, 1.0);
|
vec4 worldPos = push.model * 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;
|
|
||||||
WorldPos = worldPos.xyz;
|
WorldPos = worldPos.xyz;
|
||||||
TexCoord = aTexCoord;
|
TexCoord = aTexCoord;
|
||||||
gl_Position = push.lightSpaceMatrix * worldPos;
|
gl_Position = push.lightSpaceMatrix * worldPos;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue