microsoft / microsoft/DirectXShaderCompiler
Library Reflection : Listing parameters return E_FAIL
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
As specified in #657
Creating a simple function compiled as a library
float3 Apply(float3 input)
{
return input * 2.0f;
}
Calling reflection on the library :
D3D12_FUNCTION_DESC func_desc;
auto fr = lib_ref->GetFunctionByIndex(0);
fr->GetDesc(&func_desc);
D3D12_PARAMETER_DESC pdesc;
auto p = fr->GetFunctionParameter(0);
HRESULT hr = p->GetDesc(&pdesc);
hr for the parameter returns E_FAIL
This prevents to scan for the function signatures, which in our old dx11 based system (which we are moving to dx12), allowed us to scan for function signatures, and if the signature matches, makes it eligible to be "linked" in a "host shader".
In d3d11 we had to do that by generating HLSL code (since function linking graph sadly does not support compute), but in the dxil case would allow us to perform everything at bytecode level, which is of course much neater.
For our type of applications it allows a lot of flexibility in various use cases (mostly gpu based procedural geometry modifiers, particle systems, distance fields generation), since our end user can just write a few simple functions, and connect them to a complex compute system without worrying about the inner complexity.
This would also in other cases allow us perform some pre validation before trying to attempt linking, so we can return an early error instead of : "linking failed", which would vastly improve our automated testing.
Thanks
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
Reproduce the issue with the Apply library function and the GetFunctionByIndex, GetFunctionParameter, and GetDesc reflection entry points shown in the report. Trace the library reflection path to determine why the parameter descriptor returns E_FAIL. Done means parameter reflection succeeds for the library and exposes the function signature needed before linking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100