1use crate::compiler::wgsl;
2
3pub trait WgpuElement {
5 fn wgpu_elem() -> wgsl::Elem;
6}
7
8pub trait FloatElement: WgpuElement {}
10
11pub trait IntElement: WgpuElement {}
13
14impl WgpuElement for u32 {
15 fn wgpu_elem() -> wgsl::Elem {
16 wgsl::Elem::U32
17 }
18}
19
20impl WgpuElement for i32 {
21 fn wgpu_elem() -> wgsl::Elem {
22 wgsl::Elem::I32
23 }
24}
25
26impl WgpuElement for f32 {
27 fn wgpu_elem() -> wgsl::Elem {
28 wgsl::Elem::F32
29 }
30}
31
32impl FloatElement for f32 {}
33impl IntElement for i32 {}