|
|
| Handle ()=default |
| | Constructs a null handle.
|
|
| ~Handle ()=default |
| | Destructor. Intentionally does not free the resource (see file comment).
|
|
| Handle (const Handle &)=delete |
|
Handle & | operator= (const Handle &)=delete |
| | Handle (Handle &&other) noexcept |
| | Move constructor; other becomes null.
|
| Handle & | operator= (Handle &&other) noexcept |
| | Move assignment; other becomes null.
|
|
bool | isValid () const |
| | Returns true if this handle is non-null. The device generation check is authoritative for whether the resource is still alive.
|
|
uint32_t | slotIndex () const |
| | Resource table slot index, for backend use.
|
|
uint32_t | generation () const |
| | Slot generation at creation time, for backend use. Zero for null handles.
|
|
uint64_t | deviceId () const |
| | Identity of the owning device (see Device::deviceId()), for backend use. Zero for null handles.
|
template<typename Tag>
class donner::gpu::Handle< Tag >
Move-only handle to a device resource.
A handle carries a (slot, generation) pair plus the identity of the owning device. The device validates all three on every use, so a null handle, a stale handle (the resource was destroyed, possibly with its slot reused), or a handle from a different device fails closed with GpuErrorType::InvalidHandle / GpuErrorType::DeviceMismatch instead of reaching a backend. Validation runs in release builds too.
A default-constructed or moved-from handle is null (isValid() returns false).
- Template Parameters
-
| Tag | Tag type identifying the resource type; provides Tag::kName for diagnostics. |