nmg-vulkan
nmg-vulkan copied to clipboard
SPIR-V Warning in Font Shader
DEBUG_REPORT: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object: VK_NULL_HANDLE (Type = 0) | SPIR-V module not valid: Structure id 27 decorated as Block must follow standard uniform buffer layout rules: member 1 at offset 12 overlaps previous member ending at offset 15
OpFunctionEnd
Check the disassembly for more details on this. Might be because you're passing a vec2
after a vec3
.
Seems like a typical offset/padding issue.
I did some digging. It turns out this is due to the Light
struct in the base frag shader.
struct Light {
vec3 vector;
float radius;
vec3 color;
float intensity;
};
Because there is an array of this struct in the UBO, Vulkan complains about padding--namely, that the vec3
should have a vec4
's worth of padding. You can "fix" it by using two vec4
s instead of the current struct. It's not possible to manually specify offsets because it's a struct outside of a UBO declaration.