I have this weird error. I'm trying to compile a HLSL file, but my debugging isn't working properly. Here's how I set up the error checking:
hresult = D3DCompileFromFile(vs_fn, 0, 0, "VShader", "vs_4_0", D3DCOMPILE_DEBUG, 0, &vertex_shader_blob, &error_message);
if (FAILED(hresult))
{
// If the shader failed to compile it should have writen something to the error message.
if (error_message)
{
auto error = (char*)error_message->GetBufferPointer();
return false;
}
}
However, my shader code does work. It displays how I want it too, but when I place a random character or change anything in the code to produce an error, nothing gets outputted to the error variable. It worked just the other day.
The check fails, it steps onto the if statement but never goes into it and just breaks to end of the entire code block. I'm confused.