SPIRV-Cross/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc
Chip Davis 0bb6bbda22 Never flatten outputs when capturing them.
There's no need to do so, since these are not stage-out structs being
returned, but regular structures being written to a buffer. This also
neatly avoids issues writing to composite (e.g. arrayed) per-patch
outputs from a tessellation control shader.
2019-02-11 17:18:54 -06:00

28 lines
725 B
GLSL

#version 450
layout(vertices = 4) out;
layout(location = 0) patch out vec3 vPatch[2];
layout(location = 2) out vec3 vVertex[];
layout(location = 0) in vec3 vInput[];
void main()
{
vVertex[gl_InvocationID] =
vInput[gl_InvocationID] +
vInput[gl_InvocationID ^ 1];
barrier();
if (gl_InvocationID == 0)
{
vPatch[0] = vec3(10.0);
vPatch[1] = vec3(20.0);
gl_TessLevelOuter[0] = 1.0;
gl_TessLevelOuter[1] = 2.0;
gl_TessLevelOuter[2] = 3.0;
gl_TessLevelOuter[3] = 4.0;
gl_TessLevelInner[0] = 1.0;
gl_TessLevelInner[1] = 2.0;
}
}