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 interface of the WebGPU API is a setlike object that reports the WGSL language extensions supported by the WebGPU implementation.
The WGSLLanguageFeatures object is accessed via the GPU.wgslLanguageFeatures property.
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.
The following WGSL language extensions are defined at WGSL language extensions in the WGSL specification. Bear in mind that the exact set of features available will vary across implementations and physical devices, and may change over time.
packed_4x8_integer_dot_productAllows DP4a (Dot Product of 4 Elements and Accumulate) GPU instructions to be used via your WGSL code. These efficiently perform 8-bit integer dot products to accelerate computation, saving memory and network bandwidth and improving performance compared with the equivalent f32 versions. They are commonly used in machine learning models in inferencing, within AI frameworks.
Specifically, when packed_4x8_integer_dot_product is available, WGSL code can use:
dot4U8Packed() and dot4I8Packed() built-in functions).pack4xI8() and pack4xI8Clamp()).pointer_composite_accessEnables WGSL shader code to access components of complex data types using the same dot (.) syntax whether you're working directly with the data or with a pointer to it.
When pointer_composite_access is available:
foo is a pointer: foo.bar is available as a more convenient way to write (*foo).bar. The asterisk (*) would normally be needed to turn the pointer into a "reference" that can be dereferenced, but now both pointers and references are almost interchangeable.foo is not a pointer: The dot (.) operator works exactly as you're used to for directly accessing members.pa is a pointer that stores the starting address of an array, then pa[i] gives you direct access to the memory location where the ith element of that array is stored.See Syntax sugar for dereferencing composites in WGSL for further details and an example.
readonly_and_readwrite_storage_texturesWhen available, allows the "read-only" and "read-write" storageTexture.access values to be set when specifying storage texture bind group entry types in a bind group layout. These enable WGSL code to read storage textures, and read/write storage textures, respectively.
unrestricted_pointer_parametersLoosens restrictions on pointers being passed to WGSL functions. When available, the following are allowed:
Parameter pointers to storage, uniform, and workgroup address spaces being passed to user-declared functions.
Pointers to structure members and array elements being passed to user-declared functions.
See Pointers As Function Parameters for more details.
The following property is available to all read-only setlike objects:
sizeReturns the number of values in the set.
The following methods are available to all read-only setlike objects:
has()Returns a boolean asserting whether or not an element with the given value is present in the set.
values()Returns a new iterator object that yields values for each element in the set in insertion order.
keys()An alias for values().
entries()Returns a new iterator object that contains [value, value] for each element in the set in insertion order.
forEach()Calls the provided callback function once for each value present in the set in insertion order.
if (
navigator.gpu.wgslLanguageFeatures.has(
"readonly_and_readwrite_storage_textures",
)
) {
console.log("Read-only and read-write storage textures are available");
}
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);
}
// …
| Specification |
|---|
| WebGPU> # gpuwgsllanguagefeatures> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
@@iterator |
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 | 141Currently supported on Windows only, in all contexts except for service workers. |
81 | 26 | 25.0 | 121 | 26 |
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 | 141Currently supported on Windows only, in all contexts except for service workers. |
81 | 26 | 25.0 | 121 | 26 |
entries |
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 | 141Currently supported on Windows only, in all contexts except for service workers. |
81 | 26 | 25.0 | 121 | 26 |
extension_packed_4x8_integer_dot_product |
123Currently supported on ChromeOS, macOS, and Windows only. |
123Currently supported on ChromeOS, macOS, and Windows only. |
No | 109Currently supported on ChromeOS, macOS, and Windows only. |
No | 123Currently supported on ChromeOS, macOS, and Windows only. |
No | 82Currently supported on ChromeOS, macOS, and Windows only. |
No | 27.0Currently supported on ChromeOS, macOS, and Windows only. |
123Currently supported on ChromeOS, macOS, and Windows only. |
No |
extension_pointer_composite_access |
123Currently supported on ChromeOS, macOS, and Windows only. |
123Currently supported on ChromeOS, macOS, and Windows only. |
No | 109Currently supported on ChromeOS, macOS, and Windows only. |
No | 123Currently supported on ChromeOS, macOS, and Windows only. |
No | 82Currently supported on ChromeOS, macOS, and Windows only. |
No | 27.0Currently supported on ChromeOS, macOS, and Windows only. |
123Currently supported on ChromeOS, macOS, and Windows only. |
No |
extension_readonly_and_readwrite_storage_textures |
124Currently supported on ChromeOS, macOS, and Windows only. |
124Currently supported on ChromeOS, macOS, and Windows only. |
No | 110Currently supported on ChromeOS, macOS, and Windows only. |
No | 124Currently supported on ChromeOS, macOS, and Windows only. |
No | 82Currently supported on ChromeOS, macOS, and Windows only. |
No | 27.0Currently supported on ChromeOS, macOS, and Windows only. |
124Currently supported on ChromeOS, macOS, and Windows only. |
No |
extension_unrestricted_pointer_parameters |
123Currently supported on ChromeOS, macOS, and Windows only. |
123Currently supported on ChromeOS, macOS, and Windows only. |
No | 109Currently supported on ChromeOS, macOS, and Windows only. |
No | 123Currently supported on ChromeOS, macOS, and Windows only. |
No | 82Currently supported on ChromeOS, macOS, and Windows only. |
No | 27.0Currently supported on ChromeOS, macOS, and Windows only. |
123Currently supported on ChromeOS, macOS, and Windows only. |
No |
forEach |
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 | 141Currently supported on Windows only, in all contexts except for service workers. |
81 | 26 | 25.0 | 121 | 26 |
has |
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 | 141Currently supported on Windows only, in all contexts except for service workers. |
81 | 26 | 25.0 | 121 | 26 |
keys |
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 | 141Currently supported on Windows only, in all contexts except for service workers. |
81 | 26 | 25.0 | 121 | 26 |
size |
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 | 141Currently supported on Windows only, in all contexts except for service workers. |
81 | 26 | 25.0 | 121 | 26 |
values |
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 | 141Currently supported on Windows only, in all contexts except for service workers. |
81 | 26 | 25.0 | 121 | 26 |
© 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/WGSLLanguageFeatures