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

DeviceFeatures

Quick answer

DeviceFeatures reports optional capabilities of the active backend through device.features. Check a single flag with has('timer-query') or enumerate everything with keys(), then gate code paths accordingly. Features answer whether a technique exists at all, while DeviceLimits gives the numeric ceilings.

Last verified 2026-11-03 · luma.gl 9.4 · Cite this page
device. features → DeviceFeatures
Key points
Example
function requireFeatures(device, required) {
  const missing = required.filter(function (feature) {
    return !device.features.has(feature);
  });

  if (missing.length) {
    console.warn('缺少设备特性', missing);
    return false;
  }

  return true;
}

/* 需要的特性名从配置或常量表里读,不在这里硬编码 */
const ok = requireFeatures(device, config.requiredFeatures);
const list = [];

for (const feature of device.features) {
  list.push(feature);
}

console.log(list.length, list);
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). DeviceFeatures. https://www.jingweizhi.com/en/lumagl/api/device-features.html (accessed 2026-11-03).