Function wgpu_core::track::texture::insert_or_barrier_update
source · unsafe fn insert_or_barrier_update(
texture_selector: &TextureSelector,
start_state: Option<&mut TextureStateSet>,
current_state_set: &mut TextureStateSet,
resource_metadata: &mut ResourceMetadata<Arc<Texture>>,
index: usize,
start_state_provider: TextureStateProvider<'_>,
end_state_provider: Option<TextureStateProvider<'_>>,
metadata_provider: ResourceMetadataProvider<'_, Arc<Texture>>,
barriers: &mut Vec<PendingTransition<TextureUses>>,
)
Expand description
If the resource isn’t tracked
- Inserts the given resource.
- Uses the
start_state_provider
to populatestart_states
- Uses either
end_state_provider
orstart_state_provider
to populatecurrent_states
.
If the resource is tracked
- Inserts barriers from the state in
current_states
to the state provided bystart_state_provider
. - Updates the
current_states
with either the state fromend_state_provider
orstart_state_provider
.
Any barriers are added to the barrier vector.
§Safety
Indexes must be valid indexes into all arrays passed in to this function, either directly or via metadata or provider structs.