![]() |
XII Release 0.1.0
|
#include <MaterialGpuStorage.h>
Classes | |
| struct | UploadHandles |
Public Member Functions | |
| xiiResult | Initialize (xiiGALDevice *pDevice, const xiiMaterialGpuStorageDescription &description={}) |
| void | Shutdown () |
| xiiMaterialGpuHandle | RegisterMaterial (xiiSharedPtr< xiiMaterialInstance > pInstance) |
| bool | ReplaceMaterial (xiiMaterialGpuHandle handle, xiiSharedPtr< xiiMaterialInstance > pInstance) |
| void | UnregisterMaterial (xiiMaterialGpuHandle handle, xiiUInt64 uiFrameIndex) |
| void | CollectGarbage (xiiUInt64 uiCompletedFrame) |
| bool | IsValidHandle (xiiMaterialGpuHandle handle) const |
| xiiSharedPtr< xiiMaterialInstance > | GetMaterial (xiiMaterialGpuHandle handle) const |
| xiiUInt32 | GetGpuOffset (xiiMaterialGpuHandle handle, xiiUInt64 uiFrameIndex) const |
| xiiUInt32 | GetMaterialStride () const |
| xiiUInt32 | GetFramesInFlight () const |
| xiiSharedPtr< xiiGALBuffer > | GetBuffer () const |
| xiiSharedPtr< xiiGALBuffer > | GetSurfaceBuffer () const |
| xiiUInt32 | GetSurfaceBaseIndex (xiiUInt64 uiFrameIndex) const |
| xiiMaterialGpuStorageStatistics | GetStatistics () const |
| void | GetActiveMaterials (xiiDynamicArray< xiiSharedPtr< xiiMaterialInstance > > &out_materials) const |
| void | GatherUploads (xiiUInt64 uiFrameIndex, xiiMaterialGpuUploadBatch &out_batch) const |
| Captures all revisions required by this frame without mutating the live instances. | |
| UploadHandles | AddUploadPasses (xiiRenderGraph &graph, xiiUInt64 uiFrameIndex) |
| xiiRenderGraphBufferHandle | AddUploadPass (xiiRenderGraph &graph, xiiUInt64 uiFrameIndex) |
Central, generation-checked material buffer allocator.
Material resources no longer allocate one constant buffer each. Instances receive stable slots in a large shader-resource buffer, and only revisions missing from the current frame slice are uploaded. Retired slots are reused only after the caller reports their last-use frame complete.
| void xiiMaterialGpuStorage::GetActiveMaterials | ( | xiiDynamicArray< xiiSharedPtr< xiiMaterialInstance > > & | out_materials | ) | const |
Copies strong references to every currently registered instance. The copy deliberately releases the storage lock before callers inspect or update instances, avoiding lock-order inversions between the central slot table and per-material mutexes.
|
nodiscard |
Rebinds a live slot to a rebuilt resource instance without changing the GPU-visible index. Every frame slice is marked dirty so hot reloads cannot leave stale material bytes in flight.