Skip to content

Hull shader reflection has zero as cControlPoints #1540

Description

@manas-kulkarni

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugBug, regression, crash

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions