Added mark_externally_initialized to texture (#10075)

This commit is contained in:
Robin Cramer authored and GitHub committed 2026-08-31 10:21:25 -04:00
1 parent c5ab27023a
commit 64b9bb0e90
7 files changed
+250

No files matched your search

+13
View File
@@ -2196,6 +2196,19 @@ impl Texture {
pub fn descriptor(&self) -> &wgt::TextureDescriptor<String, Vec<wgt::TextureFormat>> {
&self.desc
}
/// Marks the texture's entire contents as already initialized,
/// skipping wgpu-core's lazy zero-initialization of it.
///
/// # Safety
///
/// The entire contents of the texture must already be initialized.
pub unsafe fn mark_externally_initialized(&self) {
let mut initialization_status = self.initialization_status.write();
for mip_tracker in initialization_status.mips.iter_mut() {
mip_tracker.drain(0..self.desc.array_layer_count());
}
}
}
/// A texture that has been marked as destroyed and is staged for actual deletion soon.