[DirectX][SPIRV] Add variable rate shading support - #1533
Merged
Merged
Conversation
llvm-beanz
approved these changes
Sep 24, 2026
inbelic
approved these changes
Sep 24, 2026
Co-authored-by: Finn Plummer <mail@inbelic.dev>
Icohedron
requested changes
Sep 24, 2026
Co-authored-by: Deric C. <cheung.deric@gmail.com>
Icohedron
approved these changes
Sep 25, 2026
bogner
reviewed
Sep 28, 2026
Comment on lines
544
to
+558
| @@ -503,10 +551,11 @@ class DXPipelineState : public offloadtest::PipelineState { | |||
| llvm::SmallVector<RootSignatureLayout> Layout, | |||
| ComPtr<ID3D12PipelineState> PSO, | |||
| std::optional<D3D_PRIMITIVE_TOPOLOGY> Topology, | |||
| bool IsRT = false) | |||
| bool IsRT = false, | |||
| D3D12_SHADING_RATE ShadingRate = D3D12_SHADING_RATE_1X1) | |||
| : offloadtest::PipelineState(GPUAPI::DirectX), Name(Name), | |||
| RootSig(RootSig), Layout(std::move(Layout)), PSO(PSO), | |||
| Topology(Topology), IsRayTracing(IsRT) {} | |||
| Topology(Topology), IsRayTracing(IsRT), ShadingRate(ShadingRate) {} | |||
Contributor
There was a problem hiding this comment.
I'm seeing a warning from clang here:
error: field 'IsRayTracing' will be initialized after field 'ShadingRate' [-Werror,-Wreorder-ctor]
Constructors should always initialize fields in the same order they're declared in the class, and it's least confusing if the argument order matches, so this should be:
DXPipelineState(llvm::StringRef Name, ComPtr<ID3D12RootSignature> RootSig,
llvm::SmallVector<RootSignatureLayout> Layout,
ComPtr<ID3D12PipelineState> PSO,
std::optional<D3D_PRIMITIVE_TOPOLOGY> Topology,
D3D12_SHADING_RATE ShadingRate = D3D12_SHADING_RATE_1X1,
bool IsRT = false)
: offloadtest::PipelineState(GPUAPI::DirectX), Name(Name),
RootSig(RootSig), Layout(std::move(Layout)), PSO(PSO),
Topology(Topology), ShadingRate(ShadingRate), IsRayTracing(IsRT) {}
Contributor
Author
There was a problem hiding this comment.
ok ill put up a pr to fix this
spall
added a commit
that referenced
this pull request
Sep 29, 2026
Fix warning by reordering class fields in DXPipelineState Addresses comment here: #1533 (comment)
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.
Add support for variable rate shading for both directx and spirv. Add a test case which uses SV_ShadingRate.
Closes #1044
Assisted by GPT-5.6 Sol