From 6aaedb813fa11ba0679c3051bc2eb28646b9506c Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 30 Aug 2025 16:53:58 -0700 Subject: Update to SDL3 --- src/contrib/SDL-3.2.20/test/testgpu/cube.metal | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/contrib/SDL-3.2.20/test/testgpu/cube.metal (limited to 'src/contrib/SDL-3.2.20/test/testgpu/cube.metal') 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 @@ +#include +using namespace metal; + +struct VSOutput +{ + float4 color [[user(locn0)]]; + float4 position [[position]]; +}; + +#ifdef VERTEX + +struct UBO +{ + float4x4 modelViewProj; +}; + +struct VSInput +{ + float3 position [[attribute(0)]]; + float3 color [[attribute(1)]]; +}; + +vertex VSOutput vs_main(VSInput input [[stage_in]], constant UBO& ubo [[buffer(0)]]) +{ + VSOutput output; + output.color = float4(input.color, 1.0); + output.position = ubo.modelViewProj * float4(input.position, 1.0); + return output; +} + +#else + +fragment float4 fs_main(VSOutput input [[stage_in]]) +{ + return input.color; +} + +#endif \ No newline at end of file -- cgit v1.2.3