diff options
Diffstat (limited to 'contrib/SDL-3.2.8/test/testgpu/cube.metal')
| -rw-r--r-- | contrib/SDL-3.2.8/test/testgpu/cube.metal | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/test/testgpu/cube.metal b/contrib/SDL-3.2.8/test/testgpu/cube.metal new file mode 100644 index 0000000..eaf7175 --- /dev/null +++ b/contrib/SDL-3.2.8/test/testgpu/cube.metal | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #include <metal_stdlib> | ||
| 2 | using namespace metal; | ||
| 3 | |||
| 4 | struct VSOutput | ||
| 5 | { | ||
| 6 | float4 color [[user(locn0)]]; | ||
| 7 | float4 position [[position]]; | ||
| 8 | }; | ||
| 9 | |||
| 10 | #ifdef VERTEX | ||
| 11 | |||
| 12 | struct UBO | ||
| 13 | { | ||
| 14 | float4x4 modelViewProj; | ||
| 15 | }; | ||
| 16 | |||
| 17 | struct VSInput | ||
| 18 | { | ||
| 19 | float3 position [[attribute(0)]]; | ||
| 20 | float3 color [[attribute(1)]]; | ||
| 21 | }; | ||
| 22 | |||
| 23 | vertex VSOutput vs_main(VSInput input [[stage_in]], constant UBO& ubo [[buffer(0)]]) | ||
| 24 | { | ||
| 25 | VSOutput output; | ||
| 26 | output.color = float4(input.color, 1.0); | ||
| 27 | output.position = ubo.modelViewProj * float4(input.position, 1.0); | ||
| 28 | return output; | ||
| 29 | } | ||
| 30 | |||
| 31 | #else | ||
| 32 | |||
| 33 | fragment float4 fs_main(VSOutput input [[stage_in]]) | ||
| 34 | { | ||
| 35 | return input.color; | ||
| 36 | } | ||
| 37 | |||
| 38 | #endif \ No newline at end of file | ||
