Sign in to follow this  

Having issuses with shader reflection

This topic is 2954 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
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

This topic is 2954 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this