W3cubDocs

/Web APIs

GPU: wgslLanguageFeatures property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The wgslLanguageFeatures read-only property of the GPU interface returns a WGSLLanguageFeatures object that reports the WGSL language extensions 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 object.

Examples

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

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
wgslLanguageFeatures
115Currently supported on ChromeOS, macOS, and Windows only.
115Currently supported on ChromeOS, macOS, and Windows only.
141Currently supported on Windows only, in all contexts except for service workers.
101Currently supported on ChromeOS, macOS, and Windows only.
26 121 No 81 26 25.0 121 26

See also

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