Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ Bottom level categories:

## Unreleased

## v26.0.4 (2025-08-06)

### Bug Fixes

#### Vulkan

Fix `STATUS_HEAP_CORRUPTION` crash when concurrently calling `create_sampler`. By @atlv24 in [#8043](https://github.com/gfx-rs/wgpu/pull/8043).

## v26.0.3 (2025-07-30)

### Bug Fixes
Expand Down
12 changes: 7 additions & 5 deletions wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,19 +1404,21 @@ impl crate::Device for super::Device {
create_info = create_info.border_color(conv::map_border_color(color));
}

let raw = self
.shared
.sampler_cache
.lock()
.create_sampler(&self.shared.raw, create_info)?;
let mut sampler_cache_guard = self.shared.sampler_cache.lock();

let raw = sampler_cache_guard.create_sampler(&self.shared.raw, create_info)?;

// Note: Cached samplers will just continually overwrite the label
//
// https://github.com/gfx-rs/wgpu/issues/6867
if let Some(label) = desc.label {
// SAFETY: we are holding a lock on the sampler cache,
// so we can only be setting the name from one thread.
unsafe { self.shared.set_object_name(raw, label) };
}

drop(sampler_cache_guard);

self.counters.samplers.add(1);

Ok(super::Sampler { raw, create_info })
Expand Down
Loading