Skip to content

Commit 67a21bf

Browse files
Unit Testing Shader Code Experiment/Example (#813)
1 parent 2ca5826 commit 67a21bf

File tree

1 file changed

+13
-0
lines changed
  • examples/shaders/sky-shader/src

1 file changed

+13
-0
lines changed

examples/shaders/sky-shader/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,16 @@ pub fn main_vs(#[spirv(vertex_index)] vert_idx: i32, #[spirv(position)] builtin_
175175

176176
*builtin_pos = pos.extend(0.0).extend(1.0);
177177
}
178+
179+
#[cfg(test)]
180+
mod tests {
181+
use super::*;
182+
183+
#[test]
184+
fn test_tonemap() {
185+
assert_eq!(
186+
tonemap(vec3(1_f32, 1_f32, 1_f32)),
187+
vec3(0.001261625, 0.001261625, 0.001261625)
188+
);
189+
}
190+
}

0 commit comments

Comments
 (0)