microsoft / microsoft/DirectXShaderCompiler

Retrieving reflection data for structs used in input signatures

Open
#3,535 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am writing a code generator based on D3D12 shader reflection data. Given a simple vertex shader:

struct VertexIn
{
    float3 mPos : POSITION;
    float3 mColor : COLOR;
};
struct VertexOut;  // layout unimportant to question

VertexOut VS(VertexIn vin) 
{ 
    // some math here, return a VertexOut
}

I can use ID3D12ShaderReflection::GetInputParameterDesc to get the type and semantic for each member of VertexIn, as well as the register it is mapped to. However, I would like to retrieve the names of the VertexIn members (i.e. "mPos" and "mColor") for my generated code. Is there a way to do this?

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 with the D3D12ShaderReflection::GetInputParameterDesc API and the sample HLSL structs in the issue, then trace how reflection records input members and names. Done means establishing whether mPos and mColor are exposed by the available reflection data, and documenting the limitation or identifying the relevant compiler metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.