add comments in BindGroupStates.optimize

This commit is contained in:
teoxoy 2024-08-03 11:42:43 +02:00 committed by Teodor Tanasoaia
parent 4e777bd0e7
commit 7b4cbc2619

View File

@ -441,7 +441,11 @@ impl<A: HalApi> BindGroupStates<A> {
/// accesses will be in a constant ascending order. /// accesses will be in a constant ascending order.
pub fn optimize(&mut self) { pub fn optimize(&mut self) {
self.buffers.optimize(); self.buffers.optimize();
// Views are stateless, however, `TextureViewBindGroupState`
// is special as it will be merged with other texture trackers.
self.views.optimize(); self.views.optimize();
// Samplers are stateless and don't need to be optimized
// since the tracker is never merged with any other tracker.
} }
} }