4 using System.Collections;
5 using System.Collections.Generic;
6 using System.Text.RegularExpressions;
8 namespace SiliconStudio.Shaders.Ast.Hlsl
15 #region Constructors and Destructors
36 identifier.Identifiers.Add(
new Identifier(value));
43 #region Public Properties
55 #region Public Methods
58 private static readonly Regex matchComponent =
new Regex(
@"^c(\d+)(\.[xyzw])?$");
66 var match = matchComponent.Match(Value.ToString());
69 var index = int.Parse(match.Groups[1].Value) * 16;
70 if (match.Groups[2].Success)
72 var subComponentChar = match.Groups[2].Value[1];
73 index +=
"xyzw".IndexOf(subComponentChar)* 4;
89 if (ReferenceEquals(null, other))
94 if (ReferenceEquals(
this, other))
99 return base.Equals(other) && Equals(other.
Value, Value);
105 if (ReferenceEquals(null, obj))
110 if (ReferenceEquals(
this, obj))
121 ChildrenList.Clear();
122 ChildrenList.Add(Value);
131 return (base.GetHashCode() * 397) ^ (Value != null ? Value.GetHashCode() : 0);
136 public override string DisplayName
140 return string.Format(
": packoffset({0})", Value);
158 return Equals(left, right);
171 return !Equals(left, right);
override bool Equals(object obj)
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes
PackOffset()
Initializes a new instance of the PackOffset class.
Describes a packoffset(value).
bool Equals(PackOffset other)
Determines whether the specified PackOffset is equal to this instance.
int ToFloat4SlotIndex()
Converts this packoffset to a register index based on float size.
override int GetHashCode()
Identifier Value
Gets or sets the value.
PackOffset(string value)
Initializes a new instance of the PackOffset class.