Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

DX11 D3DX11CreateEffectFromMemory() fails in release build

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

Does anyone have any ideas as to why D3DX11CreateEffectFromMemory() is returning E_NOINTERFACE in release build and causing me to crash, even though it works in debug mode and i can see my DX drawing fine?



[source lang="cpp"] std::ifstream fin("Shaders.fxo", std::ios::binary);

fin.seekg(0, std::ios_base::end);
int size = (int)fin.tellg();
fin.seekg(0, std::ios_base::beg);
std::vector<char> compiledShader(size);
fin.read(&compiledShader[0], size);
fin.close();

// Create Effect from Memory
// TODO: Move into renderer?
hrErrorCode = D3DX11CreateEffectFromMemory(&compiledShader[0], size, 0, g_MyRenderer.GetDevice(), &m_pEffectFile);[/source]


Here is my shader code btw

[source lang="cpp"]struct VS_INPUT
{
float4 pos : POSITION;
float4 color : COLOR;
};


struct PS_INPUT
{
float4 pos : SV_POSITION;
float4 color : COLOR;
};


PS_INPUT VS_Main( VS_INPUT In )
{
PS_INPUT vsOut = (PS_INPUT) 0;

vsOut.pos = In.pos;
vsOut.color = In.color;

return vsOut;
}



float4 PS_Main(PS_INPUT input) : SV_TARGET
{
return input.color;
}


technique11 SimplePassThrough
{
pass P0
{
// Set Shaders
SetVertexShader( CompileShader(vs_4_0, VS_Main() ));
SetGeometryShader( NULL );
SetPixelShader(CompileShader(ps_4_0, PS_Main() ));
}
}
[/source] Edited by nuclear123

Share this post


Link to post
Share on other sites
Advertisement
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!