Jump to content
  • Advertisement
Sign in to follow this  
Blackhole12

Shader errors not being written

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

    ID3DXBuffer *pBuffer = NULL;
    _pengine = pengine;

    if(FAILED(D3DXCreateEffectFromFile(_pengine->getDriver()->getDevice(), "bloom.fx", NULL, NULL, 
D3DXFX_NOT_CLONEABLE || D3DXSHADER_DEBUG, NULL, &effect, &pBuffer)));
      _pengine->ManualErr("The effect 'bloom.fx' failed to compile with the following errors: ", 
(char*)pBuffer->GetBufferPointer(),2);
That code compiles and runs fine in Debug mode, but in Release mode, the bloom.fx file fails to compile. However, mysteriously enough, the *pBuffer pointer gets set to NULL after D3DXCreateEffectFromFile() has been called, which results in a null reference error when the error output is accessed. This is, to say the least, incredibly annoying. I have deliberately created a syntax error in the FX file and confirmed that the pBuffer functions normally while in Debug mode. In release mode, however, it just doesn't work. I can't figure out what in the world is wrong with the FX file and I can't figure out why the heck the pBuffer would get set to NULL after D3DXCreateEffectFromFile() gets called. Does anyone here have a clue as to why this would happen?

Share this post


Link to post
Share on other sites
Advertisement
...Yes, I went back and checked. I had stuck the .fx file in the debug folder and not the release folder.

The most confusing errors are always the stupidest ones...

Share this post


Link to post
Share on other sites
Hi,
I faced the same problem.

Have you tried using PIX? I used to get D3DERR_INVALIDCALL.. In that case, try giving the COMPLETE path of the file bloom.fx. Mine worked when I did that.

hth,
Saranya

Share this post


Link to post
Share on other sites
The debug runtimes will output that 'file not found' error message and any compile errors. Yes, best to catch it in-code and output it yourself but just in case you can't/forget there is another way [wink]

hth
Jack

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!