I'm trying to load a shader file using the D3DX11CompileFromFile() function when I get the HRESULT error "An undetermined error occurred"( I'm using DXGetErrorDescription() to debug). The weird thing is that I can't find the error even listed in the MSDN documentation of HRESULT. I'm abit unsure what the problem could be, because lately my visual studio 2010 c++ express have been acting up giving me loads of code unrelated errors. Have anyone else encountered this error, and if so what was the problem ?
I have only made a few small changes to the program since it last worked perfectly. I'm following a tutorial to so one would expect the code to be correct, but seeing how i am a newbie i will list the changed areas since it last worked just in case there is some silly error.
.fx -file:
VS_OUTPUT VS(float4 inPos : POSITION, float4 inColor : COLOR)
{
VS_OUTPUT output;
output.Pos = inPos;
output.Color = inColor;
return output;
}
float4 PS(VS_OUTPUT input) : SV_TARGET
{
return input.Color;
}
The other code that have been changed:
struct Vertex //Overloaded Vertex Structure
{
Vertex(){}
Vertex(float x, float y, float z, float cr, float cg, float cb, float ca)
: pos(x,y,z), color(cr,cg,cb,ca){}
XMFLOAT3 pos;
XMFLOAT4 color;
};
//the layout, one element for each variable in the vertex struct
D3D11_INPUT_ELEMENT_DESC layout[] =
{
{"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{"COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
UINT numElements = ARRAYSIZE(layout); //the number of elements
I also added the the new parameters to the vertex strucs on the place i use them.