#include <RadientMaterialSRBTable.hpp>
Public Member Functions | |
| RADIENT_STATUS | Acquire (const RadientMaterialTextureSRBSlotArray &MaterialTextures, PBR_Renderer::PSO_FLAGS PSOFlags, Uint32 MaxTextureSlots, const RadientMaterialDefaultTextureBindings &DefaultTextures, RadientMaterialSRBLease &Lease, PBR_Renderer::StaticShaderTextureIdsArrayType &ShaderTextureIds) |
| RadientMaterialSRBLease | Acquire (const RadientMaterialTextureSRBSlot *const *ppSlots, Uint32 SlotCount) |
| RADIENT_STATUS | Prepare (Uint32 TextureVersion, Uint32 MaterialBufferVersion, Uint64 MaterialBufferGeneration, const ResolveTextureSRVCallbackType &ResolveTextureSRV, const CreateSRBCallbackType &CreateSRB) |
| size_t | GetSize () const noexcept |
Cache of material SRBs indexed by their ordered logical texture slots. Acquire() is thread-safe and only reserves logical entries; Prepare() and SRB access are render-thread-only. Entries are owned by RadientMaterialSRBLease instances, and unused records are removed by Prepare().
| RadientMaterialSRBLease Diligent::RadientMaterialSRBTable::Acquire | ( | const RadientMaterialTextureSRBSlot *const * | ppSlots, |
| Uint32 | SlotCount ) |
Thread-safely reuses or reserves an entry for a complete ordered slot recipe without retaining the supplied texture references on a cache hit.
| RADIENT_STATUS Diligent::RadientMaterialSRBTable::Acquire | ( | const RadientMaterialTextureSRBSlotArray & | MaterialTextures, |
| PBR_Renderer::PSO_FLAGS | PSOFlags, | ||
| Uint32 | MaxTextureSlots, | ||
| const RadientMaterialDefaultTextureBindings & | DefaultTextures, | ||
| RadientMaterialSRBLease & | Lease, | ||
| PBR_Renderer::StaticShaderTextureIdsArrayType & | ShaderTextureIds ) |
Thread-safely builds the material texture mapping and reuses or reserves the matching SRB entry without creating GPU objects. Slot texture references are only retained when a new entry is inserted.
|
noexcept |
Returns the number of retained table records. Expired weak entries may remain included until the next Prepare() call removes them.
| RADIENT_STATUS Diligent::RadientMaterialSRBTable::Prepare | ( | Uint32 | TextureVersion, |
| Uint32 | MaterialBufferVersion, | ||
| Uint64 | MaterialBufferGeneration, | ||
| const ResolveTextureSRVCallbackType & | ResolveTextureSRV, | ||
| const CreateSRBCallbackType & | CreateSRB ) |
Creates new SRBs and recreates existing SRBs when the texture resources or shared material buffer change. Pending texture resolutions are skipped and retried by the next call.