Skip to content

Commit 93d2194

Browse files
committed
No longer require the workaround for the collatz example
1 parent d5d0c90 commit 93d2194

File tree

1 file changed

+1
-9
lines changed
  • examples/shaders/compute-shader/src

1 file changed

+1
-9
lines changed

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,5 @@ pub fn main_cs(
4444
#[spirv(storage_buffer, descriptor_set = 0, binding = 0)] prime_indices: &mut [u32],
4545
) {
4646
let index = id.x as usize;
47-
prime_indices[index] = unwrap_or_max(collatz(prime_indices[index]));
48-
}
49-
50-
// Work around https://github.com/EmbarkStudios/rust-gpu/issues/677
51-
fn unwrap_or_max(option: Option<u32>) -> u32 {
52-
match option {
53-
Some(inner) => inner,
54-
None => u32::MAX,
55-
}
47+
prime_indices[index] = collatz(prime_indices[index]).unwrap_or(u32::MAX);
5648
}

0 commit comments

Comments
 (0)