Atlaslog
Atlaslog / luma.gl / API reference / DeviceLimits
luma.gl · API reference

DeviceLimits

Quick answer

DeviceLimits exposes the hard numeric ceilings of the current backend through device.limits: maximum texture dimensions, buffer sizes, vertex attributes, bindings and workgroup counts. Read the limits before allocating textures or sizing dispatch grids so code runs on every device. The values are fixed per device and never change at runtime.

Last verified 2026-11-03 · luma.gl 9.4 · Cite this page
device. limits → DeviceLimits
Key points
Example
const limits = device.limits;

/* 纹理边长不能超过后端上限 */
const size = Math.min(requestedSize, limits.maxTextureDimension2D);

const texture = device.createTexture({
  width: size,
  height: size,
  format: 'rgba8unorm',
  usage: Texture.SAMPLE | Texture.COPY_DST
});

/* uniform 偏移必须按对齐要求取整 */
const alignedOffset = Math.ceil(byteOffset / limits.minUniformBufferOffsetAlignment)
  * limits.minUniformBufferOffsetAlignment;
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). DeviceLimits. https://www.jingweizhi.com/en/lumagl/api/device-limits.html (accessed 2026-11-03).