Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

[D3D12] Root Signature Reflection

$
0
0

I'm trying to get a shader's root signature via reflection so that I can validate what I'm setting.

 

First of all, this page for D3D12CreateRootSignatureDeserializer says that the function has been superceded by D3D12CreateVersionedRootSignatureDeserializer, but I apparently don't have that function in my DirectX 12 header/lib?

 

Regardless, I tried calling D3D12CreateRootSignatureDeserializer as follows:

.

ComPtr<ID3D12RootSignatureDeserializer> deserializer;
D3D12CreateRootSignatureDeserializer(blob->GetBufferPointer(), blob->GetBufferSize(), IID_PPV_ARGS(&deserializer));
D3D12_ROOT_SIGNATURE_DESC *desc = (D3D12_ROOT_SIGNATURE_DESC *)deserializer->GetRootSignatureDesc();

.

But this crashes, because the ID3D12RootSignatureDeserializer pointer returned is null.  "blob" in that code is a ComPtr<ID3DBlob> returned by D3DCompileFromFile, and that part is working fine (I can compile and render using the shader, I just can't get the root signature via reflection).  I'm not sure if the blob is the correct thing to pass, as the documentation only says "If an application has a serialized root signature already or has a compiled shader that contains a root signature and wants to determine the layout definition, it can call D3D12CreateRootSignatureDeserializer to generate a ID3D12RootSignatureDeserializer interface."

 

Anyone have any experience with either of these two issues?


Viewing all articles
Browse latest Browse all 17560

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>