diff --git a/src/ComputeSharp.Shaders/Translation/Models/ReadableMember.cs b/src/ComputeSharp.Shaders/Translation/Models/ReadableMember.cs index 46468367..4210d242 100644 --- a/src/ComputeSharp.Shaders/Translation/Models/ReadableMember.cs +++ b/src/ComputeSharp.Shaders/Translation/Models/ReadableMember.cs @@ -30,6 +30,25 @@ namespace ComputeSharp.Shaders.Translation.Models Property = property; } + /// + /// Gets the of the wrapped member for the current instance + /// + public Type MemberType + { + get + { + if (Field != null) return Field.FieldType; + if (Property != null) return Property.PropertyType; + + throw new InvalidOperationException("Field and property can't both be null at the same time"); + } + } + + /// + /// Gets the name of the wrapped member for the current instance + /// + public string Name => (Field?.Name ?? Property?.Name) ?? throw new InvalidOperationException("Field and property can't both be null at the same time"); + /// /// Returns the value of the wrapped member for the current instance ///