5550c87b1f
CompilerMSL accesses options using same design pattern as CompilerGLSL and CompilerHLSL. CompilerMSL support setting VA & rez binding specs via either constructor or compile() method overload. CompilerMSL support single UBO packing and padding in single pass. spriv_cross app (main.cpp) supports turning off UBO packing and padding via command line option. Add MSL UBO alignment test shader.
24 lines
488 B
GLSL
24 lines
488 B
GLSL
#version 310 es
|
|
|
|
layout(binding = 0, std140) uniform UBO
|
|
{
|
|
mat4 mvp;
|
|
vec2 targSize;
|
|
vec3 color; // vec3 following vec2 should cause MSL to add pad if float3 is packed
|
|
float opacity; // Single float following vec3 should cause MSL float3 to pack
|
|
};
|
|
|
|
in vec4 aVertex;
|
|
in vec3 aNormal;
|
|
out vec3 vNormal;
|
|
out vec3 vColor;
|
|
out vec2 vSize;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = mvp * aVertex;
|
|
vNormal = aNormal;
|
|
vColor = color * opacity;
|
|
vSize = targSize * opacity;
|
|
}
|