Struct PipelineStateRenderPass
pub struct PipelineStateRenderPass(/* private fields */);Expand description
Use the Pipeline State Render Pass to set for its child render passes the depth and stencil testing, transparency, and culling. This render pass sets the rendering state before passing the control to its descendants. After the descendant render passes of a Pipeline State Render Pass execute, Kanzi restores the rendering state. If a Pipeline State Render Pass does not have any descendants, Kanzi does not apply the rendering state you set in that render pass.
You change the rendering state by setting the properties in a Pipeline State Render Pass. The default settings in a Pipeline State Render Pass that you can set are:
- BlendModeProperty property is set to Premultiplied alpha
- ColorWriteModeProperty property is set to RGBA
- Depth test is enabled and DepthTestFunctionProperty is set to Less
- DepthWriteEnabledProperty property is enabled
- CullModeProperty property is enabled and set to Back
- StencilTestFunctionProperty property is disabled
- ViewportProperty property is set to the complete size of Viewport2D node or of the current composition target set by a CompositionTargetRenderPass
- ScissorProperty property is disabled, unless the current Viewport2D node does not fill the whole composition target area
- PolygonDepthOffsetProperty property is not set.
Kanzi groups the rendering state combinations that a Pipeline State Render Pass applies into these state stacks:
- Color and blend state
- Depth and stencil state
- Composition (viewport and scissor) state
- Rasterization state
If you do not set a property, Kanzi uses the default or previously set value. See CompositionStack.
§Examples
To turn on stencil test and only render where stencil buffer value is not 0:
To render only the back faces of objects:
To turn off alpha blending:
Implementations§
§impl PipelineStateRenderPass
impl PipelineStateRenderPass
pub fn get_blend_mode(&self) -> Result<i32, Error>
pub fn get_blend_mode(&self) -> Result<i32, Error>
See: BLEND_MODE_PROPERTY
pub fn set_blend_mode(&self, value: i32) -> Result<(), Error>
pub fn set_blend_mode(&self, value: i32) -> Result<(), Error>
See: BLEND_MODE_PROPERTY
pub fn get_color_write_mode(&self) -> Result<GraphicsColorWriteMode, Error>
pub fn get_color_write_mode(&self) -> Result<GraphicsColorWriteMode, Error>
pub fn set_color_write_mode(
&self,
value: GraphicsColorWriteMode,
) -> Result<(), Error>
pub fn set_color_write_mode( &self, value: GraphicsColorWriteMode, ) -> Result<(), Error>
pub fn get_cull_mode(&self) -> Result<GraphicsCullMode, Error>
pub fn get_cull_mode(&self) -> Result<GraphicsCullMode, Error>
See: CULL_MODE_PROPERTY
pub fn set_cull_mode(&self, value: GraphicsCullMode) -> Result<(), Error>
pub fn set_cull_mode(&self, value: GraphicsCullMode) -> Result<(), Error>
See: CULL_MODE_PROPERTY
pub fn get_depth_test_function(&self) -> Result<GraphicsCompareFunction, Error>
pub fn get_depth_test_function(&self) -> Result<GraphicsCompareFunction, Error>
pub fn set_depth_test_function(
&self,
value: GraphicsCompareFunction,
) -> Result<(), Error>
pub fn set_depth_test_function( &self, value: GraphicsCompareFunction, ) -> Result<(), Error>
pub fn get_depth_write_enabled(&self) -> Result<bool, Error>
pub fn get_depth_write_enabled(&self) -> Result<bool, Error>
pub fn set_depth_write_enabled(&self, value: bool) -> Result<(), Error>
pub fn set_depth_write_enabled(&self, value: bool) -> Result<(), Error>
pub fn get_viewport(&self) -> Result<Vector4, Error>
pub fn get_viewport(&self) -> Result<Vector4, Error>
See: VIEWPORT_PROPERTY
pub fn set_viewport(&self, value: Vector4) -> Result<(), Error>
pub fn set_viewport(&self, value: Vector4) -> Result<(), Error>
See: VIEWPORT_PROPERTY
pub fn get_viewport_mode(&self) -> Result<ViewportMode, Error>
pub fn get_viewport_mode(&self) -> Result<ViewportMode, Error>
pub fn set_viewport_mode(&self, value: ViewportMode) -> Result<(), Error>
pub fn set_viewport_mode(&self, value: ViewportMode) -> Result<(), Error>
pub fn get_scissor(&self) -> Result<Vector4, Error>
pub fn get_scissor(&self) -> Result<Vector4, Error>
See: SCISSOR_PROPERTY
pub fn set_scissor(&self, value: Vector4) -> Result<(), Error>
pub fn set_scissor(&self, value: Vector4) -> Result<(), Error>
See: SCISSOR_PROPERTY
pub fn get_scissor_mode(&self) -> Result<ViewportMode, Error>
pub fn get_scissor_mode(&self) -> Result<ViewportMode, Error>
pub fn set_scissor_mode(&self, value: ViewportMode) -> Result<(), Error>
pub fn set_scissor_mode(&self, value: ViewportMode) -> Result<(), Error>
pub fn get_stencil_test_function(
&self,
) -> Result<GraphicsCompareFunction, Error>
pub fn get_stencil_test_function( &self, ) -> Result<GraphicsCompareFunction, Error>
pub fn set_stencil_test_function(
&self,
value: GraphicsCompareFunction,
) -> Result<(), Error>
pub fn set_stencil_test_function( &self, value: GraphicsCompareFunction, ) -> Result<(), Error>
pub fn get_stencil_reference_value(&self) -> Result<i32, Error>
pub fn get_stencil_reference_value(&self) -> Result<i32, Error>
pub fn set_stencil_reference_value(&self, value: i32) -> Result<(), Error>
pub fn set_stencil_reference_value(&self, value: i32) -> Result<(), Error>
pub fn get_stencil_mask(&self) -> Result<i32, Error>
pub fn get_stencil_mask(&self) -> Result<i32, Error>
pub fn set_stencil_mask(&self, value: i32) -> Result<(), Error>
pub fn set_stencil_mask(&self, value: i32) -> Result<(), Error>
pub fn get_stencil_fail_operation(
&self,
) -> Result<GraphicsStencilOperation, Error>
pub fn get_stencil_fail_operation( &self, ) -> Result<GraphicsStencilOperation, Error>
pub fn set_stencil_fail_operation(
&self,
value: GraphicsStencilOperation,
) -> Result<(), Error>
pub fn set_stencil_fail_operation( &self, value: GraphicsStencilOperation, ) -> Result<(), Error>
pub fn get_stencil_pass_depth_fail_operation(
&self,
) -> Result<GraphicsStencilOperation, Error>
pub fn get_stencil_pass_depth_fail_operation( &self, ) -> Result<GraphicsStencilOperation, Error>
pub fn set_stencil_pass_depth_fail_operation(
&self,
value: GraphicsStencilOperation,
) -> Result<(), Error>
pub fn set_stencil_pass_depth_fail_operation( &self, value: GraphicsStencilOperation, ) -> Result<(), Error>
pub fn get_stencil_pass_depth_pass_operation(
&self,
) -> Result<GraphicsStencilOperation, Error>
pub fn get_stencil_pass_depth_pass_operation( &self, ) -> Result<GraphicsStencilOperation, Error>
pub fn set_stencil_pass_depth_pass_operation(
&self,
value: GraphicsStencilOperation,
) -> Result<(), Error>
pub fn set_stencil_pass_depth_pass_operation( &self, value: GraphicsStencilOperation, ) -> Result<(), Error>
pub fn get_stencil_write_enabled(&self) -> Result<bool, Error>
pub fn get_stencil_write_enabled(&self) -> Result<bool, Error>
pub fn set_stencil_write_enabled(&self, value: bool) -> Result<(), Error>
pub fn set_stencil_write_enabled(&self, value: bool) -> Result<(), Error>
pub fn get_polygon_depth_offset(&self) -> Result<Vector2, Error>
pub fn get_polygon_depth_offset(&self) -> Result<Vector2, Error>
pub fn set_polygon_depth_offset(&self, value: Vector2) -> Result<(), Error>
pub fn set_polygon_depth_offset(&self, value: Vector2) -> Result<(), Error>
Methods from Deref<Target = RenderPass>§
pub fn get_enabled(&self) -> Result<bool, Error>
pub fn get_enabled(&self) -> Result<bool, Error>
See: ENABLED_PROPERTY
pub fn set_enabled(&self, value: bool) -> Result<(), Error>
pub fn set_enabled(&self, value: bool) -> Result<(), Error>
See: ENABLED_PROPERTY
pub fn get_input_viewport_area(&self) -> Result<Vector4, Error>
pub fn get_input_viewport_area(&self) -> Result<Vector4, Error>
pub fn set_input_viewport_area(&self, value: Vector4) -> Result<(), Error>
pub fn set_input_viewport_area(&self, value: Vector4) -> Result<(), Error>
pub fn get_update_rate(&self) -> Result<i32, Error>
pub fn get_update_rate(&self) -> Result<i32, Error>
See: UPDATE_RATE_PROPERTY
pub fn set_update_rate(&self, value: i32) -> Result<(), Error>
pub fn set_update_rate(&self, value: i32) -> Result<(), Error>
See: UPDATE_RATE_PROPERTY
pub fn get_update_offset(&self) -> Result<i32, Error>
pub fn get_update_offset(&self) -> Result<i32, Error>
pub fn set_update_offset(&self, value: i32) -> Result<(), Error>
pub fn set_update_offset(&self, value: i32) -> Result<(), Error>
Methods from Deref<Target = Resource>§
pub fn get_name(&self) -> Result<KanziString, Error>
pub fn get_name(&self) -> Result<KanziString, Error>
Gets the resource name.
pub fn get_url(&self) -> Result<KanziString, Error>
pub fn get_url(&self) -> Result<KanziString, Error>
Gets the resource URL. Note that the URL is not necessarily in URL form if resource has been just created.
§Returns
URL string.
Methods from Deref<Target = Object>§
pub fn as_ptr(&self) -> *mut ObjectWrapper
pub fn as_wrapper(&self) -> &ObjectWrapper
pub fn as_object(&self) -> &Object
pub fn as_object(&self) -> &Object
Represents any type inheriting from Object as &Object.
This is useful for comparisions when PartialEq traits failed to compare objects of
different types.
let child = screen.get_child(0)?;
let parent = child.get_parent()?.into_error(ErrorKind::ObjectNotFound)?;
// assert_eq!(screen, parent); // <- Fails to compile!
assert_eq!(screen.as_object(), parent.as_object());pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
Gets a pointer to the backing C++ instance.
pub fn get_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<<T as VariantConstraint>::RetArg, Error>where
T: PropertyTypeConstraint,
pub fn get_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<<T as VariantConstraint>::RetArg, Error>where
T: PropertyTypeConstraint,
Returns the current value of a property disregarding modifiers.
Base value is affected by the following inputs where the highest entry in the list determines the base value:
- Local value set with setProperty or loaded from kzb
- Value set by a style affecting the property.
- Value defined by class metadata.
Modifiers are not applied, the highest-priority base value is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
§Arguments
property_type- The property type identifying the property to retrieve.
§Returns
The evaluated property value.
pub fn get_optional_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>where
T: PropertyTypeConstraint,
pub fn get_optional_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>where
T: PropertyTypeConstraint,
Returns the current value of a property disregarding modifiers, but does not default to the value in property metadata if there are no inputs to the property value.
If there is no value sources, None is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
§Arguments
property_type- The property type identifying the property to retrieve.
§Returns
The evaluated property value.
pub fn set_property<T>(
&self,
property_type: &PropertyType<T>,
value: <T as VariantConstraint>::DataArg<'_>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn set_property<T>(
&self,
property_type: &PropertyType<T>,
value: <T as VariantConstraint>::DataArg<'_>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Sets the local value of a property type.
pub fn has_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<bool, Error>where
T: PropertyTypeConstraint,
pub fn has_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<bool, Error>where
T: PropertyTypeConstraint,
Evaluates whether there are any inputs into the property value. Both value sources and modifiers are taken into account.
§Returns
Returns true if there are inputs into the property value, false otherwise.
pub fn remove_local_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn remove_local_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Removes the local value associated with the property.
pub fn get_metaclass(&self) -> Result<Metaclass, Error>
pub fn get_metaclass(&self) -> Result<Metaclass, Error>
Returns the metaclass of the dynamic type of the object.
pub fn get_domain(&self) -> Result<Domain, Error>
pub fn get_domain(&self) -> Result<Domain, Error>
Returns the domain the object belongs to.
pub fn set_flag_keep_during_patching<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn set_flag_keep_during_patching<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Sets the flag to indicate that the property was loaded from KZB.
pub fn debug_string(&self) -> Result<String, Error>
pub fn debug_string(&self) -> Result<String, Error>
Builds a string representation of the object intended for debugging purposes.
Trait Implementations§
§impl Clone for PipelineStateRenderPass
impl Clone for PipelineStateRenderPass
§fn clone(&self) -> PipelineStateRenderPass
fn clone(&self) -> PipelineStateRenderPass
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more