-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of changes to conform to new wgpu API Also a bit of refactoring
- Loading branch information
Showing
10 changed files
with
733 additions
and
843 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Ray Tracing using rust-gpu | ||
# Wrach | ||
|
||
Implementation of ray tracing using `rust-gpu`. The biolerplate setup code [`rust-gpu-shadertoys`](https://github.com/LykenSol/rust-gpu-shadertoys). | ||
A game like Noita, but using the GPU |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
edition = "2018" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
pub fn collatz(mut n: u32) -> Option<u32> { | ||
let mut i = 0; | ||
if n == 0 { | ||
return None; | ||
} | ||
while n != 1 { | ||
n = if n % 2 == 0 { | ||
n / 2 | ||
} else { | ||
// Overflow? (i.e. 3*n + 1 > 0xffff_ffff) | ||
if n >= 0x5555_5555 { | ||
return None; | ||
} | ||
// TODO: Use this instead when/if checked add/mul can work: n.checked_mul(3)?.checked_add(1)? | ||
3 * n + 1 | ||
}; | ||
i += 1; | ||
} | ||
Some(i) | ||
} | ||
|
||
// Work around https://github.com/EmbarkStudios/rust-gpu/issues/677 | ||
pub fn unwrap_or_max(option: Option<u32>) -> u32 { | ||
match option { | ||
Some(inner) => inner, | ||
None => u32::MAX, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.