blob: a6064f4aa24edfaeb671609af855c5b405c22dbe [file] [log] [blame]
dan sinclair892af222024-12-06 14:16:09 +00001//
2// fragment_main
3//
James Price085093d2024-06-06 02:09:47 +00004#include <metal_stdlib>
5using namespace metal;
James Price48be7e82024-06-19 22:38:07 +00006
James Price085093d2024-06-06 02:09:47 +00007struct tint_module_vars_struct {
8 device float* prevent_dce;
9};
James Price48be7e82024-06-19 22:38:07 +000010
dan sinclair892af222024-12-06 14:16:09 +000011float bitcast_23c8bd() {
12 half2 arg_0 = half2(1.0h);
13 float res = as_type<float>(arg_0);
14 return res;
15}
16
17fragment void fragment_main(device float* prevent_dce [[buffer(0)]]) {
18 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
19 (*tint_module_vars.prevent_dce) = bitcast_23c8bd();
20}
21//
22// compute_main
23//
24#include <metal_stdlib>
25using namespace metal;
26
27struct tint_module_vars_struct {
28 device float* prevent_dce;
29};
30
31float bitcast_23c8bd() {
32 half2 arg_0 = half2(1.0h);
33 float res = as_type<float>(arg_0);
34 return res;
35}
36
37kernel void compute_main(device float* prevent_dce [[buffer(0)]]) {
38 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
39 (*tint_module_vars.prevent_dce) = bitcast_23c8bd();
40}
41//
42// vertex_main
43//
44#include <metal_stdlib>
45using namespace metal;
46
James Price2cc6b3c2024-06-13 20:31:41 +000047struct VertexOutput {
48 float4 pos;
49 float prevent_dce;
50};
James Price48be7e82024-06-19 22:38:07 +000051
James Price085093d2024-06-06 02:09:47 +000052struct vertex_main_outputs {
James Price2cc6b3c2024-06-13 20:31:41 +000053 float4 VertexOutput_pos [[position]];
54 float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
James Price085093d2024-06-06 02:09:47 +000055};
James Pricea30f8dd2024-05-10 14:31:43 +000056
James Price2cc6b3c2024-06-13 20:31:41 +000057float bitcast_23c8bd() {
James Price085093d2024-06-06 02:09:47 +000058 half2 arg_0 = half2(1.0h);
59 float res = as_type<float>(arg_0);
James Price2cc6b3c2024-06-13 20:31:41 +000060 return res;
James Pricea30f8dd2024-05-10 14:31:43 +000061}
James Price48be7e82024-06-19 22:38:07 +000062
James Price2cc6b3c2024-06-13 20:31:41 +000063VertexOutput vertex_main_inner() {
64 VertexOutput out = {};
65 out.pos = float4(0.0f);
66 out.prevent_dce = bitcast_23c8bd();
67 return out;
68}
James Price48be7e82024-06-19 22:38:07 +000069
James Price2cc6b3c2024-06-13 20:31:41 +000070vertex vertex_main_outputs vertex_main() {
71 VertexOutput const v = vertex_main_inner();
James Price6d87fa62024-09-03 23:24:13 +000072 vertex_main_outputs tint_wrapper_result = {};
73 tint_wrapper_result.VertexOutput_pos = v.pos;
74 tint_wrapper_result.VertexOutput_prevent_dce = v.prevent_dce;
75 return tint_wrapper_result;
James Pricea30f8dd2024-05-10 14:31:43 +000076}