| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct Boo |
| 7 |
{ |
| 8 |
float3 a; |
| 9 |
uint3 b; |
| 10 |
}; |
| 11 |
|
| 12 |
struct main0_out |
| 13 |
{ |
| 14 |
Boo vVertex; |
| 15 |
}; |
| 16 |
|
| 17 |
struct main0_in |
| 18 |
{ |
| 19 |
float3 Boo_a; |
| 20 |
uint3 Boo_b; |
| 21 |
}; |
| 22 |
|
| 23 |
kernel void main0(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], device main0_in* spvIn [[buffer(22)]]) |
| 24 |
{ |
| 25 |
device main0_out* gl_out = &spvOut[gl_GlobalInvocationID.x - gl_GlobalInvocationID.x % 4]; |
| 26 |
device main0_in* gl_in = &spvIn[min(gl_GlobalInvocationID.x / 4, spvIndirectParams[1] - 1) * spvIndirectParams[0]]; |
| 27 |
uint gl_InvocationID = gl_GlobalInvocationID.x % 4; |
| 28 |
uint gl_PrimitiveID = min(gl_GlobalInvocationID.x / 4, spvIndirectParams[1]); |
| 29 |
Boo _26 = Boo{ gl_in[gl_InvocationID].Boo_a, gl_in[gl_InvocationID].Boo_b }; |
| 30 |
gl_out[gl_InvocationID].vVertex = _26; |
| 31 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(1.0); |
| 32 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1] = half(2.0); |
| 33 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2] = half(3.0); |
| 34 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[3] = half(4.0); |
| 35 |
spvTessLevel[gl_PrimitiveID].insideTessellationFactor[0] = half(1.0); |
| 36 |
spvTessLevel[gl_PrimitiveID].insideTessellationFactor[1] = half(2.0); |
| 37 |
} |
| 38 |
|