Skip to content

Commit

Permalink
Check thata bindgroup's textures are not destroyed before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
nical authored and teoxoy committed Jan 5, 2024
1 parent defd43d commit 95c451a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wgpu-core/src/binding_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,11 +847,14 @@ impl<A: HalApi> Drop for BindGroup<A> {

impl<A: HalApi> BindGroup<A> {
pub(crate) fn raw(&self, guard: &SnatchGuard) -> Option<&A::BindGroup> {
// Clippy insist on writing it this way. The idea is to return None
// if any of the raw buffer is not valid anymore.
for buffer in &self.used_buffer_ranges {
// Clippy insist on writing it this way. The idea is to return None
// if any of the raw buffer is not valid anymore.
let _ = buffer.buffer.raw(guard)?;
}
for texture in &self.used_texture_ranges {
let _ = texture.texture.raw(guard)?;
}
self.raw.as_ref()
}
pub(crate) fn validate_dynamic_bindings(
Expand Down

0 comments on commit 95c451a

Please sign in to comment.