#[repr(C)]pub struct cp_view_texture_map { /* private fields */ }view only.Expand description
Implementations§
Source§impl cp_view_texture_map
impl cp_view_texture_map
Sourcepub unsafe fn texture_index(view_texture_map: cp_view_texture_map_t) -> usize
pub unsafe fn texture_index(view_texture_map: cp_view_texture_map_t) -> usize
Returns the index of the view’s textures in the drawable.
- Parameters:
- view_texture_map: The texture map for your view.
- Returns: The index of the color or depth texture in the drawable.
Pass the returned index to the cp_drawable_get_color_texture
or cp_drawable_get_depth_texture function.
Sourcepub unsafe fn slice_index(view_texture_map: cp_view_texture_map_t) -> usize
pub unsafe fn slice_index(view_texture_map: cp_view_texture_map_t) -> usize
Returns the index of the view’s texture in an array-based texture type.
- Parameters:
- view_texture_map: The texture map for your view.
- Returns: The index of the view’s texture in an array-based texture type.
Use the returned index to retrieve the view’s texture when the texture type is <doc ://com.apple.documentation/documentation/metal/mtltexturetype/type2darray>. When configuring your render pass descriptor, specify the index in the <doc ://com.apple.documentation/documentation/metal/mtlrenderpassattachmentdescriptor/1437914-slice> property of the descriptor’s color and depth attachments.
To request an array-based texture from your layer, configure your layer
with the cp_layer_renderer_layout/cp_layer_renderer_layout_dedicated layout option.
Sourcepub unsafe fn viewport(view_texture_map: cp_view_texture_map_t) -> MTLViewport
Available on crate feature objc2-metal only.
pub unsafe fn viewport(view_texture_map: cp_view_texture_map_t) -> MTLViewport
objc2-metal only.Returns the portion of the texture that the view uses to draw its content.
- Parameters:
- view_texture_map: The texture map for your view.
- Returns: A Metal viewport that specifies the view’s size and location in the texture.
Call this function to get the size of the view and its location within the texture. If the layer dedicates a separate texture to each view, the texture bounds and view bounds match. However, if the layer uses a shared or layered texture, the view’s location or other slice index might differ.