Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Append(GraphicsStateCollection)

Adds all new graphics states and shader variants from the given collection to this collection.
Read time 1 minuteLast updated 6 days ago

Definition

public bool Append(GraphicsStateCollection collection)

Parameters

GraphicsStateCollection to append to this collection.

Returns

Type

Description

boolReturns true if the collection was successfully appended, false otherwise.

Remarks

Append
can be commonly used to add states and variants from the GraphicsStateCollection.cacheMissCollection into this collection after tracing cache misses via GraphicsStateCollection.WarmUp.
collection
must not be currently tracing.
using UnityEngine;using UnityEngine.Rendering;using Unity.Jobs;public class AppendExample : MonoBehaviour{ public GraphicsStateCollection graphicsStateCollection; public string filePath; void Start() { // Start prewarming without any job dependencies and trace any missing graphics states that get created after warmup JobHandle handle = graphicsStateCollection.WarmUp(new JobHandle(), true); } void OnDestroy() { graphicsStateCollection.cacheMissCollection.EndTrace(); // Update the current collection to include any new graphics states and then save to file if (graphicsStateCollection.cacheMissCollection.totalGraphicsStateCount > 0) { graphicsStateCollection.Append(graphicsStateCollection.cacheMissCollection); graphicsStateCollection.SaveToFile(filePath); } }}