public RegisterDeclaration(RegisterKey registerKey)
        {
            RegisterType type = registerKey.Type;

            switch (type)
            {
            case RegisterType.ColorOut:
            case RegisterType.Const:
            case RegisterType.Const2:
            case RegisterType.Const3:
            case RegisterType.Const4:
            case RegisterType.ConstBool:
            case RegisterType.ConstInt:
            case RegisterType.Temp:
            case RegisterType.Loop:
                break;

            default:
                throw new ArgumentException($"Register type {type} requires declaration instruction,", nameof(registerKey));
            }

            RegisterKey = registerKey;
            switch (registerKey.Number)
            {
            case 0:
                Semantic = "COLOR";
                break;

            default:
                Semantic = "COLOR" + registerKey.Number;
                break;
            }
            _maskedLength = 4;
        }
        public override int GetHashCode()
        {
            int hashCode =
                RegisterKey.GetHashCode() ^
                ComponentIndex.GetHashCode();

            return(hashCode);
        }
 public RegisterComponentKey(RegisterType registerType, int registerNumber, int componentIndex)
 {
     RegisterKey    = new RegisterKey(registerType, registerNumber);
     ComponentIndex = componentIndex;
 }
 public RegisterComponentKey(RegisterKey registerKey, int componentIndex)
 {
     RegisterKey    = registerKey ?? throw new ArgumentNullException(nameof(registerKey));
     ComponentIndex = componentIndex;
 }
 public override string ToString()
 {
     return(RegisterKey.ToString() + " " + Name);
 }