Version: Unity 6 (6000.0)
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

GraphicsStateCollection.GetGraphicsStatesForVariant

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

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