#![allow(unused)] use rs2glsl::prelude::*; #[glsl] fn lerp(t: f32, a: f32, b: f32) -> f32 { return (1.0 - t) * a + t * b; } #[glsl] fn void_fn() {} #[glsl] fn fn_call() { lerp(0.0, 0.0, 0.0); } #[glsl] fn while_loop() { let mut v: vec2 = vec2(0.0, 1.0); let mut x: u32 = 10; while x > 0 { x -= 1; } } #[glsl] const SIZE: u32 = 10; #[glsl] fn kitchen_sink() -> u32 { let mut x: f32 = 1.0; x += 1.0; x = x * 10.0; while 0 > 1 { } loop {} while x < 2.0 * x { x = x - 1.0; break; continue; return 0; } if true { } else { } return SIZE; } #[glsl] fn void_fn_explicit_return() { return; } #[glsl] fn mul(a: f32, b: f32) -> f32 { return a * b; } #[glsl] fn dot(u: vec2, v: vec2) -> f32 { let mut sum: f32 = mul(u.x, v.x); sum += mul(u.y, v.y); return sum; } #[glsl] fn dummy() {} fn main() { println!("{}", GLSL_KITCHEN_SINK.with_dependencies()); }