mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-22 20:03:11 +00:00
Last comments and renames in the tracking module, according to the review
This commit is contained in:
parent
57494d6394
commit
3753309b65
@ -40,7 +40,7 @@ pub struct TextureCopyView {
|
||||
}
|
||||
|
||||
impl TextureCopyView {
|
||||
//TODO: we currently access each texture twice for a transer,
|
||||
//TODO: we currently access each texture twice for a transfer,
|
||||
// once only to get the aspect flags, which is unfortunate.
|
||||
fn to_selector(&self, aspects: hal::format::Aspects) -> hal::image::SubresourceRange {
|
||||
let level = self.mip_level as hal::image::Level;
|
||||
|
@ -241,7 +241,7 @@ impl<S: ResourceState> ResourceTracker<S> {
|
||||
|
||||
/// Make sure that a resource is tracked, and return a mutable
|
||||
/// reference to it.
|
||||
fn grab<'a>(
|
||||
fn get_or_insert<'a>(
|
||||
map: &'a mut FastHashMap<Index, Resource<S>>,
|
||||
id: S::Id,
|
||||
ref_count: &RefCount,
|
||||
@ -271,7 +271,7 @@ impl<S: ResourceState> ResourceTracker<S> {
|
||||
selector: S::Selector,
|
||||
usage: S::Usage,
|
||||
) -> Result<(), PendingTransition<S>> {
|
||||
Self::grab(&mut self.map, id, ref_count)
|
||||
Self::get_or_insert(&mut self.map, id, ref_count)
|
||||
.state.change(id, selector, usage, None)
|
||||
}
|
||||
|
||||
@ -283,13 +283,13 @@ impl<S: ResourceState> ResourceTracker<S> {
|
||||
selector: S::Selector,
|
||||
usage: S::Usage,
|
||||
) -> Drain<PendingTransition<S>> {
|
||||
let res = Self::grab(&mut self.map, id, ref_count);
|
||||
let res = Self::get_or_insert(&mut self.map, id, ref_count);
|
||||
res.state.change(id, selector, usage, Some(&mut self.temp))
|
||||
.ok(); //TODO: unwrap?
|
||||
self.temp.drain(..)
|
||||
}
|
||||
|
||||
/// Merge another tacker into `self` by extending the current states
|
||||
/// Merge another tracker into `self` by extending the current states
|
||||
/// without any transitions.
|
||||
pub fn merge_extend(
|
||||
&mut self, other: &Self,
|
||||
@ -309,7 +309,7 @@ impl<S: ResourceState> ResourceTracker<S> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Merge another tacker, adding it's transitions to `self`.
|
||||
/// Merge another tracker, adding it's transitions to `self`.
|
||||
/// Transitions the current usage to the new one.
|
||||
pub fn merge_replace<'a>(
|
||||
&'a mut self,
|
||||
|
@ -103,7 +103,7 @@ impl<I: Copy + PartialOrd, T: Copy + PartialEq> RangedStates<I, T> {
|
||||
}
|
||||
|
||||
/// Split the storage ranges in such a way that there is a linear subset of
|
||||
/// them occuping exactly `index` range, which is returned mutably.
|
||||
/// them occupying exactly `index` range, which is returned mutably.
|
||||
///
|
||||
/// Gaps in the ranges are filled with `default` value.
|
||||
pub fn isolate(&mut self, index: &Range<I>, default: T) -> &mut [(Range<I>, T)] {
|
||||
|
@ -35,7 +35,7 @@ impl PendingTransition<TextureState> {
|
||||
}
|
||||
|
||||
//TODO: make this less awkward!
|
||||
/// Check for the validity of `self` with regards to the presense of `output`.
|
||||
/// Check for the validity of `self` with regards to the presence of `output`.
|
||||
///
|
||||
/// Return the end usage if the `output` is provided and pushes self to it.
|
||||
/// Otherwise, return the extended usage, or an error if extension is impossible.
|
||||
|
Loading…
Reference in New Issue
Block a user