string GetSVRegisterName()
        {
            switch (SemanticName.ToUpper())
            {
            case "SV_DEPTH":
                return("oDepth");

            case "SV_DEPTHGREATEREQUAL":
                return("oDepthGE");

            case "SV_DEPTHLESSEQUAL":
                return("oDepthLE");

            case "SV_COVERAGE":
                return("oMask");

            case "SV_STENCILREF":
                return("oStencilRef");
            }
            if (SystemValueType == Name.PrimitiveID)
            {
                return("primID");
            }
            else
            {
                return("special");
            }
        }
Beispiel #2
0
 public bool Equals(VertexElement other)
 {
     // First use hashCode to compute
     return(hashCode == other.hashCode &&
            SemanticName.Equals(other.SemanticName) &&
            SemanticIndex == other.SemanticIndex &&
            Format == other.Format &&
            AlignedByteOffset == other.AlignedByteOffset);
 }
Beispiel #3
0
 internal int ComputeHashCode()
 {
     unchecked
     {
         int localHashCode = SemanticName.GetHashCode();
         localHashCode = (localHashCode * 397) ^ SemanticIndex;
         localHashCode = (localHashCode * 397) ^ Format.GetHashCode();
         localHashCode = (localHashCode * 397) ^ AlignedByteOffset;
         return(localHashCode);
     }
 }
Beispiel #4
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = SemanticName.GetHashCode();
         result = (result * 397) ^ SemanticIndex.GetHashCode();
         result = (result * 397) ^ Format.GetHashCode();
         result = (result * 397) ^ Slot.GetHashCode();
         result = (result * 397) ^ AlignedByteOffset.GetHashCode();
         return(result);
     }
 }
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = SemanticName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ SemanticIndex.GetHashCode();
         hashCode = (hashCode * 397) ^ Format.GetHashCode();
         hashCode = (hashCode * 397) ^ Slot.GetHashCode();
         hashCode = (hashCode * 397) ^ AlignedByteOffset.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #6
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = SemanticName.GetHashCode();
         result = (result * 397) ^ SemanticIndex.GetHashCode();
         result = (result * 397) ^ Format.GetHashCode();
         result = (result * 397) ^ Slot.GetHashCode();
         result = (result * 397) ^ AlignedByteOffset.GetHashCode();
         result = (result * 397) ^ Classification.GetHashCode();
         result = (result * 397) ^ InstanceDataStepRate.GetHashCode();
         return(result);
     }
 }
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = SemanticName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ SemanticIndex.GetHashCode();
         hashCode = (hashCode * 397) ^ Format.GetHashCode();
         hashCode = (hashCode * 397) ^ Slot.GetHashCode();
         hashCode = (hashCode * 397) ^ AlignedByteOffset.GetHashCode();
         hashCode = (hashCode * 397) ^ Classification.GetHashCode();
         hashCode = (hashCode * 397) ^ InstanceDataStepRate.GetHashCode();
         return(hashCode);
     }
 }
        internal void UpdateVersion(ChunkType chunkType, ShaderVersion version)
        {
            ProgramType programType = version.ProgramType;

            if (chunkType == ChunkType.Pcsg && programType == ProgramType.HullShader)
            {
                ReadWriteMask = (ComponentMask)(ComponentMask.All - ReadWriteMask);
            }
            // Vertex and pixel shaders need special handling for SystemValueType in the output signature.
            if ((programType == ProgramType.PixelShader || programType == ProgramType.VertexShader) &&
                (chunkType == ChunkType.Osg5 || chunkType == ChunkType.Osgn || chunkType == ChunkType.Osg1))
            {
                if (Register == 0xffffffff)
                {
                    switch (SemanticName.ToUpper())
                    {
                    case "SV_DEPTH":
                        SystemValueType = Name.Depth;
                        break;

                    case "SV_COVERAGE":
                        SystemValueType = Name.Coverage;
                        break;

                    case "SV_DEPTHGREATEREQUAL":
                        SystemValueType = Name.DepthGreaterEqual;
                        break;

                    case "SV_DEPTHLESSEQUAL":
                        SystemValueType = Name.DepthLessEqual;
                        break;

                    case "SV_STENCILREF":
                        SystemValueType = Name.StencilRef;
                        break;
                    }
                }
                else if (programType == ProgramType.PixelShader)
                {
                    SystemValueType = Name.Target;
                }
            }
        }