• 12
• 10
• 10
• 13
• 10

# Shader errors not being written

This topic is 3680 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
It just can't find the .fx file...?

##### Share on other sites
...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 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