W3cubDocs

/Web APIs

GPUSupportedLimits

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The GPUSupportedLimits interface of the WebGPU API describes the limits supported by a GPUAdapter.

The GPUSupportedLimits object for the current adapter is accessed via the GPUAdapter.limits property.

You should note that, rather than reporting the exact limits of each GPU, browsers will likely report different tier values of different limits to reduce the unique information available to drive-by fingerprinting. For example, the tiers of a certain limit might be 2048, 8192, and 32768. If your GPU's actual limit is 16384, the browser will still report 8192.

Given that different browsers will handle this differently and the tier values may change over time, it is hard to provide an accurate account of what limit values to expect — thorough testing is advised.

Instance properties

The following limits are represented by properties in a GPUSupportedLimits object. See the Limits section of the specification for detailed descriptions of what the limits relate to.

Limit name Default value
maxTextureDimension1D 8192
maxTextureDimension2D 8192
maxTextureDimension3D 2048
maxTextureArrayLayers 256
maxBindGroups 4
maxBindingsPerBindGroup 640
maxDynamicUniformBuffersPerPipelineLayout 8
maxDynamicStorageBuffersPerPipelineLayout 4
maxSampledTexturesPerShaderStage 16
maxSamplersPerShaderStage 16
maxStorageBuffersPerShaderStage 8
maxStorageTexturesPerShaderStage 4
maxUniformBuffersPerShaderStage 12
maxUniformBufferBindingSize 65536 bytes
maxStorageBufferBindingSize 134217728 bytes (128 MB)
minUniformBufferOffsetAlignment 256 bytes
minStorageBufferOffsetAlignment 256 bytes
maxVertexBuffers 8
maxBufferSize 268435456 bytes (256 MB)
maxVertexAttributes 16
maxVertexBufferArrayStride 2048 bytes
maxInterStageShaderComponents 60
maxInterStageShaderVariables 16
maxColorAttachments 8
maxColorAttachmentBytesPerSample 32
maxComputeWorkgroupStorageSize 16384 bytes
maxComputeInvocationsPerWorkgroup 256
maxComputeWorkgroupSizeX 256
maxComputeWorkgroupSizeY 256
maxComputeWorkgroupSizeZ 64
maxComputeWorkgroupsPerDimension 65535

Examples

In the following code we query the GPUAdapter.limits value of maxBindGroups to see if it is equal to or greater than 6. Our theoretical example app ideally needs 6 bind groups, so if the returned value is >= 6, we add a maximum limit of 6 to the requiredLimits object. We then request a device with that limit requirement using GPUAdapter.requestDevice():

js

async function init() {
  if (!navigator.gpu) {
    throw Error("WebGPU not supported.");
  }

  const adapter = await navigator.gpu.requestAdapter();
  if (!adapter) {
    throw Error("Couldn't request WebGPU adapter.");
  }

  const requiredLimits = {};

  // App ideally needs 6 bind groups, so we'll try to request what the app needs
  if (adapter.limits.maxBindGroups >= 6) {
    requiredLimits.maxBindGroups = 6;
  }

  const device = await adapter.requestDevice({
    requiredLimits,
  });

  // ...
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
GPUSupportedLimits
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
previewCurrently supported on Linux and Windows only.
No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxBindGroups
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
previewCurrently supported on Linux and Windows only.
No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxBindingsPerBindGroup
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
previewCurrently supported on Linux and Windows only.
No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxBufferSize
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxColorAttachmentBytesPerSample
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxColorAttachments
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxComputeInvocationsPerWorkgroup
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxComputeWorkgroupSizeX
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxComputeWorkgroupSizeY
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxComputeWorkgroupSizeZ
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxComputeWorkgroupStorageSize
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxComputeWorkgroupsPerDimension
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxDynamicStorageBuffersPerPipelineLayout
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxDynamicUniformBuffersPerPipelineLayout
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxInterStageShaderComponents
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxInterStageShaderVariables
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxSampledTexturesPerShaderStage
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxSamplersPerShaderStage
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxStorageBufferBindingSize
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxStorageBuffersPerShaderStage
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxStorageTexturesPerShaderStage
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxTextureArrayLayers
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxTextureDimension1D
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxTextureDimension2D
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxTextureDimension3D
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxUniformBufferBindingSize
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxUniformBuffersPerShaderStage
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxVertexAttributes
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxVertexBufferArrayStride
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
maxVertexBuffers
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
minStorageBufferOffsetAlignment
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No
minUniformBufferOffsetAlignment
113Currently supported on ChromeOS, macOS, and Windows only.
113Currently supported on ChromeOS, macOS, and Windows only.
No No
99Currently supported on ChromeOS, macOS, and Windows only.
No No No No No No No

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/GPUSupportedLimits