mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2025-02-16 17:12:29 +00:00
Use SmallVec::truncate in state_cacher (#770)
This commit is contained in:
parent
1640220ebf
commit
f13454dc6e
@ -13,7 +13,7 @@ build = "build.rs"
|
||||
crossbeam = "0.2.10"
|
||||
fnv = "1.0.5"
|
||||
shared_library = "0.1.5"
|
||||
smallvec = "0.3.1"
|
||||
smallvec = "0.4.3"
|
||||
lazy_static = "0.2.2"
|
||||
vk-sys = { version = "0.3.1", path = "../vk-sys" }
|
||||
half = "1"
|
||||
|
@ -272,15 +272,8 @@ impl<'s> StateCacherDescriptorSets<'s> {
|
||||
#[inline]
|
||||
pub fn compare(self) -> Option<u32> {
|
||||
*self.poisonned = false;
|
||||
|
||||
// Removing from the cache any set that wasn't added with `add`.
|
||||
if self.offset < self.state.len() {
|
||||
// TODO: SmallVec doesn't provide any method for this
|
||||
for _ in self.offset .. self.state.len() {
|
||||
self.state.remove(self.offset);
|
||||
}
|
||||
}
|
||||
|
||||
self.state.truncate(self.offset);
|
||||
self.found_diff
|
||||
}
|
||||
}
|
||||
@ -346,12 +339,7 @@ impl<'s> StateCacherVertexBuffers<'s> {
|
||||
*self.poisonned = false;
|
||||
|
||||
// Removing from the cache any set that wasn't added with `add`.
|
||||
if self.offset < self.state.len() {
|
||||
// TODO: SmallVec doesn't provide any method for this
|
||||
for _ in self.offset .. self.state.len() {
|
||||
self.state.remove(self.offset);
|
||||
}
|
||||
}
|
||||
self.state.truncate(self.offset);
|
||||
|
||||
self.first_diff.map(|first| {
|
||||
debug_assert!(first <= self.last_diff);
|
||||
|
Loading…
Reference in New Issue
Block a user