Jump to content

  • Log In with Google      Sign In   
  • Create Account

[DX11] Instancing - Vertex Shader linkage error


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Martin Perry   Members   -  Reputation: 1343

Like
0Likes
Like

Posted 14 August 2012 - 09:04 AM

Hi,
I have problem with my instancing code. I have found similar topic on this forum, but that solution didn´t work.

I am getting these errors:
D3D11: ERROR: ID3D11DeviceContext::DrawIndexedInstanced: Input Assembler - Vertex 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 ]
D3D11: ERROR: ID3D11DeviceContext::DrawIndexedInstanced: Input Assembler - Vertex Shader linkage error: Signatures between stages are incompatible. The input stage requires Semantic/Index (TEXCOORD,1) as input, but it is not provided by the output stage. [ EXECUTION ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND ]


My shader code is:
struct VS_INSTANCE_INPUT_PT2
{
float3 inPos : POSITION;
float2 inTexCoords : TEXCOORD0;
float2 tmp : TEXCOORD1;
};
/**********************************/
/*   VS_OUTPUT	 */
/**********************************/
struct PS_INPUT
{
float4 position : SV_POSITION; //position in projected coordinates
float4 viewPos : TEXCOORD0;  //position in world-view coordinates
float2 TexCoord : TEXCOORD1; //texture coordinates for texturing
 
  float3 normal   : TEXCOORD2;
   float3 posWorld : TEXCOORD3;
};

/*======================== SIGNATURE - PT2 =====================================*/
PS_INPUT BasicModelVS_PT2( VS_INSTANCE_INPUT_PT2 input)
{
PS_INPUT Output = (PS_INPUT)0;
Output.position = CalcPositionInWorld(float4(input.tmp, 1, 1));
Output.viewPos = mul(float4(input.tmp, 1, 1), mul(xWorld, xView));

Output.TexCoord = input.inTexCoords;
Output.TexCoord.y = 1 - Output.TexCoord.y;
float3 posWorld = mul((float4(input.tmp, 1, 1), xWorld);  
Output.posWorld = posWorld;
Output.normal = float3(0, 1, 0);

return Output;
}

And Semantics is
+  SemanticName: "POSITION"
  SemanticIndex 0
  Format DXGI_FORMAT_R32G32B32_FLOAT
  InputSlot 0
  AlignedByteOffset 0
  InputSlotClass D3D11_INPUT_PER_VERTEX_DATA
  InstanceDataStepRate 0

+  SemanticName "TEXCOORD"
  SemanticIndex 0
  Format DXGI_FORMAT_R32G32_FLOAT
  InputSlot 0
  AlignedByteOffset 12
  InputSlotClass D3D11_INPUT_PER_VERTEX_DATA
  InstanceDataStepRate 0

+  SemanticName "TEXCOORD"
  SemanticIndex 1
  Format DXGI_FORMAT_R32G32_FLOAT
  InputSlot 1
  AlignedByteOffset 0
  InputSlotClass D3D11_INPUT_PER_INSTANCE_DATA
  InstanceDataStepRate 1

Creating InputLayout is correct, HRESULT is S_OK, no other errors.. but when I call deviceContext->DrawIndexedInstanced, above errors occur.

Thanks

Sponsor:

#2 Ripiz   Members   -  Reputation: 529

Like
0Likes
Like

Posted 14 August 2012 - 09:31 AM

Firstly:
+  SemanticName "TEXCOORD"
  SemanticIndex 0
  Format DXGI_FORMAT_R32G32_FLOAT
but in shader you have
float4 viewPos : TEXCOORD0
I'm not sure whether it's alright to expect float4 in shader, when you send only float2.

Secondly:
+  SemanticName "TEXCOORD"
  SemanticIndex 1
  Format DXGI_FORMAT_R32G32_FLOAT
  InputSlot 1
  AlignedByteOffset 0
Are you sure byte offset is correct here?

#3 Martin Perry   Members   -  Reputation: 1343

Like
0Likes
Like

Posted 14 August 2012 - 09:34 AM

Firstly:

+  SemanticName "TEXCOORD"
  SemanticIndex 0
  Format DXGI_FORMAT_R32G32_FLOAT
but in shader you have
float4 viewPos : TEXCOORD0
I'm not sure whether it's alright to expect float4 in shader, when you send only float2.


Semantics goes to VS... viewPos is between VS and PS... that has nothing to do with semantics...

Secondly:

+  SemanticName "TEXCOORD"
  SemanticIndex 1
  Format DXGI_FORMAT_R32G32_FLOAT
  InputSlot 1
  AlignedByteOffset 0
Are you sure byte offset is correct here?


I think, that it is correct.. offset is within input slot.. Or not ?

Edited by Martin Perry, 14 August 2012 - 10:59 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS