ファイル
ComputeSharp/src/ComputeSharp.Dxc

ComputeSharp cover image

Overview 📖

ComputeSharp.Dxc is an extension library for ComputeSharp bundling the DXC compiler and enabling shader reflection.

For users that are familiar with the HLSL language and might want to access more info on a given shader generated by ComputeSharp, such as the compiled HLSL code or the statistics exposed by the DirectX 12 reflection APIs, the library includes a ReflectionServices class that allows to easily gather all these details on a given shader type.

Quick start 🚀

Assuming we have a MyShader type defined, here's how you can use ComputeSharp.Dxc to inspect it:

ShaderInfo shaderInfo = ReflectionServices.GetShaderInfo<MainKernel>();

// Access info here, for instance...
string hlslSource = shaderInfo.HlslSource;
uint numberOfResources = shaderInfo.BoundResourceCount;
uint instructionCount = shaderInfo.InstructionCount;

There's more!

For a complete list of all features available in ComputeSharp, check the documentation in the GitHub repo.