summaryrefslogtreecommitdiff
path: root/SDL-3.2.8/test/testgpu/cube.metal
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2026-03-06 13:26:57 -0800
committer3gg <3gg@shellblade.net>2026-03-06 13:26:57 -0800
commitf5c89b3bd5d74849757fd5b4d1a300068522a3ca (patch)
treed6f6e4c81745b393d7594b334710f30c0b2df3bd /SDL-3.2.8/test/testgpu/cube.metal
Initial commitHEADmain
Diffstat (limited to 'SDL-3.2.8/test/testgpu/cube.metal')
-rw-r--r--SDL-3.2.8/test/testgpu/cube.metal38
1 files changed, 38 insertions, 0 deletions
diff --git a/SDL-3.2.8/test/testgpu/cube.metal b/SDL-3.2.8/test/testgpu/cube.metal
new file mode 100644
index 0000000..eaf7175
--- /dev/null
+++ b/SDL-3.2.8/test/testgpu/cube.metal
@@ -0,0 +1,38 @@
1#include <metal_stdlib>
2using namespace metal;
3
4struct VSOutput
5{
6 float4 color [[user(locn0)]];
7 float4 position [[position]];
8};
9
10#ifdef VERTEX
11
12struct UBO
13{
14 float4x4 modelViewProj;
15};
16
17struct VSInput
18{
19 float3 position [[attribute(0)]];
20 float3 color [[attribute(1)]];
21};
22
23vertex 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
33fragment float4 fs_main(VSOutput input [[stage_in]])
34{
35 return input.color;
36}
37
38#endif \ No newline at end of file