0

I have a shader as an 'ID3D11VertexShader' (or generally any 'ID3D11*Shader') instance. For my application I would like to read the shader byte code that is associated with this instance.

The goal is the create an D3D11InputLayout without having to carry around the byte code blob.

Is there a way in DirectX 11 to retrieve the byte code, that was used to create this shader? I was looking for something similar to glGetProgramBinary (that would return the byte code instead of the binary code).

  • Why would DirectX retain this bytecode after compiling the shader? – DMGregory Oct 22 '19 at 02:54
  • Related: https://gamedev.stackexchange.com/questions/25384/how-best-to-handle-id3d11inputlayout-in-rendering-code – Maximus Minimus Oct 22 '19 at 08:24
  • The 2nd sentence says it all, you want to get the input layout. If you have the shader, have you looked at Shaderreflection -> https://docs.microsoft.com/en-us/windows/win32/api/d3d11shader/nn-d3d11shader-id3d11shaderreflection. Sounds like you have the shader instance, this I believe will give you back the fields, offsets etc. – ErnieDingo Oct 24 '19 at 21:33

0 Answers0