blob: 619a7d083b6cfba9efda6d6d53b7c6072a7be343 [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 float* prevent_dce;
6};
James Price48be7e82024-06-19 22:38:07 +00007
James Price2cc6b3c2024-06-13 20:31:41 +00008struct VertexOutput {
9 float4 pos;
10 float 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 float 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 +000018float fract_fa5c71() {
James Price085093d2024-06-06 02:09:47 +000019 float res = 0.25f;
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 float* 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) = fract_fa5c71();
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 float* 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) = fract_fa5c71();
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 = fract_fa5c71();
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();
42 return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
dan sinclairf1f381a2023-11-22 09:44:15 +000043}