DX11 - Shader Reflection - Interface not supported

Started by
3 comments, last by Migi0027 10 years, 5 months ago

Hi guys. wink.png

So I'm having a slight problem here, I've just started on the shader reflection as it might prove useful for me, but some obstacles came along the way, some were fixed, but not this one.

How I'm attempting it:


// Compile e.g. the Vertex Shader
D3DX11CompileFromFile(...)

// Create the VS Shader
dev->CreateVertexShader(...)

// Set up the shader reflection
ID3D11ShaderReflection* pReflector = NULL; 
HRESULT hr = 
	D3DReflect( Passes[p].VS->GetBufferPointer(), Passes[p].VS->GetBufferSize(), IID_ID3D11ShaderReflection, (void**)&pReflector); 
	
if (FAILED(hr)) // I didn't directly just check the returned HR, because it's used later...
{
	std::string error = std::string((std::string)"Shader Reflection Failed, Error:\n" + _com_error(hr).ErrorMessage()).c_str(); // Yeah, this is a bit ugly, but it works.
	CE_ERROR(error.c_str(), "Shader Error");
}

D3D11_SHADER_DESC desc; 
pReflector->GetDesc( &desc ); 

So what happens is that the HR fails, with the following error message: (Please keep in mind that the message was in another language, so this is just a rough translation):


This interface is not supported

So my questions are:

  • What have I done wrong?
  • (Bonus) Is there any way of setting the error messages to english?

I've stumbled across several threads, like this one:

http://xboxforums.create.msdn.com/forums/t/63358.aspx

But unfortunately I didn't get it to work.

Thank you for your time.

-MIGI0027

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Advertisement

Based on what Chuck says in that thread, it sounds like you might be mixing up your shader compiler versions and/or your D3D headers. Are you using VS 2012? If you are, it's probably including the headers from the Windows 8 SDK and this could mean you're getting the GUID for IID_ID3D11ShaderReflection that corresponds to d3dcompiler_46.dll, instead of d3dcompiler_43.dll which is the version used by D3DX11CompileFromFile. You should look for the value of IID_ID3D11ShaderReflection in the June 2010 SDK headers, and make sure that it matches you're passing to D3DReflect. If it doesn't, you should either fix your include order or explicitly pass the correct GUID to D3DReflect.

D3DX11CompileFromFile() is deprecated. Shader compilation functions are now part of D3D, not D3DX.

You should use D3DCompileFromFile() to compile you shaders, that should solve your issues.

Yes I'm using VS 2012 (v11), so that's most likely the issue, I'm going to try and copy the IID from the Dx headers. And I'll also adapt to the D3DCompileFromFile.

I'll post the results here as soon as I can. wink.png

Thank you.

-MIGI0027

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Ok, thanks guys, It seems like the problem has been fixed (For now! smile.png )

Actually, this was partly my fault as well, it seems like I was linking against DX11Effects.lib, which had a different definition for D3DReflect, which only accepted the GUI for the effects, so removing this link fixed the issue (I'm not really sure why it was linked, as I never used it...)

Anyways, thanks for you help!

-MIGI0027

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

This topic is closed to new replies.

Advertisement