GpuBackend¶
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 @compute, @vertex, @fragment, inferred helpers and ray tracing shader functions; using them elsewhere is a compile error.
GpuBackend¶
The graphics API a GpuDevice runs on. Only backends whose shader code is in this build can be selected; GpuShaders.backends() lists them. Asking for any other backend returns GpuError.BackendNotCompiled and never falls back to a different one.
Auto¶
Lets the host choose: the platform's native API when this build has shader code for it, otherwise WebGPU.
Dx12¶
Direct3D 12, on Windows.
Dx11¶
Direct3D 11, on Windows.
Vulkan¶
Vulkan, on Windows and Linux.
Metal¶
Metal, on macOS.
Cuda¶
CUDA, on NVIDIA GPUs under Windows and Linux. Runs compute shaders only.
WebGpu¶
WebGPU: the browser's GPU API, or Dawn in native programs.