Debian Codegraph @

third_party/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc

raw
1 #include <metal_stdlib>
2 #include <simd/simd.h>
3
4 using namespace metal;
5
6 struct main0_out
7 {
8 float4 gl_Position;
9 };
10
11 struct main0_patchOut
12 {
13 float3 vFoo;
14 };
15
16 struct main0_in
17 {
18 float4 gl_Position [[attribute(0)]];
19 };
20
21 kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
22 {
23 device main0_out* gl_out = &spvOut[gl_PrimitiveID * 1];
24 device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID];
25 if (gl_InvocationID < spvIndirectParams[0])
26 gl_in[gl_InvocationID] = in;
27 threadgroup_barrier(mem_flags::mem_threadgroup);
28 if (gl_InvocationID >= 1)
29 return;
30 spvTessLevel[gl_PrimitiveID].insideTessellationFactor[0] = half(8.8999996185302734375);
31 spvTessLevel[gl_PrimitiveID].insideTessellationFactor[1] = half(6.900000095367431640625);
32 spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(8.8999996185302734375);
33 spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1] = half(6.900000095367431640625);
34 spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2] = half(3.900000095367431640625);
35 spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[3] = half(4.900000095367431640625);
36 patchOut.vFoo = float3(1.0);
37 gl_out[gl_InvocationID].gl_Position = gl_in[0].gl_Position + gl_in[1].gl_Position;
38 }
39