Skip to main content

Module resource

Module resource 

Source
Expand description

Generation-checked resource handles and reference-counted registry.

Resources (textures, shaders) are identified by TextureHandle and ShaderHandle — lightweight generation-checked tokens. The ResourceRegistry tracks reference counts and recycles slots so the same index can be safely reused without stale-handle confusion.

RAII wrappers (TextureGuard, ShaderGuard) automatically decrement the reference count when dropped.

Structs§

ResourceId
A generation-checked resource identifier.
ResourceRegistry
Shared registry of GPU textures and shaders, with generation-checked handles and reference counting.
ShaderGuard
RAII wrapper that releases a ShaderHandle when dropped.
ShaderHandle
An opaque handle to a GPU shader resource.
TextureGuard
RAII wrapper that releases a TextureHandle when dropped.
TextureHandle
An opaque handle to a GPU texture resource.