Jump to content
  • Advertisement
Sign in to follow this  

DX11 D3DX11CreateEffectFromMemory() fails in release build

This topic is 2336 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);

// 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 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
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!