Fix the clear screen shader bug

Fix texture set layout not matching the c++ code's version (vulkan validation error)
This commit is contained in:
Magnus Norddahl 2023-04-06 21:03:05 +02:00 committed by Christoph Oelckers
parent 162ebe0f18
commit 11ca6bb067
2 changed files with 2 additions and 1 deletions

View file

@ -17,8 +17,10 @@ void main()
float gray = grayscale(frag); float gray = grayscale(frag);
vec4 cm = (uObjectColor + gray * (uAddColor - uObjectColor)) * 2; vec4 cm = (uObjectColor + gray * (uAddColor - uObjectColor)) * 2;
frag = vec4(clamp(cm.rgb, 0.0, 1.0), frag.a); frag = vec4(clamp(cm.rgb, 0.0, 1.0), frag.a);
frag *= vColor;
frag.rgb = frag.rgb + uFogColor.rgb; frag.rgb = frag.rgb + uFogColor.rgb;
#else #else
frag *= vColor;
frag.rgb = frag.rgb + uFogColor.rgb; frag.rgb = frag.rgb + uFogColor.rgb;
#endif #endif
#else #else

View file

@ -95,7 +95,6 @@ layout(set = 2, binding = 7) uniform sampler2D texture8;
layout(set = 2, binding = 8) uniform sampler2D texture9; layout(set = 2, binding = 8) uniform sampler2D texture9;
layout(set = 2, binding = 9) uniform sampler2D texture10; layout(set = 2, binding = 9) uniform sampler2D texture10;
layout(set = 2, binding = 10) uniform sampler2D texture11; layout(set = 2, binding = 10) uniform sampler2D texture11;
layout(set = 2, binding = 11) uniform sampler2D texture12;
// This must match the PushConstants struct // This must match the PushConstants struct
layout(push_constant) uniform PushConstants layout(push_constant) uniform PushConstants