Jump to content

  • Log In with Google      Sign In   
  • Create Account

DX11 - Shader Reflection - Interface not supported

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Migi0027   Crossbones+   -  Reputation: 1508


Posted 03 November 2013 - 07:03 AM

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

// Create the VS Shader

// Set up the shader reflection
ID3D11ShaderReflection* pReflector = NULL; 
	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:



But unfortunately I didn't get it to work.


Thank you for your time.



#2 MJP   Moderators   -  Reputation: 10526


Posted 04 November 2013 - 12:12 AM

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.

#3 N.I.B.   Members   -  Reputation: 1067


Posted 04 November 2013 - 12:40 AM

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.

Edited by N.I.B., 04 November 2013 - 12:41 AM.

#4 Migi0027   Crossbones+   -  Reputation: 1508


Posted 04 November 2013 - 07:05 AM

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.


#5 Migi0027   Crossbones+   -  Reputation: 1508


Posted 06 November 2013 - 01:56 PM

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!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.