blob: 514ae89d89a1608c2f04473d15ea52cf20db9497 [file] [log] [blame]
James Price085093d2024-06-06 02:09:47 +00001#include <metal_stdlib>
2using namespace metal;
James Price48be7e82024-06-19 22:38:07 +00003
James Price085093d2024-06-06 02:09:47 +00004struct tint_module_vars_struct {
5 device float2* prevent_dce;
6};
James Price48be7e82024-06-19 22:38:07 +00007
James Price2cc6b3c2024-06-13 20:31:41 +00008struct VertexOutput {
9 float4 pos;
10 float2 prevent_dce;
11};
James Price48be7e82024-06-19 22:38:07 +000012
James Price085093d2024-06-06 02:09:47 +000013struct vertex_main_outputs {
James Price2cc6b3c2024-06-13 20:31:41 +000014 float4 VertexOutput_pos [[position]];
15 float2 VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
James Price085093d2024-06-06 02:09:47 +000016};
dan sinclairf1f381a2023-11-22 09:44:15 +000017
James Price2cc6b3c2024-06-13 20:31:41 +000018float2 acos_dfc915() {
James Price085093d2024-06-06 02:09:47 +000019 float2 arg_0 = float2(0.96891242265701293945f);
20 float2 res = acos(arg_0);
James Price2cc6b3c2024-06-13 20:31:41 +000021 return res;
dan sinclairf1f381a2023-11-22 09:44:15 +000022}
James Price48be7e82024-06-19 22:38:07 +000023
James Price085093d2024-06-06 02:09:47 +000024fragment void fragment_main(device float2* prevent_dce [[buffer(0)]]) {
25 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
James Price2cc6b3c2024-06-13 20:31:41 +000026 (*tint_module_vars.prevent_dce) = acos_dfc915();
dan sinclairf1f381a2023-11-22 09:44:15 +000027}
James Price48be7e82024-06-19 22:38:07 +000028
James Price085093d2024-06-06 02:09:47 +000029kernel void compute_main(device float2* prevent_dce [[buffer(0)]]) {
30 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
James Price2cc6b3c2024-06-13 20:31:41 +000031 (*tint_module_vars.prevent_dce) = acos_dfc915();
dan sinclairf1f381a2023-11-22 09:44:15 +000032}
James Price48be7e82024-06-19 22:38:07 +000033
James Price2cc6b3c2024-06-13 20:31:41 +000034VertexOutput vertex_main_inner() {
35 VertexOutput out = {};
36 out.pos = float4(0.0f);
37 out.prevent_dce = acos_dfc915();
38 return out;
39}
James Price48be7e82024-06-19 22:38:07 +000040
James Price2cc6b3c2024-06-13 20:31:41 +000041vertex vertex_main_outputs vertex_main() {
42 VertexOutput const v = vertex_main_inner();
James Price6d87fa62024-09-03 23:24:13 +000043 vertex_main_outputs tint_wrapper_result = {};
44 tint_wrapper_result.VertexOutput_pos = v.pos;
45 tint_wrapper_result.VertexOutput_prevent_dce = v.prevent_dce;
46 return tint_wrapper_result;
dan sinclairf1f381a2023-11-22 09:44:15 +000047}