| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct Boo |
| 7 |
{ |
| 8 |
float3 a; |
| 9 |
float3 b; |
| 10 |
}; |
| 11 |
|
| 12 |
struct main0_out |
| 13 |
{ |
| 14 |
Boo vVertex; |
| 15 |
}; |
| 16 |
|
| 17 |
struct main0_in |
| 18 |
{ |
| 19 |
float3 Boo_a [[attribute(0)]]; |
| 20 |
float3 Boo_b [[attribute(1)]]; |
| 21 |
}; |
| 22 |
|
| 23 |
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 MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) |
| 24 |
{ |
| 25 |
device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4]; |
| 26 |
if (gl_InvocationID < spvIndirectParams[0]) |
| 27 |
gl_in[gl_InvocationID] = in; |
| 28 |
threadgroup_barrier(mem_flags::mem_threadgroup); |
| 29 |
if (gl_InvocationID >= 4) |
| 30 |
return; |
| 31 |
Boo _25 = Boo{ gl_in[gl_InvocationID].Boo_a, gl_in[gl_InvocationID].Boo_b }; |
| 32 |
gl_out[gl_InvocationID].vVertex = _25; |
| 33 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(1.0); |
| 34 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1] = half(2.0); |
| 35 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2] = half(3.0); |
| 36 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[3] = half(4.0); |
| 37 |
spvTessLevel[gl_PrimitiveID].insideTessellationFactor[0] = half(1.0); |
| 38 |
spvTessLevel[gl_PrimitiveID].insideTessellationFactor[1] = half(2.0); |
| 39 |
} |
| 40 |
|