Repository navigation
[WebGPU] Support dispatch constants with uniform buffers - #25285
Open
anutosh491 wants to merge 1 commit into
Open
anutosh491 wants to merge 1 commit into
anutosh491 wants to merge 1 commit into
Conversation
Signed-off-by: anutosh491 <[email protected]>
anutosh491
requested review from
Manewing,
benvanik,
devtbi,
egebeysel,
jschuhmacher and
schuermans-roofline
as code owners
November 15, 2026 10:20
devtbi
reviewed
Nov 17, 2026
devtbi
left a comment
Contributor
There was a problem hiding this comment.
generally looks okay, did not find anything major but I'm also not a WebGPU expert :D maybe @AGindinson wants to give it a quick look too
|
|
||
| tint::core::ir::Module irModule = irResult.Move(); | ||
| tint::core::ir::transform::ChangeImmediateToUniformConfig uniformConfig; | ||
| uniformConfig.immediate_binding_point = tint::BindingPoint{1, 0}; |
| return iree_make_status(IREE_STATUS_INVALID_ARGUMENT, | ||
| "dispatch constants must be 32-bit aligned"); | ||
| } | ||
| uint32_t binding_count = (uint32_t)bindings.count; |
Contributor
There was a problem hiding this comment.
unless otherwise guaranteed, needs checking if .count fits into uint32
| } | ||
| uint32_t binding_count = (uint32_t)bindings.count; | ||
| uint32_t constant_count = constants.data_length / sizeof(uint32_t); | ||
| uint32_t header_size = constant_count ? 7 : 6; |
This branch has not been deployed
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.
I hit this while running D-FINE on WebGPU. Dispatches using push constants failed during WGSL generation because Tint rejected the immediate address space. The runtime also wasn't carrying these values through the WebGPU dispatch instruction.
This reuses Tint's
ChangeImmediateToUniformtransformation and binds the resulting uniform buffer at group 1, binding 0. Dispatch constants are copied into the instruction stream, with an owned copy for deferred dispatches. Temporary buffers use the existing cleanup mechanism.