Experimental: this API is experimental and might be changed or removed in the future.

GraphicsStateCollection.GetGraphicsStatesForVariant

Declaration

public void GetGraphicsStatesForVariant(Shader shader, Rendering.PassIdentifier passId, LocalKeyword[] keywords, List<GraphicsState> results);

Declaration

public void GetGraphicsStatesForVariant(Experimental.Rendering.GraphicsStateCollection.ShaderVariant variant, List<GraphicsState> results);

Parameters

shader Shader used in the variant.
passId PassIdentifier used in the variant.
keywords Array of keywords used in the variant.
results List of graphics states to populate.
variant The input variant.

Description

Populate given list with graphics states associated with input shader variant.

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); } } }

Did you find this page useful? Please give it a rating: