Shader errors not being written

Started by
3 comments, last by jollyjeffers 16 years, 2 months ago
    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?
Advertisement
It just can't find the .fx file...?
...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...
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
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement