blob: 06ca6a138f0f8e820289ec5bf4b56812d74e0636 [file] [log] [blame]
James Price085093d2024-06-06 02:09:47 +00001#include <metal_stdlib>
2using namespace metal;
3struct tint_module_vars_struct {
4 device half2* prevent_dce;
5};
James Price2cc6b3c2024-06-13 20:31:41 +00006struct VertexOutput {
7 float4 pos;
8 half2 prevent_dce;
9};
James Price085093d2024-06-06 02:09:47 +000010struct vertex_main_outputs {
James Price2cc6b3c2024-06-13 20:31:41 +000011 float4 VertexOutput_pos [[position]];
12 half2 VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
James Price085093d2024-06-06 02:09:47 +000013};
dan sinclairf1f381a2023-11-22 09:44:15 +000014
James Price2cc6b3c2024-06-13 20:31:41 +000015half2 smoothstep_12c031() {
James Price085093d2024-06-06 02:09:47 +000016 half2 arg_0 = half2(2.0h);
17 half2 arg_1 = half2(4.0h);
18 half2 arg_2 = half2(3.0h);
19 half2 res = smoothstep(arg_0, arg_1, arg_2);
James Price2cc6b3c2024-06-13 20:31:41 +000020 return res;
dan sinclairf1f381a2023-11-22 09:44:15 +000021}
James Price085093d2024-06-06 02:09:47 +000022fragment void fragment_main(device half2* prevent_dce [[buffer(0)]]) {
23 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
James Price2cc6b3c2024-06-13 20:31:41 +000024 (*tint_module_vars.prevent_dce) = smoothstep_12c031();
dan sinclairf1f381a2023-11-22 09:44:15 +000025}
James Price085093d2024-06-06 02:09:47 +000026kernel void compute_main(device half2* prevent_dce [[buffer(0)]]) {
27 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
James Price2cc6b3c2024-06-13 20:31:41 +000028 (*tint_module_vars.prevent_dce) = smoothstep_12c031();
dan sinclairf1f381a2023-11-22 09:44:15 +000029}
James Price2cc6b3c2024-06-13 20:31:41 +000030VertexOutput vertex_main_inner() {
31 VertexOutput out = {};
32 out.pos = float4(0.0f);
33 out.prevent_dce = smoothstep_12c031();
34 return out;
35}
36vertex vertex_main_outputs vertex_main() {
37 VertexOutput const v = vertex_main_inner();
38 return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
dan sinclairf1f381a2023-11-22 09:44:15 +000039}