blob: a4093e1e6b8599624e59a6fb131d41e88d6d4ede [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 uint* prevent_dce;
9};
James Price48be7e82024-06-19 22:38:07 +000010
dan sinclair892af222024-12-06 14:16:09 +000011uint bitcast_dce842() {
12 int arg_0 = 1;
13 uint res = as_type<uint>(arg_0);
14 return res;
15}
16
17fragment void fragment_main(device uint* 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_dce842();
20}
21//
22// compute_main
23//
24#include <metal_stdlib>
25using namespace metal;
26
27struct tint_module_vars_struct {
28 device uint* prevent_dce;
29};
30
31uint bitcast_dce842() {
32 int arg_0 = 1;
33 uint res = as_type<uint>(arg_0);
34 return res;
35}
36
37kernel void compute_main(device uint* 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_dce842();
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 uint 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 uint 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 +000057uint bitcast_dce842() {
James Price085093d2024-06-06 02:09:47 +000058 int arg_0 = 1;
59 uint res = as_type<uint>(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_dce842();
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}