don't optimize BindGroupStates.{views,samplers}

The resources inside `StatelessBindGroupState` are never merged with any other tracker.
This commit is contained in:
teoxoy 2024-08-02 18:45:52 +02:00 committed by Teodor Tanasoaia
parent 3a5ad193db
commit a3142ade91
2 changed files with 0 additions and 11 deletions

View File

@ -444,8 +444,6 @@ impl<A: HalApi> BindGroupStates<A> {
pub fn optimize(&mut self) {
self.buffers.optimize();
self.textures.optimize();
self.views.optimize();
self.samplers.optimize();
}
}

View File

@ -20,15 +20,6 @@ impl<T: Trackable> StatelessBindGroupState<T> {
}
}
/// Optimize the buffer bind group state by sorting it by ID.
///
/// When this list of states is merged into a tracker, the memory
/// accesses will be in a constant ascending order.
pub(crate) fn optimize(&mut self) {
self.resources
.sort_unstable_by_key(|resource| resource.tracker_index());
}
/// Adds the given resource.
pub fn add_single(&mut self, resource: &Arc<T>) {
self.resources.push(resource.clone());