public readonly record struct Handle<T>A typed, generation-checked reference to something living in a HandlePool`1: a slot index plus the version that slot was on when the handle was taken.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
This is why the RHI exposes no reference types for GPU resources. A buffer that has been destroyed and whose slot has been reused fails a generation check and reports a use-after-free, where a raw pointer or a stale object reference would either crash in native code or, worse, quietly address whatever now lives there. The resource tables stay contiguous and cache-friendly as a side effect.
Generations start at 1, so a zeroed handle refers to nothing. Eight bytes, blittable, and cheap to copy into a command list.
Fields and properties (5)
public uint Indexpublic uint Generationpublic static Handle<T> NullThe handle that refers to nothing.
public bool IsNullWhether this refers to nothing. True for a zeroed handle.
public ulong PackedBoth halves in one word, for hashing and for packing into a sort key.
Methods (10)
public Handle(uint Index, uint Generation)A typed, generation-checked reference to something living in a HandlePool`1: a slot index plus the version that slot was on when the handle was taken.
public static Handle<T> FromPacked(ulong packed)Unpacks a handle produced by Packed.
public int CompareTo(Handle<T> other)Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public static bool operator <(Handle<T> left, Handle<T> right)Whether sorts before .
public static bool operator <=(Handle<T> left, Handle<T> right)Whether sorts before or equal to .
public static bool operator >(Handle<T> left, Handle<T> right)Whether sorts after .
public static bool operator >=(Handle<T> left, Handle<T> right)Whether sorts after or equal to .
public override int GetHashCode()Returns the hash code for this instance.
public override string ToString()Renders the handle as Type#index:generation, or Type#null.
public string ToString(string? format, IFormatProvider? formatProvider)Formats the value of the current instance using the specified format.
Used by (25)
- AccelerationStructureHandleVixen.Graphics
- AccelerationStructureTestsVixen.Graphics.Null.Tests
- BufferHandleVixen.Graphics
- BufferTransferTestsVixen.Rendering.Tests
- DepthPrepassTestsVixen.Rendering.Tests
- DescriptorSetHandleVixen.Graphics
- DescriptorSetLayoutHandleVixen.Graphics
- DrawCompactionTestsVixen.Rendering.Tests
- EnumeratorVixen.Core.Collections
- GeometryBufferTestsVixen.Rendering.Tests
- HandlePoolVixen.Core.Collections
- HandleTestsVixen.Core.Collections.Tests
- MeshRenderFeatureVixen.Rendering
- NullCommandListVixen.Graphics.Null
- NullDeviceVixen.Graphics.Null
- NullDeviceTestsVixen.Graphics.Null.Tests
- PipelineHandleVixen.Graphics
- PipelineLayoutHandleVixen.Graphics
- QueryPoolHandleVixen.Graphics
- SamplerHandleVixen.Graphics
- ShaderHandleVixen.Graphics
- TextureHandleVixen.Graphics
- TextureViewHandleVixen.Graphics
- VulkanDeviceVixen.Graphics.Vulkan
- WebGpuDeviceVixen.Graphics.WebGPU