microsoft / microsoft/DirectXShaderCompiler
StructuredBuffer is reflected as constant buffer
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
StructuredBuffer varName: register(t1) is being reflected as a constant buffer
Steps to Reproduce
https://shader-playground.timjones.io/dceaeee1d51b72b3e87ac7e6146c77bf
i'm trying to implement average luminance hdr and the shader above is reflecting t1 as a constant buffer while doing this
D3D12_SHADER_DESC shaderDesc{};
shaderReflection->GetDesc(&shaderDesc);
Actual Behavior
doing this will enumerate AverageLuminance as a constant buffer
for (unsigned int paramIdx = 0; paramIdx < desc.ConstantBuffers; paramIdx++)
{
auto cbReflection = reflection->GetConstantBufferByIndex(paramIdx);
D3D12_SHADER_BUFFER_DESC paramDesc{};
cbReflection->GetDesc(¶mDesc);
std::string cbufferName(paramDesc.Name);
Environment
dxc.exe --version
dxcompiler.dll: 1.8 - 1.8.2407.7 (416fab6b5); dxil.dll: 1.8(101.8.2407.12)
Win11
if this behavior is expected please discard the bug
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
The report names no repository files or tests; start with the linked shader-playground reproduction and the D3D12 reflection entry points shown, including GetDesc and GetConstantBufferByIndex. Determine whether StructuredBuffer at register(t1) should appear among constant buffers; done means establishing the expected behavior and locating the relevant compiler or reflection test area.
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
- Needs clarification
- Newbie friendliness
- 35/100