Skip to content

GpuHandle

1 min read

Import: import system.gpu;

This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation. Shader-only declarations can be used only inside shader entry points and helpers reached from them; using them elsewhere is a compile error.

GpuHandle

A bindless reference to a texture or sampler that can be stored in any buffer or struct, so one shader can pick among thousands of resources at run time. Get one from GpuDevice.handle. Inside a shader, get() returns the resource, for example material.albedo.get().sample(material.sampler.get(), uv). A handle stays valid while its resource is alive. Needs GpuFeature.Bindless, which GpuTarget.Dx12, Vulkan, Metal and Cuda provide.

public struct GpuHandle<T>

get

The resource this handle refers to, inside a shader.

public extern fun get(): T