diff options
author | 3gg <3gg@shellblade.net> | 2025-08-30 16:53:58 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-08-30 16:53:58 -0700 |
commit | 6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch) | |
tree | 34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/test/testgpu/cube.metal | |
parent | 8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff) |
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/test/testgpu/cube.metal')
-rw-r--r-- | src/contrib/SDL-3.2.20/test/testgpu/cube.metal | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/test/testgpu/cube.metal b/src/contrib/SDL-3.2.20/test/testgpu/cube.metal new file mode 100644 index 0000000..eaf7175 --- /dev/null +++ b/src/contrib/SDL-3.2.20/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 | ||