Skip to content

Commit 809ab26

Browse files
authored
Merge pull request #30 from LykenSol/rust-gpu-update
Update to EmbarkStudios/rust-gpu@320bc05.
2 parents dafb2de + 5678220 commit 809ab26

File tree

8 files changed

+114
-132
lines changed

8 files changed

+114
-132
lines changed

Cargo.lock

Lines changed: 79 additions & 119 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,29 @@ winit = { version = "0.23", features = ["web-sys"] }
1717
wgpu-subscriber = "0.1.0"
1818

1919
[build-dependencies]
20-
spirv-builder = { version = "*", default-features = false }
20+
spirv-builder = { version = "0.3.0-alpha.0", default-features = false }
2121

2222
[workspace]
2323
members = ["shaders"]
2424

2525
[patch.crates-io]
26-
spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "c1dc273e706fa0e09a651131e1adee39bd49c2b2" }
27-
spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "c1dc273e706fa0e09a651131e1adee39bd49c2b2" }
26+
spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "320bc0562682afc8afb51ca928d22a39edd6f00b" }
27+
spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "320bc0562682afc8afb51ca928d22a39edd6f00b" }
28+
29+
# Compile build-dependencies in release mode with
30+
# the same settings as regular dependencies.
31+
[profile.release.build-override]
32+
opt-level = 3
33+
codegen-units = 16
34+
35+
# HACK(eddyb) also compile debug mode's build-dependencies with optimizations,
36+
# because otherwise `rustc_codegen_spirv` (esspecially its linker) is too slow.
37+
# Also `spirv-opt` *alone* takes (just) over an hour to run, though this only
38+
# brings it down only to 10 minutes, so I've disabled it below, for now.
39+
[profile.dev.build-override]
40+
opt-level = 3
41+
42+
# HACK(eddyb) don't optimize the shader crate, to avoid `spirv-opt` taking
43+
# a long time (10 minutes if itself was optimized, over an hour otherwise).
44+
[profile.release.package."shadertoys-shaders"]
45+
opt-level = 0

rust-toolchain

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
nightly-2020-11-24
1+
# If you see this, run `rustup self update` to get rustup 1.23 or newer.
2+
3+
# NOTE: above comment is for older `rustup` (before TOML support was added),
4+
# which will treat the first line as the toolchain name, and therefore show it
5+
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
6+
7+
[toolchain]
8+
channel = "nightly-2020-12-28"
9+
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

setup.bat

Lines changed: 0 additions & 3 deletions
This file was deleted.

setup.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

shaders/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ edition = "2018"
88
crate-type = ["dylib"]
99

1010
[dependencies]
11-
spirv-std = "*"
11+
spirv-std = "0.3.0-alpha.0"
1212
shared = { path = "../shared" }

shaders/src/miracle_snowflakes.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ fn noise2(x: Vec2) -> f32 {
8181
let mut f: Vec2 = x.gl_fract();
8282
f = f * f * (Vec2::splat(3.0) - 2.0 * f);
8383
let n: f32 = p.x + p.y * 157.0;
84-
let h: Vec4 = hash4(Vec4::splat(n) + vec4(NC0.x, NC0.y, NC1.x, NC1.y));
84+
let nc0 = NC0;
85+
let nc1 = NC1;
86+
let h: Vec4 = hash4(Vec4::splat(n) + vec4(nc0.x, nc0.y, nc1.x, nc1.y));
8587
let s1: Vec2 = mix(h.xy(), h.zw(), f.xx());
8688
mix(s1.x, s1.y, f.y)
8789
}

shared/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ authors = []
55
edition = "2018"
66

77
[dependencies]
8-
spirv-std = "*"
8+
spirv-std = "0.3.0-alpha.0"

0 commit comments

Comments
 (0)