Home -> IResourceArray -> SetDataPersistenceFlags
Description
The SetDataPersistenceFlags method tells the renderer how long existing resource array contents must remain valid after writes or after draw work has consumed them. This lets the renderer avoid preserving data that the application will never read again.
Invalidation flags can reduce memory pressure and synchronization costs for transient upload, compute, or transfer buffers. They should only be used when the application fully overwrites data before it is read again, or when data is no longer needed after pending GPU work completes.
Warning
When data is invalidated, previous contents become undefined. Do not use invalidation flags for resources whose old contents are read by later draws, transfers, output capture, or CPU code.
Usage
void SetDataPersistenceFlags(DataPersistenceFlags dataPersistenceFlags);
Argument list
- dataPersistenceFlags [DataPersistenceFlags]
- The persistence flags that describe when existing resource data may be discarded.