blob: 1f79489766a6c8c1cee649a4ac86eb8cf00a2ee0 [file] [log] [blame]
Ben Claytonc0af5c52022-06-02 14:36:10 +00001#include <metal_stdlib>
2
3using namespace metal;
4
Ben Claytoned998e92022-11-23 19:57:00 +00005struct modf_result_f32 {
Ben Claytonc0af5c52022-06-02 14:36:10 +00006 float fract;
7 float whole;
8};
Ben Claytoned998e92022-11-23 19:57:00 +00009modf_result_f32 tint_modf(float param_0) {
10 modf_result_f32 result;
Zhaoming Jiang20cddbf2022-08-05 15:11:44 +000011 result.fract = modf(param_0, result.whole);
12 return result;
Ben Claytonc0af5c52022-06-02 14:36:10 +000013}
14
Zhaoming Jiang20cddbf2022-08-05 15:11:44 +000015void modf_bbf7f7() {
Ben Clayton329dfd72022-11-23 00:05:05 +000016 float arg_0 = -1.5f;
Ben Claytoned998e92022-11-23 19:57:00 +000017 modf_result_f32 res = tint_modf(arg_0);
Ben Claytonc0af5c52022-06-02 14:36:10 +000018}
19
20struct tint_symbol {
21 float4 value [[position]];
22};
23
24float4 vertex_main_inner() {
Zhaoming Jiang20cddbf2022-08-05 15:11:44 +000025 modf_bbf7f7();
Ben Claytonc0af5c52022-06-02 14:36:10 +000026 return float4(0.0f);
27}
28
29vertex tint_symbol vertex_main() {
30 float4 const inner_result = vertex_main_inner();
31 tint_symbol wrapper_result = {};
32 wrapper_result.value = inner_result;
33 return wrapper_result;
34}
35
36fragment void fragment_main() {
Zhaoming Jiang20cddbf2022-08-05 15:11:44 +000037 modf_bbf7f7();
Ben Claytonc0af5c52022-06-02 14:36:10 +000038 return;
39}
40
41kernel void compute_main() {
Zhaoming Jiang20cddbf2022-08-05 15:11:44 +000042 modf_bbf7f7();
Ben Claytonc0af5c52022-06-02 14:36:10 +000043 return;
44}
45