diff --git a/Cargo.lock b/Cargo.lock index d6bb92baf4..2da1f79998 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -476,7 +476,7 @@ dependencies = [ [[package]] name = "gfx-auxil" version = "0.5.0" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" dependencies = [ "fxhash", "gfx-hal", @@ -486,7 +486,7 @@ dependencies = [ [[package]] name = "gfx-backend-dx11" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" dependencies = [ "arrayvec", "bitflags", @@ -507,7 +507,7 @@ dependencies = [ [[package]] name = "gfx-backend-dx12" version = "0.6.2" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" dependencies = [ "arrayvec", "bit-set", @@ -527,7 +527,7 @@ dependencies = [ [[package]] name = "gfx-backend-empty" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" dependencies = [ "gfx-hal", "log", @@ -537,7 +537,7 @@ dependencies = [ [[package]] name = "gfx-backend-gl" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" dependencies = [ "arrayvec", "bitflags", @@ -551,7 +551,6 @@ dependencies = [ "naga", "parking_lot", "raw-window-handle", - "smallvec", "spirv_cross", "wasm-bindgen", "web-sys", @@ -560,7 +559,7 @@ dependencies = [ [[package]] name = "gfx-backend-metal" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" dependencies = [ "arrayvec", "bitflags", @@ -584,7 +583,7 @@ dependencies = [ [[package]] name = "gfx-backend-vulkan" version = "0.6.5" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" dependencies = [ "arrayvec", "ash", @@ -604,7 +603,7 @@ dependencies = [ [[package]] name = "gfx-hal" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" dependencies = [ "bitflags", "naga", @@ -768,7 +767,7 @@ dependencies = [ [[package]] name = "khronos-egl" version = "3.0.0-beta" -source = "git+https://github.com/timothee-haudebourg/khronos-egl?rev=9568b2ee3b02f2c17cc9479f824db16daecf1664#9568b2ee3b02f2c17cc9479f824db16daecf1664" +source = "git+https://github.com/timothee-haudebourg/khronos-egl?rev=4b769b8f2d068fa78db9285a8557cd11365fa314#4b769b8f2d068fa78db9285a8557cd11365fa314" dependencies = [ "libc", "libloading", @@ -1197,7 +1196,7 @@ dependencies = [ [[package]] name = "range-alloc" version = "0.1.1" -source = "git+https://github.com/gfx-rs/gfx?rev=696947377a0ce5ba8a15a2e06ff97ed69c04f00a#696947377a0ce5ba8a15a2e06ff97ed69c04f00a" +source = "git+https://github.com/gfx-rs/gfx?rev=477f17957a54d024f0077584b68e308376cb05c6#477f17957a54d024f0077584b68e308376cb05c6" [[package]] name = "raw-window-handle" diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 9a67bc386e..80bc879839 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -36,24 +36,24 @@ thiserror = "1" gpu-alloc = { git = "https://github.com/zakarumych/gpu-alloc", rev = "15f4fe2cebbd0bf9ab446757a8e370e0adf4c502", features = ["tracing"] } gpu-descriptor = { git = "https://github.com/zakarumych/gpu-descriptor", rev = "aa092613889f03f8254d6f7278d08c655324c7c7", features = ["tracing"] } -hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a" } -gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a" } +hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6" } +gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6" } [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 = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a", features = ["naga"] } -gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a", features = ["naga"] } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6", features = ["naga"] } +gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6", features = ["naga"] } [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 = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a", features = ["naga"] } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a", optional = true } +gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6", features = ["naga"] } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6", optional = true } [target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies] -gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a" } -gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a" } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a", features = ["naga"] } +gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6" } +gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6" } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6", features = ["naga"] } [target.'cfg(target_arch = "wasm32")'.dependencies] -gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "696947377a0ce5ba8a15a2e06ff97ed69c04f00a", features = ["naga"] } +gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "477f17957a54d024f0077584b68e308376cb05c6", features = ["naga"] } [dependencies.naga] git = "https://github.com/gfx-rs/naga" diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index e8ba2b5433..c529b7c464 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -555,7 +555,7 @@ impl RenderBundle { &pipeline_layout_guard[pipeline_layout_id.unwrap()].raw, index as usize, iter::once(bind_group.raw.raw()), - &offsets[..num_dynamic_offsets as usize], + offsets.iter().take(num_dynamic_offsets as usize).cloned(), ); offsets = &offsets[num_dynamic_offsets as usize..]; } diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 4450ae2cb3..f137bb86ba 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -343,7 +343,7 @@ impl Global { &pipeline_layout_guard[pipeline_layout_id].raw, index as usize, bind_groups, - &temp_offsets, + temp_offsets.iter().cloned(), ); } } diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 6dc742df47..cceefdc6d3 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -805,11 +805,15 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { let all = entry .key() .all() - .map(|(at, _)| at) + .map(|(at, _)| at.clone()) .collect::>(); - let pass = unsafe { device.raw.create_render_pass(all, iter::once(subpass), &[]) } - .unwrap(); + let pass = unsafe { + device + .raw + .create_render_pass(all, iter::once(subpass), iter::empty()) + } + .unwrap(); entry.insert(pass) } }; @@ -932,7 +936,7 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { attachments, hal::command::SubpassContents::Inline, ); - raw.set_scissors(0, iter::once(&rect)); + raw.set_scissors(0, iter::once(rect)); raw.set_viewports( 0, iter::once(hal::pso::Viewport { @@ -1135,7 +1139,7 @@ impl Global { &pipeline_layout_guard[pipeline_layout_id].raw, index as usize, bind_groups, - &temp_offsets, + temp_offsets.iter().cloned(), ); } }; diff --git a/wgpu-core/src/device/descriptor.rs b/wgpu-core/src/device/descriptor.rs index b52630b21c..891caad2bd 100644 --- a/wgpu-core/src/device/descriptor.rs +++ b/wgpu-core/src/device/descriptor.rs @@ -145,7 +145,9 @@ impl sets: &mut impl Extend, ) -> Result<(), gpu_descriptor::DeviceAllocationError> { use gpu_descriptor::DeviceAllocationError as Dae; - match hal::pso::DescriptorPool::allocate(pool, layouts, sets) { + //TODO: https://github.com/zakarumych/gpu-descriptor/pull/10 + let temp_layouts = layouts.collect::>(); + match hal::pso::DescriptorPool::allocate(pool, temp_layouts, sets) { Ok(()) => Ok(()), Err(hal::pso::AllocationError::OutOfMemory(oom)) => Err(match oom { hal::device::OutOfMemory::Host => Dae::OutOfHostMemory, diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 827b26be3d..d40168c6b3 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -1060,10 +1060,13 @@ impl Device { }; let all = key .all() - .map(|(at, _)| at) + .map(|(at, _)| at.clone()) .collect::>(); - unsafe { self.raw.create_render_pass(all, iter::once(subpass), &[]) } + unsafe { + self.raw + .create_render_pass(all, iter::once(subpass), iter::empty()) + } } fn deduplicate_bind_group_layout( diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index 355caa9cf3..d51ed3f555 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -619,20 +619,25 @@ impl Global { .raw .create_fence(false) .or(Err(DeviceError::OutOfMemory))?; - let submission = hal::queue::Submission { - command_buffers: pending_write_command_buffer.as_ref().into_iter().chain( - command_buffer_ids - .iter() - .flat_map(|&cmb_id| &command_buffer_guard.get(cmb_id).unwrap().raw), - ), - wait_semaphores: Vec::new(), - signal_semaphores: signal_swapchain_semaphores - .into_iter() - .map(|sc_id| &swap_chain_guard[sc_id].semaphore), - }; + let mut command_buffers = pending_write_command_buffer + .as_ref() + .into_iter() + .collect::>(); + for &cmd_buf_id in command_buffer_ids { + let cmd_buf = command_buffer_guard.get(cmd_buf_id).unwrap(); + command_buffers.extend(cmd_buf.raw.iter()); + } + let signal_semaphores = signal_swapchain_semaphores + .into_iter() + .map(|sc_id| &swap_chain_guard[sc_id].semaphore); unsafe { - device.queue_group.queues[0].submit(submission, Some(&mut fence)); + device.queue_group.queues[0].submit( + command_buffers, + iter::empty(), + signal_semaphores, + Some(&mut fence), + ); } fence };