Jump to content
  • Advertisement

DX12 Determine function type based on ID3D12FunctionReflection ?

Recommended Posts


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

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

Example for first way:


And for second way:


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!