use glam::UVec3; use spirv_std::spirv; enum Outcome { Fizz, Buzz, FizzBuzz, } trait Game { fn fizzbuzz(&self) -> Option<Outcome>; } impl Game for u32 { fn fizzbuzz(&self) -> Option<Outcome> { match (self % 3 == 0, self % 5 == 0) { (true, true) => Some(Outcome::FizzBuzz), (true, false) => Some(Outcome::Fizz), (false, true) => Some(Outcome::Buzz), _ => None, } } } #[spirv(compute(threads(64)))] pub