microsoft / microsoft/DirectXShaderCompiler

IDxcResult output enumeration is reporting multiple DXC_OUT_NONE values and missing supported DXC_OUT_ values.

Open
#6,523 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description
Calling IDxcResult::GetNumOutputs( ) and enumerating outputs by index is returning incorrect results

Steps to Reproduce

IDxcResult* result; // Obtained from Compile( )

uint32_t numOutputs = result->GetNumOutputs();
std::cout << "Compiled result contains " << numOutputs << " outputs\n";
for (uint32_t i = 0; i < numOutputs; ++i)
{
    std::cout << result->GetOutputByIndex(i) << " found\n";
}

Actual Behavior
The total number of supported outputs is correct, but DXC_OUT_NONE is reported multiple times.

Compiled result contains 6 outputs
Primary output is DXC_OUT_OBJECT
DXC_OUT_OBJECT found
DXC_OUT_ERRORS found
DXC_OUT_PDB found
DXC_OUT_HASH found
DXC_OUT_NONE found
DXC_OUT_NONE found

Environment

  • DXC version dxcompiler.dll: 1.8 - 1.8.2403.37 (11e1318c3); dxil.dll: 1.8(101.8.2403.24)
  • Host Operating System Windows 11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with IDxcResult from Compile(), then inspect the implementations of GetNumOutputs() and GetOutputByIndex(). Verify the output enumeration against the supported DXC_OUT_ values; done means no duplicate DXC_OUT_NONE values are returned and all supported outputs are enumerated once.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.