public void AddAttribute <T>(uint count, uint type, ShaderAttributeFlags flags = ShaderAttributeFlags.None, uint padding = 0) { attributes.Add(new ShaderAttribute(count, type, Stride, flags)); // Padding is given in bytes directly (so that the padding can encompass data of multiple types). Stride += (uint)Marshal.SizeOf <T>() * count + padding; }
public ShaderAttribute(uint count, uint type, uint offset, ShaderAttributeFlags flags) { Count = count; Type = type; Offset = offset; IsInteger = (flags & ShaderAttributeFlags.IsInteger) > 0; IsNormalized = (flags & ShaderAttributeFlags.IsNormalized) > 0; }