Skip to content

Commit

Permalink
upgrade to wgpu 1.14 #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Sycrosity committed Oct 23, 2022
1 parent 0a3ff5e commit 499163a
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 48 deletions.
25 changes: 25 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below.

# NOTE: For maximum performance, build using a nightly compiler
# If you are using rust stable, remove the "-Zshare-generics=y" below.

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]

# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
# `brew install michaeleisel/zld/zld`
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/bin/zld", "-Zshare-generics=y"]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-Zshare-generics=n"]

# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
#[profile.dev]
#debug = 1
80 changes: 37 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ winit = "0.27"
env_logger = "0.9"
log = "0.4"
#the library we are using to render items to the screen
wgpu = "0.13"
wgpu = "0.14"
#a more lightweight option to allow main() to await the future than tokio or async-std
pollster = "0.2"
#for casting Vec[f32]'s into Vec[u8]'s
Expand Down Expand Up @@ -49,7 +49,7 @@ console_error_panic_hook = "0.1"
#implements logging for wasm on the web
console_log = "0.2"
#specific wgpu version for wasm/webgl
wgpu = { version = "0.13", features = ["webgl"]}
wgpu = { version = "0.14", features = ["webgl"]}
#for generating the boilerplate code telling a browser how to use the renderer
wasm-bindgen = { version = "0.2", features = [
"serde-serialize"
Expand All @@ -75,8 +75,6 @@ identifier = "dev.sycro.engine"
icon = ["res/logos.icns"]
resources = ["res"]



#fix macos window weirdness - not a good fix but it should work
[target.'cfg(target_os = "macos")'.dependencies]
cocoa = "0.24"
Expand All @@ -90,3 +88,4 @@ crate-type = ["cdylib", "rlib"]
anyhow = "1.0"
fs_extra = "1.2"
glob = "0.3"

2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly"
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ impl State {
//essentially Vsync, and will cap the display rate to the display's frame rate - there are other options to choose from https://docs.rs/wgpu/latest/wgpu/enum.PresentMode.html
//[TODO] allow the user to choose what mode they want (probably between AutoNoVsync and AutoVsync)
present_mode: wgpu::PresentMode::AutoVsync,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
};
surface.configure(&device, &config);

Expand Down Expand Up @@ -820,7 +821,7 @@ pub async fn run() {
{
//winit prevents sizing with CSS, so we have to set the size manually when on web
use winit::dpi::PhysicalSize;

// wgpu::SurfaceConfiguration
//the winit window doesn't usually have canvas/web features on
use winit::platform::web::WindowExtWebSys;

Expand Down

0 comments on commit 499163a

Please sign in to comment.