blob: 17fb86ffed27b012b8eb27717ac15f00d1852a1d [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 half4* prevent_dce;
6};
James Price48be7e82024-06-19 22:38:07 +00007
James Price2cc6b3c2024-06-13 20:31:41 +00008struct VertexOutput {
9 float4 pos;
10 half4 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 half4 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 +000018half4 abs_538d29() {
James Price085093d2024-06-06 02:09:47 +000019 half4 res = half4(1.0h);
James Price2cc6b3c2024-06-13 20:31:41 +000020 return res;
dan sinclairf1f381a2023-11-22 09:44:15 +000021}
James Price48be7e82024-06-19 22:38:07 +000022
James Price085093d2024-06-06 02:09:47 +000023fragment void fragment_main(device half4* prevent_dce [[buffer(0)]]) {
24 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
James Price2cc6b3c2024-06-13 20:31:41 +000025 (*tint_module_vars.prevent_dce) = abs_538d29();
dan sinclairf1f381a2023-11-22 09:44:15 +000026}
James Price48be7e82024-06-19 22:38:07 +000027
James Price085093d2024-06-06 02:09:47 +000028kernel void compute_main(device half4* prevent_dce [[buffer(0)]]) {
29 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
James Price2cc6b3c2024-06-13 20:31:41 +000030 (*tint_module_vars.prevent_dce) = abs_538d29();
dan sinclairf1f381a2023-11-22 09:44:15 +000031}
James Price48be7e82024-06-19 22:38:07 +000032
James Price2cc6b3c2024-06-13 20:31:41 +000033VertexOutput vertex_main_inner() {
34 VertexOutput out = {};
35 out.pos = float4(0.0f);
36 out.prevent_dce = abs_538d29();
37 return out;
38}
James Price48be7e82024-06-19 22:38:07 +000039
James Price2cc6b3c2024-06-13 20:31:41 +000040vertex vertex_main_outputs vertex_main() {
41 VertexOutput const v = vertex_main_inner();
James Price6d87fa62024-09-03 23:24:13 +000042 vertex_main_outputs tint_wrapper_result = {};
43 tint_wrapper_result.VertexOutput_pos = v.pos;
44 tint_wrapper_result.VertexOutput_prevent_dce = v.prevent_dce;
45 return tint_wrapper_result;
dan sinclairf1f381a2023-11-22 09:44:15 +000046}