Advertisement

Determine function type based on ID3D12FunctionReflection ?

Started by May 24, 2019 07:23 AM
1 comment, last by Andrew Naumov 5 years, 8 months ago

Hi

Is there any way to determine function type based on what is available from ID3D12FunctionReflection ? (I mean D3D12_FUNCTION_DESC probably)

I want to automatically extract [shader("miss")], [shader("closesthit")] etc. from passed library (that is not known at compile time) and do not depend on the mangled names of functions to determine what they are, is there any way to know their type (or at least to annotate them with some custom string that is available during reflection ?)

You can get it with D3D12_SHVER_GET_TYPE(D3D12_FUNCTION_DESC::Version) or with hlsl::RDAT::FunctionReader::GetShaderKind().

Example for first way:

https://github.com/andrejnau/FlyCube/blob/636839889748ca5aaad0b9b2fb7b43313b1933de/src/Modules/Program/DX12ProgramApi.cpp#L29

And for second way:

https://github.com/andrejnau/FlyCube/blob/8bd607a8ad0e478321f2d1a128a31d5db06eb1eb/src/Modules/Program/DX12ProgramApi.cpp#L39

This topic is closed to new replies.

Advertisement