Move dispatch dimensions and vertex count to new DispatchParameters with defaults#1153
Merged
Merged
Conversation
aca68cc to
e036a23
Compare
This was referenced May 5, 2026
e036a23 to
3de99f6
Compare
MarijnS95
reviewed
May 7, 2026
19 tasks
MarijnS95
reviewed
May 7, 2026
Comment on lines
+604
to
+610
| case ShaderPipelineKind::TraditionalRaster: | ||
| if (DispatchParameters.DispatchGroupCount != | ||
| std::array<uint32_t, 3>{1, 1, 1}) | ||
| return llvm::createStringError( | ||
| "DispatchParameters.DispatchGroupCount set on a TraditionalRaster " | ||
| "pipeline. Only allowed on a Compute pipeline."); | ||
| break; |
Collaborator
There was a problem hiding this comment.
Should we validate that VertexCount is not set if a vertex buffer was provided, or are there sensible reasons to override the "default" number of vertices in a buffer?
Contributor
Author
There was a problem hiding this comment.
There are valid reasons to specify this manually even though you have defined a vertex buffer. Especially when we start passing arguments like FirstVertex.
Collaborator
There was a problem hiding this comment.
The only validation would be if FirstVertex + VertexCount <= NumVerticesInBuffer perhaps?
Contributor
Author
There was a problem hiding this comment.
Technically that would still be a valid case though, but you would be reading zeroes.
…at happens when you do.
MarijnS95
approved these changes
May 7, 2026
DispatchParameters. Allow more flexibility and introduce useful default values.DispatchParameters with defaults
bogner
approved these changes
May 7, 2026
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.
Fixes #1152
There was no way to specify the vertex count for a test that uses the TraditionalRaster pipeline.
Since vertex buffers are not required for doing rasterization, and is actually quite a common use case, we need to be able to specify that as well.
In the future we will also need to support indexed and instanced draws, for which more parameters need to be specified.
Specifying these parameters are part of the shader doesn't really make sense since they apply to the whole pipeline.
For those reasons I am introducing a
DispatchParametersfield where the user can specify the exact parameters for how a pipeline should be dispatched.While making this change I found that 99% of the compute shader tests dispatch a single threadgroup. Since there is no use-case for dispatching no threads (as far as I am aware), I made dispatching a single thread group a default value. This simplifies writing tests.
For TraditionalRaster tests we can still rely on calculating the vertex count from the size of the vertex buffer and vertex stride if it is not specified in the .yaml section.