SPIRV-Cross/shaders-msl/tese/set-from-function.tese
Chip Davis 6b7988046d Handle blocks of patch I/O.
In this case, each member of the block will be decorated with
`DecorationPatch`, rather than the block variable having the decoration.
2019-02-15 17:21:38 -06:00

37 lines
692 B
GLSL

#version 450
layout(ccw, quads, fractional_even_spacing) in;
layout(location = 0) in vec4 vColor[];
layout(location = 1) patch in vec4 vColors;
layout(location = 2) in Block
{
vec4 a;
vec4 b;
} blocks[];
struct Foo
{
vec4 a;
vec4 b;
};
layout(location = 4) patch in Foo vFoo;
void set_from_function()
{
gl_Position = blocks[0].a;
gl_Position += blocks[0].b;
gl_Position += blocks[1].a;
gl_Position += blocks[1].b;
gl_Position += vColor[0];
gl_Position += vColor[1];
gl_Position += vColors;
gl_Position += vFoo.a;
gl_Position += vFoo.b;
}
void main()
{
set_from_function();
}