SPIRV-Cross/shaders-hlsl/frag/row-major-layout-in-struct.frag
Hans-Kristian Arntzen f1e8555801 Emit matrix layouts in structs directly.
Unlike GLSL, child structs do not inherit matrix layouts.
2018-06-05 09:42:07 +02:00

30 lines
327 B
GLSL

#version 450
struct Foo
{
mat4 v;
mat4 w;
};
struct NonFoo
{
mat4 v;
mat4 w;
};
layout(std140, binding = 0) uniform UBO
{
layout(column_major) Foo foo;
};
layout(location = 0) out vec4 FragColor;
layout(location = 0) in vec4 vUV;
void main()
{
NonFoo f;
f.v = foo.v;
f.w = foo.w;
FragColor = f.v * (f.w * vUV);
}