title: Shader linkage error/mismatch
body: <p>I'm working on dynamic cubemap rendering. In particular, to render the cubemap I'm using a shader from the DirectX SDK sample "CubeMapGS". The shader seems correct, as you can see here:</p>
  
  <pre><code>SamplerState ss;
  Texture2D tex;
  
  cbuffer Constants
  {
      float4x4 worldMat;
      float4x4 viewMats[6];
      float4x4 projMat;
  };
  
  struct VS_CUBEMAP_IN
  {
      float4 Pos : POSITION;
      float3 Normal : NORMAL;
      float2 Tex : TEXCOORD0;
  };
  
  struct GS_CUBEMAP_IN
  {
      float4 Pos : SV_POSITION; // World position
      float2 Tex : TEXCOORD0; // Texture coord
  };
  
  
  struct PS_CUBEMAP_IN
  {
      float4 Pos : SV_POSITION; // Projection coord
      float2 Tex : TEXCOORD0; // Texture coord
      uint RTIndex : SV_RenderTargetArrayIndex;
  };
  
  
  GS_CUBEMAP_IN VShader(VS_CUBEMAP_IN input)
  {
      GS_CUBEMAP_IN output = (GS_CUBEMAP_IN) 0.0f;
  
      // Compute world position
      output.Pos = mul(input.Pos, worldMat);
  
      // Propagate tex coord
      output.Tex = input.Tex;
  
      return output;
  }
  
  [maxvertexcount(18)]
  void GShader(triangle GS_CUBEMAP_IN input[3], inout TriangleStream&lt;PS_CUBEMAP_IN&gt; CubeMapStream)
  {
      for (int f = 0; f &lt; 6; ++f)
      {
          // Compute screen coordinates
          PS_CUBEMAP_IN output;
          output.RTIndex = f;
          for (int v = 0; v &lt; 3; v++)
          {
              output.Pos = mul(input[v].Pos, viewMats[f]);
              output.Pos = mul(output.Pos, projMat);
              output.Tex = input[v].Tex;
              CubeMapStream.Append(output);
          }
          CubeMapStream.RestartStrip();
      }
  }
  
  
  float4 PShader(PS_CUBEMAP_IN input) : SV_Target {
      return tex.Sample(ss, input.Tex);
  }
  </code></pre>
  
  <p>However, it doesn't work. In fact, I receive the following DirectX error message:</p>
  
  <pre><code>D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Geometry 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]
  D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Vertex Shader - Geometry 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::DrawIndexed: Geometry 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::DrawIndexed: Geometry 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]
  </code></pre>
  
  <p>The error message seems to indicate some kind of mismatch between the input arguments and the output values of the different Shader functions, however I can't really recognize this mismatch. </p>
  
  <p>Any ideas or explanations in regards to this error?</p>