Skip to content

Improve validation of shader pipeline type.#1148

Merged
manon-traverse merged 2 commits intollvm:mainfrom
Traverse-Research:improve-pipeline-type-classification
May 5, 2026
Merged

Improve validation of shader pipeline type.#1148
manon-traverse merged 2 commits intollvm:mainfrom
Traverse-Research:improve-pipeline-type-classification

Conversation

@manon-traverse
Copy link
Copy Markdown
Contributor

There are some restrictions on what shaders are allowed to go together in a single shader pipeline.
This change defines two kinds: Compute, and TraditionalRaster. In the future we can add support for other like MeshShaderRaster, RayTracing, and WorkGraph.

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 executeProgram simple and won't have to do any more expensive validation there.

@manon-traverse manon-traverse self-assigned this May 4, 2026
@manon-traverse manon-traverse force-pushed the improve-pipeline-type-classification branch 2 times, most recently from 2487527 to ea75381 Compare May 4, 2026 15:52
Comment thread lib/API/DX/Device.cpp Outdated
Comment thread lib/API/VK/Device.cpp Outdated
Comment thread lib/Support/Pipeline.cpp
Comment on lines +582 to +585
if (HasShaderType[llvm::to_underlying(Stages::Vertex)]) {
Kind = ShaderPipelineKind::TraditionalRaster;
return llvm::Error::success();
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How about having a pixel shader without a vertex shader? Or vice-versa?

Copy link
Copy Markdown
Contributor Author

@manon-traverse manon-traverse May 5, 2026

Choose a reason for hiding this comment

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

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.

@manon-traverse manon-traverse force-pushed the improve-pipeline-type-classification branch from 6fac7b3 to 8a9635f Compare May 5, 2026 08:58
@manon-traverse manon-traverse merged commit a997bac into llvm:main May 5, 2026
21 of 22 checks passed
@MarijnS95 MarijnS95 deleted the improve-pipeline-type-classification branch May 5, 2026 13:15
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.

4 participants