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
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public bool Append(GraphicsStateCollection collection)
Parameters
GraphicsStateCollection to append to this collection.
Returns
Type | Description |
|---|---|
| bool | Returns true if the collection was successfully appended, false otherwise. |
Remarks
Appendcollectionusing 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); } }}
Additional Resources: GraphicsStateCollection.cacheMissCollection, GraphicsStateCollection.isTracing.