Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
GpuLimits.h File Reference

Documented validation limits enforced by donner::gpu::Device. More...

#include <cstdint>
Include dependency graph for GpuLimits.h:
This graph shows which files directly or indirectly include this file:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Variables

constexpr uint32_t donner::gpu::kMaxTextureDimension = 16384
 Maximum texture width or height in texels.
constexpr uint64_t donner::gpu::kMaxBufferByteSize = uint64_t(1) << 30
 Maximum buffer size in bytes (1 GiB).
constexpr uint32_t donner::gpu::kMaxBindings = 32
 Maximum number of entries in one bind group layout, and the exclusive upper bound for binding indices.
constexpr uint32_t donner::gpu::kMaxBindGroups = 4
 Maximum number of bind groups in a pipeline layout, and the exclusive upper bound for setBindGroup indices.
constexpr uint32_t donner::gpu::kMaxVertexBuffers = 8
 Maximum number of vertex buffer layouts in a render pipeline, and the exclusive upper bound for setVertexBuffer slots.
constexpr uint32_t donner::gpu::kMaxVertexAttributes = 16
 Maximum total vertex attributes in a render pipeline, and the exclusive upper bound for attribute shader locations. 16 is the strictest common cap across the native APIs this runtime targets (well below Metal's 31 per-stage limit).
constexpr uint32_t donner::gpu::kMaxColorAttachments = 4
 Maximum number of color attachments in a render pass or render pipeline.
constexpr uint32_t donner::gpu::kMaxComputeInvocationsPerWorkgroup = 256
 Maximum invocations one compute workgroup may declare (x * y * z). 256 is the strictest common cap across the native APIs this runtime targets.
constexpr uint32_t donner::gpu::kMaxComputeWorkgroupSizeXY = 256
 Maximum invocations a compute workgroup may declare along X or Y.
constexpr uint32_t donner::gpu::kMaxComputeWorkgroupSizeZ = 64
 Maximum invocations a compute workgroup may declare along Z.
constexpr uint32_t donner::gpu::kMaxComputeWorkgroupsPerDimension = 65535
 Maximum workgroups one dispatch may request along any axis. 65535 is the strictest common cap across the native APIs this runtime targets, and bounds a dispatch derived from an untrusted document extent.
constexpr uint32_t donner::gpu::kBindingOffsetAlignment = 256
 Required alignment of BufferBinding::offsetBytes for uniform and read-only storage buffer bindings. 256 is the strictest dynamic/static buffer-binding offset alignment across the native APIs this runtime targets, so enforcing it uniformly keeps bind groups portable to every backend.
constexpr uint32_t donner::gpu::kTexelRowPitchAlignment = 256
 Required alignment of TexelCopyBufferLayout::bytesPerRow. 256 is the strictest row-pitch alignment across the native APIs this runtime targets, so enforcing it uniformly keeps copies portable without per-backend repacking. The same portability reasoning requires TexelCopyBufferLayout::offsetBytes to be aligned to the copied format's texel size.

Detailed Description

Documented validation limits enforced by donner::gpu::Device.

Limits exist so that untrusted SVG-derived dimensions (geometry volume, image sizes, render-target extents, dispatch counts) fail deterministically with GpuErrorType::LimitExceeded instead of exhausting a driver.