XII Release 0.1.0
Loading...
Searching...
No Matches
xiiMaterialGpuStorage Class Reference

#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)

Detailed Description

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.

Member Function Documentation

◆ GetActiveMaterials()

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.

◆ ReplaceMaterial()

bool xiiMaterialGpuStorage::ReplaceMaterial ( xiiMaterialGpuHandle handle,
xiiSharedPtr< xiiMaterialInstance > pInstance )
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.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/GraphicsCore/Material/MaterialGpuStorage.h
  • /home/runner/work/XII/XII/Source/Engine/GraphicsCore/Material/Implementation/MaterialGpuStorage.cpp