An amazing error,
D3D11: ERROR: ID3D11DeviceContext::Draw: Vertex Shader – Pixel Shader linkage error: Signatures between stages are incompatible. Semantic ‘TEXCOORD’ is defined for mismatched hardware registers between the output stage and input stage. [ EXECUTION ERROR #343: DEVICE_SHADER_LINKAGE_REGISTERINDEX ]
What this error means is you didn’t match up EXACTLY the ORDER of the OUTPUTS you your vertex shader with the INPUTS of your pixel shader.
For example, the following CG shader triggers the error:
Pixel shader
void vertexMain(
in float4 ip : POSITION,
in float3 N : NORMAL,
in float4 ic : COLOR,
// 4 outputs, in this order
out float4 op : POSITION,
out float4 oc : COLOR,
out float4 posToPxShader : TEXCOORD0, // original space pos
out float3 normToPxShader : TEXCOORD1,// original space normal
// the concatenated modelview-projection matrix
uniform float4x4 modelViewProj
{
// vx shader code..
}
void pixelMain(
//THIS PIXEL SHADER MUST RECEIVE
// ALL 4 OUTPUTS OF THE VERTEX SHADER,
// IN THE EXACT ORDER THAT THE VERTEX SHADER
// OUTPUT THEM, OR YOU WILL GET AN ERROR
// COMMENTING OUT THE LINE BELOW TRIGGERS THE ERROR
//in float4 tp : POSITION, // transformed space position // must rx b/c is output of vshader stage
in float4 ic : COLOR,
in float4 ip : TEXCOORD0,
in float3 N : TEXCOORD1
{
// pixel shader code..
}