Last comments and renames in the tracking module, according to the review

This commit is contained in:
Dzmitry Malyshau 2019-06-16 07:25:30 -07:00
parent 57494d6394
commit 3753309b65
4 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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)] {

View File

@ -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.