pub struct cp_drawable_render_context { /* private fields */ }drawable_render_context only.Expand description
Implementations§
Source§impl cp_drawable_render_context
impl cp_drawable_render_context
Sourcepub unsafe fn draw_mask_on_stencil_attachment(
render_context: cp_drawable_render_context_t,
command_encoder: &ProtocolObject<dyn MTLRenderCommandEncoder>,
value: u8,
)
Available on crate feature objc2-metal only.
pub unsafe fn draw_mask_on_stencil_attachment( render_context: cp_drawable_render_context_t, command_encoder: &ProtocolObject<dyn MTLRenderCommandEncoder>, value: u8, )
objc2-metal only.Store the value parameter in the stencil texture in the pixels that Compositor
will display on the screen.
-
Parameters:
-
render_context: The render context to use to present the drawable.
-
command_encoder: The command encoder to use to render the Compositor effects and present the drawable.
-
value: The value to use when updating the stencil texture in the command_encoder.
-
Note: In Full and Mixed immersion style, this will be the full texture.
-
Note: The command encoder used in the render context has the following constraints:
-
stencil texture: should have the same pixel format as
cp_layer_renderer_configuration_get_drawable_render_context_stencil_format -
renderTargetArrayLength: should be the same as the number of views in the drawable.
-
rasterizationRateMap: should be the one provided by the drawable.
-
layer renderer layout: Dedicated and Shared layout is not supported.
-
Note: If the render encoder has multiple color attachments then set
supportColorAttachmentMappingto true to avoid Metal API validation errors. This API is not available on simulator; as a workaround, either disable API validation or separate the rendering into multiple render encoders for other color attachments. -
Note: This function will modify the depth stencil state, the viewports, the vertex amplification count and some of the texture bindings in the render command encoder passed to the function. Make sure to set those values again to the ones expected in your application.
§Safety
render_context must be a valid pointer.
Sourcepub unsafe fn end_encoding(
render_context: cp_drawable_render_context_t,
command_encoder: &ProtocolObject<dyn MTLRenderCommandEncoder>,
)
Available on crate feature objc2-metal only.
pub unsafe fn end_encoding( render_context: cp_drawable_render_context_t, command_encoder: &ProtocolObject<dyn MTLRenderCommandEncoder>, )
objc2-metal only.Finish encoding the render context.
-
Parameters:
-
render_context: The render context to use to present the drawable.
-
command_encoder: The command encoder to use to render the Compositor effects and present the drawable.
-
Note: The ownership of the command encoder is passed to the drawable render context, which will call endEncoding on the command encoder.
-
Note: The command encoder used in the render context has the following constraints:
-
color texture: colorAttachment[0] should contain the color texture provided by the drawable.
-
depth texture: depthAttachment should contain the depth texture provided by the drawable.
-
renderTargetArrayLength: should be the same as the number of views in the drawable.
-
rasterizationRateMap: should be the one provided by the drawable.
-
layer renderer layout: Dedicated and Shared layout is not supported.
-
Note: If the render encoder has multiple color attachments then set
supportColorAttachmentMappingto true to avoid Metal API validation errors. This API is not available on simulator; as a workaround, either disable API validation or separate the rendering into multiple render encoders for other color attachments.
§Safety
render_context must be a valid pointer.
Sourcepub unsafe fn mtl4_draw_mask_on_stencil_attachment(
render_context: cp_drawable_render_context_t,
command_encoder: &ProtocolObject<dyn MTL4RenderCommandEncoder>,
value: u8,
)
Available on crate feature objc2-metal only.
pub unsafe fn mtl4_draw_mask_on_stencil_attachment( render_context: cp_drawable_render_context_t, command_encoder: &ProtocolObject<dyn MTL4RenderCommandEncoder>, value: u8, )
objc2-metal only.Store the value parameter in the stencil texture in the pixels that Compositor
will display on the screen.
-
Parameters:
-
render_context: The render context to use to present the drawable.
-
command_encoder: The command encoder to use to render the Compositor effects and present the drawable.
-
value: The value to use when updating the stencil texture in the command_encoder.
-
Note: In Full and Mixed immersion style, this will be the full texture.
-
Note: The command encoder used in the render context has the following constraints:
-
stencil texture: should have the same pixel format as
cp_layer_renderer_configuration_get_drawable_render_context_stencil_format -
renderTargetArrayLength: should be the same as the number of views in the drawable.
-
rasterizationRateMap: should be the one provided by the drawable.
-
layer renderer layout: Dedicated and Shared layout is not supported.
-
Note: If the render encoder has multiple color attachments then set
supportColorAttachmentMappingto true to avoid Metal API validation errors. This API is not available on simulator; as a workaround, either disable API validation or separate the rendering into multiple render encoders for other color attachments. -
Note: This function will modify the depth stencil state, the viewports, the vertex amplification count and some of the texture bindings in the render command encoder passed to the function. Make sure to set those values again to the ones expected in your application.
§Safety
render_context must be a valid pointer.
Sourcepub unsafe fn mtl4_end_encoding(
render_context: cp_drawable_render_context_t,
command_encoder: &ProtocolObject<dyn MTL4RenderCommandEncoder>,
)
Available on crate feature objc2-metal only.
pub unsafe fn mtl4_end_encoding( render_context: cp_drawable_render_context_t, command_encoder: &ProtocolObject<dyn MTL4RenderCommandEncoder>, )
objc2-metal only.Finish encoding the render context.
-
Parameters:
-
render_context: The render context to use to present the drawable.
-
command_encoder: The command encoder to use to render the Compositor effects and present the drawable.
-
Note: The ownership of the command encoder is passed to the drawable render context, which will call endEncoding on the command encoder.
-
Note: The command encoder used in the render context has the following constraints:
-
color texture: colorAttachment[0] should contain the color texture provided by the drawable.
-
depth texture: depthAttachment should contain the depth texture provided by the drawable.
-
renderTargetArrayLength: should be the same as the number of views in the drawable.
-
rasterizationRateMap: should be the one provided by the drawable.
-
layer renderer layout: Dedicated and Shared layout is not supported.
-
Note: If the render encoder has multiple color attachments then set
supportColorAttachmentMappingto true to avoid Metal API validation errors. This API is not available on simulator; as a workaround, either disable API validation or separate the rendering into multiple render encoders for other color attachments.
§Safety
render_context must be a valid pointer.