# GraphicsStateCollection.GraphicsState

> A graphics state identifies a specific rendering configuration.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.Rendering](/engine/6000.7/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
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                                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [attachments](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/attachments.md)                                   | Array of color attachments used in this rendering configuration.                                                    |
| [baseShadingRate](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/baseshadingrate.md)                           | The pipeline fragment shading rate.                                                                                 |
| [depthAttachmentIndex](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/depthattachmentindex.md)                 | The index of the attachment to be used as the depth/stencil buffer for this rendering configuration.                |
| [depthBias](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/depthbias.md)                                       | The global depth bias value for this rendering configuration.                                                       |
| [forceCullMode](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/forcecullmode.md)                               | The forced cull mode in this rendering configuration.                                                               |
| [invertCulling](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/invertculling.md)                               | Flag indicating if backface culling is inverted in this rendering configuration.                                    |
| [invertProjection](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/invertprojection.md)                         | Flag indicating if the projection matrix is inverted in this rendering configuration.                               |
| [multiviewCount](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/multiviewcount.md)                             | The number of VR views used in this rendering configuration.                                                        |
| [negativeScale](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/negativescale.md)                               | Flag indicating if the mesh has inverted scale in this rendering configuration.                                     |
| [renderState](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/renderstate.md)                                   | The render state used in this rendering configuration.                                                              |
| [sampleCount](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/samplecount.md)                                   | The number of samples per pixel in this rendering configuration.                                                    |
| [shadingRateCombinerFragment](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/shadingratecombinerfragment.md)   | The second combiner operation between the result of the first combiner operation and the attachment's shading rate. |
| [shadingRateCombinerPrimitive](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/shadingratecombinerprimitive.md) | The first combiner operation between the pipeline fragment shading rate and the primitive fragment shading rate.    |
| [shadingRateIndex](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/shadingrateindex.md)                         | The index of the attachment to be used as the shading rate image for this rendering configuration                   |
| [slopeDepthBias](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/slopedepthbias.md)                             | The global slope depth bias value for this rendering configuration.                                                 |
| [subPasses](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/subpasses.md)                                       | Array containing information of each subpass.                                                                       |
| [subPassIndex](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/subpassindex.md)                                 | Index of the active subpass in this rendering configuration.                                                        |
| [topology](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/topology.md)                                         | The topology of the Mesh, e.g: Triangles, Lines, Quads, Points, etc. used in this rendering configuration.          |
| [vertexAttributes](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/vertexattributes.md)                         | Array containing information of vertex attributes.                                                                  |
| [wireframe](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/wireframe.md)                                       | Is wireframe mode enabled for this rendering configuration.                                                         |

## Methods

| Method                                                                                                                                  | Description                                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| [SetMeshData](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/setmeshdata.md)               | Sets the relevant graphics state fields according to data from the provided submesh and renderer.         |
| [SetRenderPassData](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/setrenderpassdata.md)   | Sets the relevant graphics state fields according to the provided render pass data.                       |
| [SetRenderStateData](/engine/6000.7/script-reference/unityengine/rendering/graphicsstatecollection/graphicsstate/setrenderstatedata.md) | Sets the render state fields in this graphics state according to the provided shader and pass identifier. |
