You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the solution you'd like
I'd like to have a way to introspect a shader's structured buffers and read their internal layout. Currently, it seems like the only way to access information about a structured buffer is to use ID3D12ShaderReflection::GetResourceBindingDesc, from which I can get the resource's name and input type (D3D_SIT_STRUCTURED or D3D_SIT_UAV_RWSTRUCTURED in the case of structured buffers), and the element stride in the D3D12_SHADER_INPUT_BIND_DESC::NumSamples field, as documented in this issue.
This does not tell us anything about the specific fields that are present in the structured buffer. For more detail, it would be nice to have a way to get to the underlying type of the structured buffer. What I'd need is an API call to get from a D3D12_SHADER_INPUT_BIND_DESC to a ID3D12ShaderReflectionType* in case the input binding is a structured buffer.
All the necessary information is available in the shader disassembly as returned by D3DDisassemble, for instance:
The only missing piece is a public API to access the type information from an input description.
Describe alternatives you've considered
I've tried parsing the pdb generated by DXC with the DIA SDK, but it has the same missing link: I can get the stride and name for a structured buffer, but not the underlying type
The text was updated successfully, but these errors were encountered:
Describe the solution you'd like
I'd like to have a way to introspect a shader's structured buffers and read their internal layout. Currently, it seems like the only way to access information about a structured buffer is to use ID3D12ShaderReflection::GetResourceBindingDesc, from which I can get the resource's name and input type (
D3D_SIT_STRUCTURED
orD3D_SIT_UAV_RWSTRUCTURED
in the case of structured buffers), and the element stride in theD3D12_SHADER_INPUT_BIND_DESC::NumSamples
field, as documented in this issue.This does not tell us anything about the specific fields that are present in the structured buffer. For more detail, it would be nice to have a way to get to the underlying type of the structured buffer. What I'd need is an API call to get from a D3D12_SHADER_INPUT_BIND_DESC to a ID3D12ShaderReflectionType* in case the input binding is a structured buffer.
All the necessary information is available in the shader disassembly as returned by
D3DDisassemble
, for instance:Shader:
Disassembly:
The only missing piece is a public API to access the type information from an input description.
Describe alternatives you've considered
I've tried parsing the pdb generated by DXC with the DIA SDK, but it has the same missing link: I can get the stride and name for a structured buffer, but not the underlying type
The text was updated successfully, but these errors were encountered: