Jump to content
  • Advertisement
Sign in to follow this  
dan01

Having issuses with shader reflection

This topic is 3172 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can not seem to ShaderReflection, my return from D3D10ReflectShader is always E_INVALIDARG, and the reflection ptr is NULL. my video card is a nvidia 8800GT, which I believe that limits my dx to 9/10. So, Im stuck with the D3D10ReflectShader which is a deprecated function. I wanting get the GetInput/OutputParameterDesc, is there a better approach to obtaining? here the code that I'm using, the effect is compiled & created with out any problems, so pShader is valid at the time that i call D3D10ReflectShader. UINT fxFlags = 0x00; dwShaderFlags = D3D10_SHADER_DEBUG | D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY; ID3D10Blob *pErrors = NULL; ID3D10Blob *pShader = NULL; EffectIncludeHelper includes; hr = D3DX10CompileFromFile( filename.Data(), macros, (ID3D10Include*)&includes, NULL, L"fx_4_0";, dwShaderFlags, fxflags, NULL, &pShader, &pErrors, NULL ); if(!FAILED( hr ) ) { hr = D3DX10CreateEffectFromMemory( pShader->GetBufferPointer(), pShader->GetBufferSize(), "None", macros, (ID3D10Include*)&includes, ansiprofile, dwShaderFlags, 0, engine->pdevice, pEffectPool, NULL, &pEffect10, &pErrors, NULL ); if ( pEffect10 ) { ID3D10ShaderReflection *reflect = NULL; hr = D3D10ReflectShader((void*) pShader->GetBufferPointer(), pShader->GetBufferSize(), &reflect); if ( reflect ) reflect->Release(); } } Any thoughts would be appreciated

Share this post


Link to post
Share on other sites
Advertisement
Checkout the ID3D10Effect interface you created, it has the Effect reflection interface which is built upon shader reflection. You should be able to get all the information you need directly from the ID3D10Effect object. The Shader reflection functions are only usable on non-effects compiled shaders. You could extract individual shaders from an Effects pass and then reflect those if you want, but that is not often needed.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!