diff --git a/Cargo.lock b/Cargo.lock index 0b943af0c..d2a7380cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -465,7 +465,7 @@ dependencies = [ [[package]] name = "gfx-auxil" version = "0.8.0" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" dependencies = [ "fxhash", "gfx-hal", @@ -475,7 +475,7 @@ dependencies = [ [[package]] name = "gfx-backend-dx11" version = "0.7.0" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" dependencies = [ "arrayvec", "bitflags", @@ -496,7 +496,7 @@ dependencies = [ [[package]] name = "gfx-backend-dx12" version = "0.7.0" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" dependencies = [ "arrayvec", "bit-set", @@ -517,7 +517,7 @@ dependencies = [ [[package]] name = "gfx-backend-empty" version = "0.7.0" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" dependencies = [ "gfx-hal", "log", @@ -527,7 +527,7 @@ dependencies = [ [[package]] name = "gfx-backend-gl" version = "0.7.0" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" dependencies = [ "arrayvec", "bitflags", @@ -550,7 +550,7 @@ dependencies = [ [[package]] name = "gfx-backend-metal" version = "0.7.0" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" dependencies = [ "arrayvec", "bitflags", @@ -576,7 +576,7 @@ dependencies = [ [[package]] name = "gfx-backend-vulkan" version = "0.7.0" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" dependencies = [ "arrayvec", "ash", @@ -596,7 +596,7 @@ dependencies = [ [[package]] name = "gfx-hal" version = "0.7.0" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" dependencies = [ "bitflags", "naga", @@ -1172,7 +1172,7 @@ dependencies = [ [[package]] name = "range-alloc" version = "0.1.2" -source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e" +source = "git+https://github.com/gfx-rs/gfx?rev=32684a7da923cfd661fe4d3003f4275270e9c40d#32684a7da923cfd661fe4d3003f4275270e9c40d" [[package]] name = "raw-window-handle" diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index c50d2969e..cd338d8ac 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -40,24 +40,24 @@ thiserror = "1" gpu-alloc = { git = "https://github.com/zakarumych/gpu-alloc.git", rev = "2cd1ad650cdd24d1647b6041f77ced0cbf1ff2a6" } gpu-descriptor = { version = "0.1" } -hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e" } -gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e" } +hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d" } +gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d" } [target.'cfg(all(not(target_arch = "wasm32"), all(unix, not(target_os = "ios"), not(target_os = "macos"))))'.dependencies] -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e", features = ["naga"] } -gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e" } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d", features = ["naga"] } +gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d" } [target.'cfg(all(not(target_arch = "wasm32"), any(target_os = "ios", target_os = "macos")))'.dependencies] -gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e" } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e", optional = true } +gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d" } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d", optional = true } [target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies] -gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e" } -gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e" } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e", features = ["naga"] } +gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d" } +gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d" } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d", features = ["naga"] } [target.'cfg(target_arch = "wasm32")'.dependencies] -gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "46735bb079997257b4e5d8e813e6ed9c71aefd3e" } +gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "32684a7da923cfd661fe4d3003f4275270e9c40d" } [dependencies.naga] git = "https://github.com/gfx-rs/naga" diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 1e90af6cb..e0c0f7eab 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -989,6 +989,7 @@ impl Device { // First, try to produce a Naga module. let (spv, module) = match source { pipeline::ShaderModuleSource::SpirV(spv) => { + profiling::scope!("naga::spv::parse"); // Parse the given shader code and store its representation. let options = naga::front::spv::Options { adjust_coordinate_space: false, // we require NDC_Y_UP feature @@ -1010,6 +1011,7 @@ impl Device { (Some(spv), module) } pipeline::ShaderModuleSource::Wgsl(code) => { + profiling::scope!("naga::wgsl::parse_str"); // TODO: refactor the corresponding Naga error to be owned, and then // display it instead of unwrapping match naga::front::wgsl::parse_str(&code) { @@ -1026,6 +1028,7 @@ impl Device { let (naga_result, interface) = match module { // If succeeded, then validate it and attempt to give it to gfx-hal directly. Some(module) if desc.flags.contains(wgt::ShaderFlags::VALIDATION) || spv.is_none() => { + profiling::scope!("naga::validate"); let info = naga::valid::Validator::new(naga::valid::ValidationFlags::all()) .validate(&module)?; if !self.features.contains(wgt::Features::PUSH_CONSTANTS) @@ -1069,6 +1072,7 @@ impl Device { Some(data) => Ok(data), None => { // Produce a SPIR-V from the Naga module + profiling::scope!("naga::wpv::write_vec"); let shader = maybe_shader.unwrap(); naga::back::spv::write_vec(&shader.module, &shader.info, &self.spv_options) .map(Cow::Owned) diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index 622019fff..e01fbfe79 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -642,6 +642,8 @@ impl Global { let (mut command_buffer_guard, mut token) = hub.command_buffers.write(&mut token); if !command_buffer_ids.is_empty() { + profiling::scope!("submit preparation"); + let (render_bundle_guard, mut token) = hub.render_bundles.read(&mut token); let (_, mut token) = hub.pipeline_layouts.read(&mut token); let (bind_group_guard, mut token) = hub.bind_groups.read(&mut token);