Repository navigation
[SPIR-V] Add -fvk-bind-*-heap flag to DXC - #6919
Merged
Merged
Conversation
Those flags allow the user to hardcode the binding ID for the heaps. This allow the user to either force heap aliasing, or simply have more control over the heaps. Fixes microsoft#6913 Signed-off-by: Nathan Gauër <[email protected]>
Nathan Gauër (Keenuts)
requested review from
Cassandra Beckley (cassiebeckley) and
Steven Perron (s-perron)
and removed request for
Steven Perron (s-perron)
September 18, 2024 10:53
Steven Perron (s-perron)
requested changes
Sep 18, 2024
Collaborator
There was a problem hiding this comment.
The only part that seems missing that other resources that are automatically assigned resources bindings should not use the fixed binding for the descriptor heaps:
// RUN: %dxc -T cs_6_6 -E main -fcgl %s -spirv -fvk-bind-resource-heap 0 0 -fvk-bind-counter-heap 1 0 | FileCheck %s
// CHECK-DAG: OpDecorate %a DescriptorSet 0
// CHECK-DAG: OpDecorate %a Binding 2
// CHECK-DAG: OpDecorate %counter_var_a DescriptorSet 0
// CHECK-DAG: OpDecorate %counter_var_a Binding 3
RWStructuredBuffer<uint> a;
[numthreads(1, 1, 1)]
void main() {
// CHECK-DAG: OpDecorate %ResourceDescriptorHeap DescriptorSet 0
// CHECK-DAG: OpDecorate %ResourceDescriptorHeap Binding 0
// CHECK-DAG: OpDecorate %counter_var_ResourceDescriptorHeap DescriptorSet 0
// CHECK-DAG: OpDecorate %counter_var_ResourceDescriptorHeap Binding 1
RWStructuredBuffer<uint> b = ResourceDescriptorHeap[1];
a.IncrementCounter();
b.IncrementCounter();
}
Collaborator
Author
You mean a test checking only resources related to the flag are fixed, and the others are still keeping the automatic behavior? |
Collaborator
Author
|
Oh got it |
Signed-off-by: Nathan Gauër <[email protected]>
Collaborator
Author
|
thanks for the finding! pre-reserved the IDs. |
Steven Perron (s-perron)
approved these changes
Sep 18, 2024
Cassandra Beckley (cassiebeckley)
approved these changes
Sep 19, 2024
Mxr (SjMxr233)
pushed a commit
to ShaderHelper/DirectXShaderCompiler
that referenced
this pull request
Jul 24, 2025
Those flags allow the user to hardcode the binding ID for the heaps. This allow the user to either force heap aliasing, or simply have more control over the heaps. Fixes microsoft#6913 --------- Signed-off-by: Nathan Gauër <[email protected]>
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.
Those flags allow the user to hardcode the binding ID for the heaps. This allow the user to either force heap aliasing, or simply have more control over the heaps.
Fixes #6913