mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-22 14:56:27 +00:00
Ash runner: fix crash on resize/minimize and add shader hot reloading (#299)
* window resizing and hot reloading * remove windows paths and fix viewport creation * readd spirv tools features * re-remove features * and add them again * CI fix * proper-resizing-and-validation-fixes * linux validation fix * fix zero height halting rendering rendering wasn't getting unpaused after being set to zero height and then made larger again * fix wgpu crash on laptops with both dedi and integrated GPUs This fix still requires the user to set their default GPU to their dedicated one. * METAL or VULKAN backend bit * rebuild pipelines after updating shaders * use spirv-builder, resolve merge conflict * fmt
This commit is contained in:
parent
a2a2e3917e
commit
bc4c07e54f
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -615,6 +615,8 @@ dependencies = [
|
||||
"ash-molten",
|
||||
"ash-window",
|
||||
"cfg-if 1.0.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"shared",
|
||||
"spirv-builder",
|
||||
"structopt",
|
||||
|
@ -13,15 +13,16 @@ use-installed-tools = ["spirv-builder/use-installed-tools"]
|
||||
use-compiled-tools = ["spirv-builder/use-compiled-tools"]
|
||||
|
||||
[dependencies]
|
||||
shared = { path = "../../shaders/shared" }
|
||||
ash = "0.31"
|
||||
ash-window = "0.5"
|
||||
cfg-if = "1.0.0"
|
||||
structopt = "0.3.20"
|
||||
winit = "0.23.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
structopt = "0.3.20"
|
||||
cfg-if = "1.0.0"
|
||||
shared = { path = "../../shaders/shared" }
|
||||
spirv-builder = { path = "../../../crates/spirv-builder", default-features = false }
|
||||
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
ash-molten = { version = "0.7", features = ["pre-built"] }
|
||||
|
||||
[build-dependencies]
|
||||
spirv-builder = { path = "../../../crates/spirv-builder", default-features = false }
|
||||
|
@ -1,10 +0,0 @@
|
||||
use spirv_builder::SpirvBuilder;
|
||||
use std::error::Error;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
// This will set the env var `sky-shader.spv` to a spir-v file that can be include!()'d
|
||||
SpirvBuilder::new("../../shaders/sky-shader")
|
||||
.spirv_version(1, 3)
|
||||
.build()?;
|
||||
Ok(())
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,7 @@ async fn run(
|
||||
swapchain_format: wgpu::TextureFormat,
|
||||
) {
|
||||
let size = window.inner_size();
|
||||
let instance = wgpu::Instance::new(wgpu::BackendBit::PRIMARY);
|
||||
let instance = wgpu::Instance::new(wgpu::BackendBit::VULKAN | wgpu::BackendBit::METAL);
|
||||
|
||||
// Wait for Resumed event on Android; the surface is only needed early to
|
||||
// find an adapter that can render to this surface.
|
||||
|
Loading…
Reference in New Issue
Block a user