Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetGraphicsStatesForVariant

Populate given list with graphics states associated with an input shader variant.
Read time 1 minuteLast updated 4 days ago

Definition

GetGraphicsStatesForVariant(Shader, PassIdentifier, LocalKeyword[], List<GraphicsState>)

Populate given list with graphics states associated with an input shader variant.
public void GetGraphicsStatesForVariant(Shader shader, PassIdentifier passId, LocalKeyword[] keywords, List<GraphicsStateCollection.GraphicsState> results)

Parameters

shader

Shader used in the variant.

PassIdentifier used in the variant.

LocalKeyword array of keywords used in the variant.

Remarks

using System.Collections.Generic;using UnityEngine;using UnityEngine.Rendering;public class GetGraphicsStatesExample : MonoBehaviour{ public GraphicsStateCollection graphicsStateCollection; void Start() { List<GraphicsStateCollection.ShaderVariant> variants = new List<GraphicsStateCollection.ShaderVariant>(); graphicsStateCollection.GetVariants(variants); foreach (var variant in variants) { List<GraphicsStateCollection.GraphicsState> states = new List<GraphicsStateCollection.GraphicsState>(); graphicsStateCollection.GetGraphicsStatesForVariant(variant, states); } }}

GetGraphicsStatesForVariant(ShaderVariant, List<GraphicsState>)

Populate given list with graphics states associated with an input shader variant.
public void GetGraphicsStatesForVariant(GraphicsStateCollection.ShaderVariant variant, List<GraphicsStateCollection.GraphicsState> results)

Parameters

The input shader variant.

Remarks

using System.Collections.Generic;using UnityEngine;using UnityEngine.Rendering;public class GetGraphicsStatesExample : MonoBehaviour{ public GraphicsStateCollection graphicsStateCollection; void Start() { List<GraphicsStateCollection.ShaderVariant> variants = new List<GraphicsStateCollection.ShaderVariant>(); graphicsStateCollection.GetVariants(variants); foreach (var variant in variants) { List<GraphicsStateCollection.GraphicsState> states = new List<GraphicsStateCollection.GraphicsState>(); graphicsStateCollection.GetGraphicsStatesForVariant(variant, states); } }}