Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add linear_indexing language feature#5554

Merged
alan-baker merged 6 commits intogpuweb:maingpuweb/gpuweb:mainfrom
alan-baker:linear-indexesalan-baker/gpuweb:linear-indexesCopy head branch name to clipboard
Mar 10, 2026
Merged

Add linear_indexing language feature#5554
alan-baker merged 6 commits intogpuweb:maingpuweb/gpuweb:mainfrom
alan-baker:linear-indexesalan-baker/gpuweb:linear-indexesCopy head branch name to clipboard

Conversation

@alan-baker
Copy link
Copy Markdown
Contributor

  • Two new builtins:
    • global_invocation_index - linearized global_invocation_id
    • workgroup_index - linearized workgroup_id

Fixes #5154

Comment thread spec/index.bs Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 8, 2026

Previews, as seen when this build job started (f0b15af):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

Copy link
Copy Markdown
Member

@mehmetoguzderin mehmetoguzderin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a brief look and a minor question came to mind: was linear_indexing or linear_indices also considered as a name, given the technical nature of the specification? Apologies if this was already raised during the call and I missed the decision.

@alan-baker
Copy link
Copy Markdown
Contributor Author

I had a brief look and a minor question came to mind: was linear_indexing or linear_indices also considered as a name, given the technical nature of the specification? Apologies if this was already raised during the call and I missed the decision.

linear_indexing might be good. We didn't name on the call. I considered linear_indices, but wanted index specifically to match.

@mehmetoguzderin
Copy link
Copy Markdown
Member

Understood, linear_indexing might provide a reasonable balance. Thank you.

* Two new builtins:
  * `global_invocation_index` - linearized `global_invocation_id`
  * `workgroup_index` - linearized `workgroup_id`
@alan-baker alan-baker changed the title Add linear_indexes language feature Add linear_indexing language feature Feb 8, 2026
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread wgsl/index.bs Outdated
@jimblandy
Copy link
Copy Markdown
Contributor

I'll put this on the WGSL agenda once it comes out of draft.

@alan-baker
Copy link
Copy Markdown
Contributor Author

Draft CTS: gpuweb/cts#4595

@alan-baker alan-baker marked this pull request as ready for review February 17, 2026 04:18
Copy link
Copy Markdown
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with suggested wording tweaks, and optional notes.

Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread wgsl/index.bs
@alan-baker alan-baker requested a review from dneto0 February 26, 2026 19:42
Copy link
Copy Markdown
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jimblandy
Copy link
Copy Markdown
Contributor

Mozilla likes this change.

@jimblandy
Copy link
Copy Markdown
Contributor

@mwyrzykowski Could you take a look at this on Apple's behalf?

@alan-baker alan-baker merged commit 1234113 into gpuweb:main Mar 10, 2026
4 checks passed
@alan-baker alan-baker deleted the linear-indexes branch March 10, 2026 21:41
jenkins-chromium-github-sync Bot pushed a commit to armarok/chromium that referenced this pull request Mar 11, 2026
Spec: gpuweb/gpuweb#5554
CTS: gpuweb/cts#4595

Both were approved and landed.


Bug: 491559358
Change-Id: I81585882201d0bf18b86d28e47be4125650683b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7654497
Commit-Queue: Alan Baker <alanbaker@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1597693}
alan-baker added a commit to alan-baker/webgpu-headers that referenced this pull request Mar 30, 2026
Kangz pushed a commit to webgpu-native/webgpu-headers that referenced this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

builtins with a 3D variant should all have 1D variants (global_invocation_index, workgroup_index) (WGSL proposed language change)

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.