| Parameter | Description |
|---|---|
| collection | GraphicsStateCollection to append to this collection. |
Boolean Returns true if the collection was successfully appended, false otherwise.
Adds all new graphics states and shader variants from the given collection to this collection.
Append can be commonly used to add states and variants from the cacheMissCollection into this collection after tracing cache misses via WarmUp.
collection must not be currently tracing.
using UnityEngine; using UnityEngine.Experimental.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); } } }
Additional resources: cacheMissCollection, isTracing.