e75add42c9
These are mapped to Metal's post-tessellation vertex functions. The semantic difference is much less here, so this change should be simpler than the previous one. There are still some hairy parts, though. In MSL, the array of control point data is represented by a special type, `patch_control_point<T>`, where `T` is a valid stage-input type. This object must be embedded inside the patch-level stage input. For this reason, I've added a new type to the type system to represent this. On Mac, the number of input control points to the function must be specified in the `patch()` attribute. This is optional on iOS. SPIRV-Cross takes this from the `OutputVertices` execution mode; the intent is that if it's not set in the shader itself, MoltenVK will set it from the tessellation control shader. If you're translating these offline, you'll have to update the control point count manually, since this number must match the number that is passed to the `drawPatches:...` family of methods. Fixes #120.
13 lines
463 B
GLSL
13 lines
463 B
GLSL
#version 310 es
|
|
#extension GL_EXT_tessellation_shader : require
|
|
|
|
layout(cw, quads, fractional_even_spacing) in;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = vec4(gl_TessCoord.x * gl_TessLevelInner[0] * gl_TessLevelOuter[0] + (1.0 - gl_TessCoord.x) * gl_TessLevelInner[0] * gl_TessLevelOuter[2],
|
|
gl_TessCoord.y * gl_TessLevelInner[1] * gl_TessLevelOuter[1] + (1.0 - gl_TessCoord.y) * gl_TessLevelInner[1] * gl_TessLevelOuter[3],
|
|
0, 1);
|
|
}
|
|
|