microsoft / microsoft/DirectXShaderCompiler
Validator needs to prevent invalid handle in AnnotateHandle
Open
Nobody has claimed this yet.
bug
validation
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
// RUN: %dxc -T vs_6_6 -E main %s
// Using CBV.u before defining CBV to a specific resource should result in error.
// It does result in a warning:
// warning: variable 'CBV' is uninitialized when used within its own initialization [-Wuninitialized]
// Should we make this warning an error by default?
// It also looks up the index with an invalid zeroinitializer handle in DXIL, which should cause a validation failure in any case:
// %1 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle zeroinitializer, %dx.types.ResourceProperties { i32 13, i32 4 }) ; AnnotateHandle(res,props) resource: CBuffer
struct MyCB {
uint u;
};
static ConstantBuffer<MyCB> CBV = ResourceDescriptorHeap[CBV.u];
uint main() : OUT {
return CBV.u;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the embedded HLSL reproducer with %dxc -T vs_6_6 -E main %s and inspect the validation path for the AnnotateHandle call. Done means the invalid zeroinitializer handle causes a validation failure, rather than only producing the reported uninitialized-variable warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100