clear_texture

Function clear_texture 

Source
pub(crate) fn clear_texture<T: TextureTrackerSetSingle>(
    dst_texture: &Arc<Texture>,
    range: TextureInitRange,
    depth_slice: Option<u32>,
    encoder: &mut dyn DynCommandEncoder,
    texture_tracker: &mut T,
    alignments: &Alignments,
    zero_buffer: &dyn DynBuffer,
    snatch_guard: &SnatchGuard<'_>,
    instance_flags: InstanceFlags,
) -> Result<(), ClearError>
Expand description

Encode a texture clear operation.

This function encodes a texture clear operation without validating it. Texture clears requested via the API call this function via clear_texture_cmd, which does the validation. This function is also called directly from various places within wgpu that need to clear a texture.

For a 3D texture:

  • If depth_slice is Some, clear only that depth slice (in this case, range.mip_range must be a single mip level).
  • If depth_slice is None, clear entire mip level(s).