summaryrefslogtreecommitdiffstats
path: root/third_party/rust/wgpu-core/src/track/texture.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /third_party/rust/wgpu-core/src/track/texture.rs
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--third_party/rust/wgpu-core/src/track/texture.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/third_party/rust/wgpu-core/src/track/texture.rs b/third_party/rust/wgpu-core/src/track/texture.rs
index e7c4707c93..3cf95ff38a 100644
--- a/third_party/rust/wgpu-core/src/track/texture.rs
+++ b/third_party/rust/wgpu-core/src/track/texture.rs
@@ -210,6 +210,7 @@ pub(crate) struct TextureStateSet {
simple: Vec<TextureUses>,
complex: FastHashMap<usize, ComplexTextureState>,
}
+
impl TextureStateSet {
fn new() -> Self {
Self {
@@ -235,15 +236,16 @@ pub(crate) struct TextureUsageScope<A: HalApi> {
metadata: ResourceMetadata<Texture<A>>,
}
-impl<A: HalApi> TextureUsageScope<A> {
- pub fn new() -> Self {
+impl<A: HalApi> Default for TextureUsageScope<A> {
+ fn default() -> Self {
Self {
set: TextureStateSet::new(),
-
metadata: ResourceMetadata::new(),
}
}
+}
+impl<A: HalApi> TextureUsageScope<A> {
fn tracker_assert_in_bounds(&self, index: usize) {
self.metadata.tracker_assert_in_bounds(index);
@@ -258,6 +260,11 @@ impl<A: HalApi> TextureUsageScope<A> {
});
}
+ pub fn clear(&mut self) {
+ self.set.clear();
+ self.metadata.clear();
+ }
+
/// Sets the size of all the vectors inside the tracker.
///
/// Must be called with the highest possible Texture ID before