DirectX-Headers icon indicating copy to clipboard operation
DirectX-Headers copied to clipboard

Exposing some hidden CFunctionReflection members to the front end (ID3D12LibraryReflection/ID3D12FunctionReflection)

Open Nielsbishere opened this issue 7 months ago • 10 comments

The DXC backend has the following parameter: const DxilFunctionProps *m_pProps Which has a large number of members that are not accessible by ID3D12FunctionReflection and D3D12_FUNCTION_DESC. The most interesting ones being raytracing and workgraph related. Exposing these saves me a lot of headache, as I won't need to parse these manually, especially since they're already available in DXC.

The following parameters still need to be exposed (and I'll take a look later to add them):

  • Serialized root signature could have a getter which returns a DxcBuffer.
  • InputNodes / OutputNodes could have a getter which returns a CNodeIOProperties* and length. Where each CNodeIOProperties has const char* for name as well as UINT id.
  • NodeID NodeShaderId, NodeShaderSharedInput could use UINT ids in the D3D12_NODE_SHADER_DESC struct, while leaving the strings as getters.
  • D3D12_SHADER_DESC might need an update to provide similar functionality.

The following parameters I won't add, since I have no idea how to properly expose them and if they're even useful to the front end:

  • Vertex reflection: clipPlanes[6] returns an llvm::Constant
  • Hull reflection: returns patchConstFunction as llvm::Function, which won't be accessible.

Since these are llvm internal values, I'm guessing that they might not be very useful for the front end.

This relates to a DXCompiler issue & PR.

Nielsbishere avatar Jul 25 '24 21:07 Nielsbishere