feat(graphics): expose WGSL unrestricted_pointer_parameters as a device cap#8785
Merged
Merged
Conversation
…ce cap Adds detection and automatic wiring for the WGSL `unrestricted_pointer_parameters` language feature, matching the pattern used for `linear_indexing`, `subgroup_id`, and other WGSL features: - `supportsUnrestrictedPointerParameters` device flag, probed from navigator.gpu.wgslLanguageFeatures. - `CAPS_UNRESTRICTED_POINTER_PARAMETERS` shader define for conditional compilation. - `requires unrestricted_pointer_parameters;` directive automatically injected into WGSL shaders on supporting devices. Also extends the WebGPU init log to include the WGSL language features advertised by the browser, alongside the existing GPU feature list.
This was referenced May 27, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds detection and automatic wiring for the WGSL
unrestricted_pointer_parameterslanguage feature, following the same pattern aslinear_indexing,subgroup_id, and the other WGSL feature caps.Companion to #8784 — that PR worked around the missing feature by inlining the helper; this PR exposes the cap so future shaders can opt into pointer-of-storage parameters on devices that support it, with a portable fallback path on browsers that don't.
Changes:
GraphicsDevice.supportsUnrestrictedPointerParametersflag, probed fromnavigator.gpu.wgslLanguageFeaturesinWebgpuGraphicsDevice#initDeviceCaps.CAPS_UNRESTRICTED_POINTER_PARAMETERSshader define for conditional compilation (#ifdef).requires unrestricted_pointer_parameters;directive automatically injected into WGSL shaders on supporting devices viaShaderDefinitionUtils.getWGSLEnables.WebGPU init log extended to list the browser's advertised WGSL language features alongside the GPU feature list. Example:
Notes:
falsethere and norequiresdirective is emitted, so existing portable shaders continue to compile.