I am using IDxcContainerReflection to reflect the DXIL bytecode and get the ID3D12ShaderReflection from it as shown in the Dxc Container Unit Test. But it fails to correctly reflect the number of output control points.
When I compile using fxc and use the regular D3DReflect function, it gets the correct number of output control points.
Code for extracting ID3D12ShaderReflection from DXIL bytecode
IDxcLibrary* pLibrary = NULL;
gDxcDllHelper.CreateInstance(CLSID_DxcLibrary, &pLibrary);
IDxcBlobEncoding* pBlob = NULL;
pLibrary->CreateBlobWithEncodingFromPinned((LPBYTE)shaderCode, (UINT32)shaderSize, 0, &pBlob);
IDxcContainerReflection* pReflection;
UINT32 shaderIdx;
gDxcDllHelper.CreateInstance(CLSID_DxcContainerReflection, &pReflection);
pReflection->Load(pBlob);
(pReflection->FindFirstPartKind(DXIL_FOURCC('D', 'X', 'I', 'L'), &shaderIdx));
(pReflection->GetPartReflection(shaderIdx, __uuidof(ID3D12ShaderReflection), (void**)&d3d12reflection));
Hull shader file
grass_tesc.txt
The header file generated after compiling the hull shader using dxc. The number of control points is correct here.
grass.txt
So it seems that something goes wrong when extracting the ID3D12ShaderReflection object using the container reflection interface
I am using IDxcContainerReflection to reflect the DXIL bytecode and get the ID3D12ShaderReflection from it as shown in the Dxc Container Unit Test. But it fails to correctly reflect the number of output control points.
When I compile using fxc and use the regular D3DReflect function, it gets the correct number of output control points.
Code for extracting ID3D12ShaderReflection from DXIL bytecode
Hull shader file
grass_tesc.txt
The header file generated after compiling the hull shader using dxc. The number of control points is correct here.
grass.txt
So it seems that something goes wrong when extracting the ID3D12ShaderReflection object using the container reflection interface