mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-29 17:44:09 +01:00
Added mark_externally_initialized to texture (#10075)
This commit is contained in:
1 parent
c5ab27023a
commit
64b9bb0e90
7 files changed
+250
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user