SPIRV-Cross/reference/shaders-msl/desktop-only/vert/clip-cull-distance.desktop.vert
Hans-Kristian Arntzen a3fe9756d2 MSL: Support ClipDistance as an input stage variable.
MSL does not support this, so we have to emulate it by passing it around
as a varying between stages. We use a special "user(clipN)" attribute
for this rather than locN which is used for user varyings.
2019-12-02 13:19:42 +01:00

25 lines
549 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 gl_Position [[position]];
float gl_ClipDistance [[clip_distance]] [2];
float gl_ClipDistance_0 [[user(clip0)]];
float gl_ClipDistance_1 [[user(clip1)]];
};
vertex main0_out main0()
{
main0_out out = {};
out.gl_Position = float4(10.0);
out.gl_ClipDistance[0] = 1.0;
out.gl_ClipDistance[1] = 4.0;
out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
out.gl_ClipDistance_1 = out.gl_ClipDistance[1];
return out;
}