Check thata bindgroup's textures are not destroyed before using it

This commit is contained in:
Nicolas Silva authored and Teodor Tanasoaia committed 2024-01-05 11:42:28 +01:00
1 parent defd43dff2
commit 95c451a3b8
1 file changed
+5 -2
+5 -2
View File
@@ -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(