GetGraphicsStatesForVariant
Populate given list with graphics states associated with an input shader variant.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
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 used in the variant.
PassIdentifier used in the variant.
LocalKeyword array of keywords used in the variant.
GraphicsStateCollection.GraphicsState list to populate.
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); } }}
Additional Resources: GraphicsStateCollection.GetGraphicsStateCountForVariant, GraphicsStateCollection.AddGraphicsStateForVariant.
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
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); } }}