Function wgpu_core::track::buffer::insert_or_merge

source ·
unsafe fn insert_or_merge(
    start_states: Option<&mut [BufferUses]>,
    current_states: &mut [BufferUses],
    resource_metadata: &mut ResourceMetadata<Arc<Buffer>>,
    index32: u32,
    index: usize,
    state_provider: BufferStateProvider<'_>,
    metadata_provider: ResourceMetadataProvider<'_, Arc<Buffer>>,
) -> Result<(), ResourceUsageCompatibilityError>
Expand description

Does an insertion operation if the index isn’t tracked in the current metadata, otherwise merges the given state with the current state. If the merging would cause a conflict, returns that usage conflict.

§Safety

Indexes must be valid indexes into all arrays passed in to this function, either directly or via metadata or provider structs.