Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GraphicsStateCollection.GraphicsState

A graphics state identifies a specific rendering configuration.
Read time 2 minutesLast updated 5 days ago

Definition

public struct GraphicsStateCollection.GraphicsState

Remarks

Modern graphics APIs (i.e. Metal, D3D12, Vulkan) use both the active shader variant and rendering configuration to create the accurate GPU representation of a shader.

Fields

Value

Description

attachmentsArray of color attachments used in this rendering configuration.
baseShadingRateThe pipeline fragment shading rate.
depthAttachmentIndexThe index of the attachment to be used as the depth/stencil buffer for this rendering configuration.
depthBiasThe global depth bias value for this rendering configuration.
forceCullModeThe forced cull mode in this rendering configuration.
hasEyeTextureFlag indicating that a VR eye texture is being rendered to in this rendering configuration.
invertCullingFlag indicating if backface culling is inverted in this rendering configuration.
invertProjectionFlag indicating if the projection matrix is inverted in this rendering configuration.
multiviewCountThe number of VR views used in this rendering configuration.
negativeScaleFlag indicating if the mesh has inverted scale in this rendering configuration.
renderStateThe render state used in this rendering configuration.
sampleCountThe number of samples per pixel in this rendering configuration.
shadingRateCombinerFragmentThe second combiner operation between the result of the first combiner operation and the attachment's shading rate.
shadingRateCombinerPrimitiveThe first combiner operation between the pipeline fragment shading rate and the primitive fragment shading rate.
shadingRateIndexThe index of the attachment to be used as the shading rate image for this rendering configuration
slopeDepthBiasThe global slope depth bias value for this rendering configuration.
subPassesArray containing information of each subpass.
subPassIndexIndex of the active subpass in this rendering configuration.
topologyThe topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. used in this rendering configuration.
vertexAttributesArray containing information of vertex attributes.
wireframeIs wireframe mode enabled for this rendering configuration.

Methods

Method

Description

SetMeshDataSets the relevant graphics state fields according to data from the provided submesh and renderer.
SetRenderPassDataSets the relevant graphics state fields according to the provided render pass data.
SetRenderStateDataSets the render state fields in this graphics state according to the provided shader and pass identifier.