mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
fix STATUS_HEAP_CORRUPTION crash in create_sampler (#8043)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
This commit is contained in:
parent
a1168613d2
commit
7cb642eba7
@ -63,6 +63,12 @@ By @Vecvec in [#7913](https://github.com/gfx-rs/wgpu/pull/7913).
|
|||||||
|
|
||||||
Naga now requires that no type be larger than 1 GB. This limit may be lowered in the future; feedback on an appropriate value for the limit is welcome. By @andyleiserson in [#7950](https://github.com/gfx-rs/wgpu/pull/7950).
|
Naga now requires that no type be larger than 1 GB. This limit may be lowered in the future; feedback on an appropriate value for the limit is welcome. By @andyleiserson in [#7950](https://github.com/gfx-rs/wgpu/pull/7950).
|
||||||
|
|
||||||
|
### 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.2 (2025-07-23)
|
## v26.0.2 (2025-07-23)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@ -1404,19 +1404,21 @@ impl crate::Device for super::Device {
|
|||||||
create_info = create_info.border_color(conv::map_border_color(color));
|
create_info = create_info.border_color(conv::map_border_color(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
let raw = self
|
let mut sampler_cache_guard = self.shared.sampler_cache.lock();
|
||||||
.shared
|
|
||||||
.sampler_cache
|
let raw = sampler_cache_guard.create_sampler(&self.shared.raw, create_info)?;
|
||||||
.lock()
|
|
||||||
.create_sampler(&self.shared.raw, create_info)?;
|
|
||||||
|
|
||||||
// Note: Cached samplers will just continually overwrite the label
|
// Note: Cached samplers will just continually overwrite the label
|
||||||
//
|
//
|
||||||
// https://github.com/gfx-rs/wgpu/issues/6867
|
// https://github.com/gfx-rs/wgpu/issues/6867
|
||||||
if let Some(label) = desc.label {
|
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) };
|
unsafe { self.shared.set_object_name(raw, label) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drop(sampler_cache_guard);
|
||||||
|
|
||||||
self.counters.samplers.add(1);
|
self.counters.samplers.add(1);
|
||||||
|
|
||||||
Ok(super::Sampler { raw, create_info })
|
Ok(super::Sampler { raw, create_info })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user