I have a pretty basic problem with debugging my shader.
It works as such, I can make a breakpoint and step through the code - however, when I reach a conditional (if/else), it just walks past it, no matter what it would evaluate as. After it goes through the if-condition, it happily proceeds to ignore the else and goes through that code as well!
But when the code runs without breakpoints, there is no problems, and it is obvious that the conditional works just fine.
ARGH! Help me please, I can't see what I am doing wrong.
This is how I set up the device:
DWORD behaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
hr = m_pD3D->CreateDevice( m_d3dSettings.AdapterOrdinal(), D3DDEVTYPE_REF, m_hWndFocus, behaviorFlags, &m_d3dpp, &m_pd3dDevice );
And this is how I set up the shader (DEBUG_VS and DEBUG_PS are set):
DWORD dwShaderFlags = 0;
#ifdef DEBUG_VS
dwShaderFlags |= D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT;
#endif
#ifdef DEBUG_PS
dwShaderFlags |= D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT;
#endif
dwShaderFlags |= D3DXSHADER_DEBUG;
dwShaderFlags |= D3DXSHADER_SKIPOPTIMIZATION;
// If this fails, there should be debug output as to
// they the .fx file failed to compile
if(FAILED(D3DXCreateEffectFromFile(GFXDevice::Instance()->GetDevice(), "ShadowMap.fx", NULL, NULL, dwShaderFlags, NULL, &g_pEffect, NULL)))
return false;
The technique looks like this:
technique RenderScene
{
pass p0
{
VertexShader = compile vs_1_1 VertScene();
PixelShader = compile ps_2_0 PixScene();
}
}
I assume that the VS and PS versions are good enough, since the conditionals do work when I don't set breakpoints...
Quote:CalvinI am only polite because I don't know enough foul languageQuote:Original post by superpigI think the reason your rating has dropped so much, Mercenarey, is that you come across as an arrogant asshole.