Skip to main content
1 of 2
user1423893
  • 674
  • 3
  • 13
  • 32

Adding VFACE semantic causes overlapping output semantics error

My pixel shader input is a follows

struct VertexShaderOut
{
    float4 Position                 : POSITION0;    
    float2 TextureCoordinates       : TEXCOORD0;
    float4 PositionClone            : TEXCOORD1;        // Final position values must be cloned to be used in PS calculations
    float3 Normal                   : TEXCOORD2;
    //float3x3 TBN                  : TEXCOORD3;
    float CullFace                  : VFACE;            // A negative value faces backwards (-1), while a positive value (+1) faces the camera (requires ps_3_0)
};

I'm using ps_3_0 and I wish to utilise the VFACE semantic for correct lighting of normals depending on the cull mode.

If I add the VFACE semantic then I get the following errors:

error X5639: dcl usage+index: position,0 has already been specified for an output register error X4504: overlapping output semantics

Why would this occur? I can't see why there would be too much data.

user1423893
  • 674
  • 3
  • 13
  • 32