Improve validation of shader pipeline type.#1148
Merged
manon-traverse merged 2 commits intollvm:mainfrom May 5, 2026
Merged
Conversation
2487527 to
ea75381
Compare
llvm-beanz
approved these changes
May 4, 2026
bogner
approved these changes
May 4, 2026
MarijnS95
reviewed
May 5, 2026
MarijnS95
reviewed
May 5, 2026
Comment on lines
+582
to
+585
| if (HasShaderType[llvm::to_underlying(Stages::Vertex)]) { | ||
| Kind = ShaderPipelineKind::TraditionalRaster; | ||
| return llvm::Error::success(); | ||
| } |
Collaborator
There was a problem hiding this comment.
How about having a pixel shader without a vertex shader? Or vice-versa?
Contributor
Author
There was a problem hiding this comment.
Pixel shader without a vertex shader is invalid. Vertex shader without pixel shader is valid.
The case without a pixel shader is used for depth-only rendering.
MarijnS95
approved these changes
May 5, 2026
6fac7b3 to
8a9635f
Compare
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.
There are some restrictions on what shaders are allowed to go together in a single shader pipeline.
This change defines two kinds:
Compute, andTraditionalRaster. In the future we can add support for other likeMeshShaderRaster,RayTracing, andWorkGraph.By validating once if the provided shaders are a valid pipeline and assigning a pipeline type when we load from the YAML file, we can keep the logic in
executeProgramsimple and won't have to do any more expensive validation there.