e01.org

GPU: wgslLanguageFeatures property

WebGPU API

WebGPU API

The **`wgslLanguageFeatures`** read-only property of the
GPU interface returns a WGSLLanguageFeatures object that reports the [WGSL language extensions](https://gpuweb.github.io/gpuweb/wgsl/#language-extension) supported by the WebGPU implementation.

> [!NOTE]
> Not all WGSL language extensions are available to WebGPU in all browsers that support the API. We recommend you thoroughly test any extensions you choose to use.

## Value

A WGSLLanguageFeatures object instance. This is a [setlike](/docs/Web/JavaScript/Reference/Global_Objects/Set) object.

## Examples

```js
if (!navigator.gpu) {
throw Error("WebGPU not supported.");
}

const wgslFeatures = navigator.gpu.wgslLanguageFeatures;

// Return the size of the set
console.log(wgslFeatures.size);

// Iterate through all the set values using values()
const valueIterator = wgslFeatures.values();
for (const value of valueIterator) {
console.log(value);
}

// …
```

## Specifications

## Browser compatibility

## See also

- [WebGPU API](/docs/Web/API/WebGPU_API)

source: MDN Web Docs mirror · page

Cite this

"GPU: wgslLanguageFeatures property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/GPU/wgslLanguageFeatures

JSON record · API collection · citation policy