Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetGraphicsStatesForVariant

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

Definition

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

Populate given list with graphics states associated with 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.

Array of keywords used in the variant.

List of graphics states to populate.

Examples

using System.Collections.Generic;using UnityEngine;using UnityEngine.Experimental.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 input shader variant.
public void GetGraphicsStatesForVariant(GraphicsStateCollection.ShaderVariant variant, List<GraphicsStateCollection.GraphicsState> results)

Parameters

The input variant.

List of graphics states to populate.

Examples

using System.Collections.Generic;using UnityEngine;using UnityEngine.Experimental.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); } }}