Requesting Optional Features

A feature is a named capability beyond the core API, such as shader-f16 (16-bit floats in WGSL) or timestamp-query (GPU timers). adapter.features is a set of what the adapter could enable; requiredFeatures enables them on your device, and using one you did not request is a validation error.

Listing the adapter's features and enabling two of themHTMLLive
<script type="module">
  const adapter = await navigator.gpu.requestAdapter();
  const names = [...adapter.features].sort();
  console.log(`${names.length} features on this adapter:`);
  for (let i = 0; i < names.length; i += 3) {
    console.log('  ' + names.slice(i, i + 3).join(', '));
  }
  const requiredFeatures = ['shader-f16', 'timestamp-query'];
  const device = await adapter.requestDevice({ requiredFeatures });
  console.log(`device.features: ${[...device.features].join(', ')}`);
</script>

This is a typical desktop list: BC texture compression but not the mobile ASTC or ETC2 formats. Requesting texture-compression-astc here rejected with TypeError: Unsupported feature: texture-compression-astc, and phone GPUs report the opposite, so pages that ship compressed textures need more than one format (Textures and Samplers).