Jump to content
  • Advertisement
ADDMX

DX12 Determine function type based on ID3D12FunctionReflection ?

Recommended Posts

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 ?)

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!