Skip to main content
GameDev.net gamedev.net
🔒 Locked

Vertex Shader - Pixel Shader linkage error

Started by David Kosenina Jan 30, 2010 at 2:21 PM 1 replies 12.7k views
Original Post
David Kosenina
David Kosenina
Hi, I tried to draw simple 2D textured rectangle in DirectX 11 and i got this two errors on draw call: 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 ] D3D11: ERROR: ID3D11DeviceContext::Draw: Vertex Shader - Pixel Shader linkage error: Signatures between stages are incompatible. Semantic 'SV_POSITION' is defined for mismatched hardware registers between the output stage and input stage. [ EXECUTION ERROR #343: DEVICE_SHADER_LINKAGE_REGISTERINDEX ] Help Here is the shader code:

cbuffer cb2d : register( b0 )
{
	float4 gAdjust : packoffset( c0 );
	float4 gColor  : packoffset( c1 );
};

Texture2D 	 gTexture;
SamplerState LinearSampler
{
    Filter   = MIN_MAG_MIP_LINEAR;
    AddressU = Wrap;
    AddressV = Wrap;
};

void vsmain( in  float2 inPos  : POSITION,
	     #ifdef TEXTURE
	        in  float2 inUV   : TEXCOORD,
		out float2 outUV  : TEXCOORD0,
	     #endif
	     out float4 outPos : SV_POSITION
	   )
{
   outPos = float4( inPos.xy*gAdjust.xy + gAdjust.zw, 0.5f, 1.f );
   #ifdef TEXTURE
      outUV  = inUV;
   #endif
}

void psmain( float4 inPos    : SV_POSITION,
      	     #ifdef TEXTURE
	        float2   inUV   : TEXCOORD0,
	     #endif
	     out float4 outColor : SV_Target
	   )
{
   #ifdef TEXTURE
      outColor = gTexture.Sample( LinearSampler, inUV );
   #else
      outColor = gColor;
   #endif
}

ET3D
ET3D
In the vertex shader you're outputting the texture coord, then the position. In the pixel shader their order is reversed. I think that's the reason for the error.
David Kosenina
David Kosenina
Hi,

Yes, that was the problem.

Thank you for helping.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.