pub enum GpuTextureFormat {
Rgba8Unorm,
Bgra8Unorm,
Rgba16Float,
Depth24Plus,
Depth24PlusStencil8,
Depth32Float,
R32Float,
Rgba32Float,
}Expand description
The texture formats the renderer supports, as a closed set.
Deliberately a subset of the WebGPU format list: every variant here is one the renderer’s attachment, binding, and sampling paths are known to handle. Naming them as an enum turns a wrong format string into a compile error rather than a validation-layer rejection at creation time.
Variants§
Rgba8Unorm
Four 8-bit channels, normalized to 0.0..=1.0. The default, and
the format gpu.getPreferredCanvasFormat() usually resolves to
when the platform is not BGRA.
Bgra8Unorm
Four 8-bit channels in blue-green-red-alpha order. The swap-chain format on most desktop GPUs.
Rgba16Float
Four 16-bit floating-point channels. A render target for HDR passes, which then tone-map on resolve.
Depth24Plus
24-bit depth, no stencil. The usual choice for a shadow map or any other single-sample depth attachment.
Depth24PlusStencil8
24-bit depth plus an 8-bit stencil, in one 32-bit word.
Depth32Float
32-bit floating-point depth. Needed for view-space z-buffers.
R32Float
One 32-bit floating-point channel. A single-channel render target and the usual format for a read-only storage binding.
Rgba32Float
Four 32-bit floating-point channels. The format for a compute shader’s read-write storage output.