I keep getting the same error every time, I really have tried everything to fix the problem but it's still not working. Basically I'd like to draw a simple cube.
The error(s):
D3D11 ERROR: ID3D11DeviceContext::Draw: Input Assembler - Vertex Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (COLOR,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]
D3D11 ERROR: ID3D11DeviceContext::Draw: Input Assembler - Vertex Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (TEXCOORD,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]
D3D11 ERROR: ID3D11DeviceContext::Draw: Input Assembler - Vertex Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (SV_Position,0) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND]
The vertex shader, pos.hlsl:
float4 main(float3 pos : POSITION) : SV_POSITION
{
float4 finalPos = { pos.x, pos.y, pos.z, 1.0f };
return finalPos;
}
The vertex layout:
const D3D11_INPUT_ELEMENT_DESC d[] =
{
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }
};
struct Vertex
{
XMFLOAT3 poz;
};
The actual code:
Vertex vertex_list[] =
{
{ XMFLOAT3{-1.0f, -1.0f, -1.0f} },
{ XMFLOAT3{-1.0f, +1.0f, -1.0f} },
{ XMFLOAT3{+1.0f, +1.0f, -1.0f} },
{ XMFLOAT3{+1.0f, -1.0f, -1.0f} },
{ XMFLOAT3{-1.0f, -1.0f, +1.0f} },
{ XMFLOAT3{-1.0f, +1.0f, +1.0f} },
{ XMFLOAT3{+1.0f, +1.0f, +1.0f} },
{ XMFLOAT3{+1.0f, -1.0f, +1.0f} }
};
/* First, setup the vertex buffer */
D3D11_BUFFER_DESC o;
o.ByteWidth = sizeof(Vertex) * ARRAYSIZE(vertex_list);
o.Usage = D3D11_USAGE_IMMUTABLE;
o.BindFlags = D3D11_BIND_VERTEX_BUFFER;
o.CPUAccessFlags = 0;
o.MiscFlags = NULL;
o.StructureByteStride = 0;
D3D11_SUBRESOURCE_DATA d;
d.pSysMem = vertex_list;
if FAILED(pRenderer->GetDevice()->CreateBuffer(
&o,
&d,
&m_pBuffer
))
return R_BUFFER_ERROR;
/* Now, setup the vertex layout */
long size = pFileManager->ReadShaderFile("pos.cso", m_bytes);
if FAILED(m_pD3DDevice->CreateInputLayout(
d,
ARRAYSIZE(d),
m_bytes,
size,
&m_pInputLayout
))
return R_SETUP_VERTEX_LAYOUT;
m_pD3DKontekst->IASetInputLayout(m_pInputLayout);
Then I'm using m_pD3DContext->Draw() to draw the scene. Nothing shows up, just the usual gray background color using ClearRenderTargetView()
Thanks a lot for any help.