diff --git a/Cargo.lock b/Cargo.lock index 9ce5e285a8..259490e1b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -470,8 +470,7 @@ dependencies = [ [[package]] name = "gfx-descriptor" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf35f5d66d1bc56e63e68d7528441453f25992bd954b84309d23c659df2c5da" +source = "git+https://github.com/gfx-rs/gfx-extras?rev=438353c3f75368c12024ad2fc03cbeb15f351fd9#438353c3f75368c12024ad2fc03cbeb15f351fd9" dependencies = [ "fxhash", "gfx-hal", diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 823400677c..8e35c36345 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -24,7 +24,6 @@ fxhash = "0.2" log = "0.4" hal = { package = "gfx-hal", version = "0.5.2" } gfx-backend-empty = "0.5" -gfx-descriptor = "0.1" parking_lot = "0.10" peek-poke = "0.2" raw-window-handle = { version = "0.3", optional = true } @@ -38,6 +37,10 @@ vec_map = "0.8.1" git = "https://github.com/gfx-rs/naga" rev = "e3aea9619865b16a24164d46ab29cca36ad7daf2" +[dependencies.gfx-descriptor] +git = "https://github.com/gfx-rs/gfx-extras" +rev = "438353c3f75368c12024ad2fc03cbeb15f351fd9" + [dependencies.gfx-memory] git = "https://github.com/gfx-rs/gfx-extras" rev = "438353c3f75368c12024ad2fc03cbeb15f351fd9" diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 45834a02ad..a12bc34ae1 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -1408,7 +1408,7 @@ impl Global { let bind_group_layout = &bind_group_layout_guard[desc.layout]; assert_eq!(desc.bindings.len(), bind_group_layout.entries.len(), "Bind group has {} entries and bind group layout has {} entries, they should be the same.", desc.bindings.len(), bind_group_layout.entries.len()); - let desc_set = unsafe { + let mut desc_set = unsafe { let mut desc_sets = ArrayVec::<[_; 1]>::new(); device .desc_allocator @@ -1424,14 +1424,18 @@ impl Global { desc_sets.pop().unwrap() }; - if let Some(..) = desc.label { - //TODO: https://github.com/gfx-rs/gfx-extras/pull/5 - //unsafe { - // let label = ffi::CStr::from_ptr(desc.label).to_string_lossy(); - // device.raw.set_descriptor_set_name(desc_set.raw_mut(), &label); - //} + // Set the descriptor set's label for easier debugging. + if let Some(label) = desc.label { + unsafe { + device + .raw + .set_descriptor_set_name(desc_set.raw_mut(), &label); + } } + // Rebind `desc_set` as immutable + let desc_set = desc_set; + // fill out the descriptors let mut used = TrackerSet::new(B::VARIANT); {