private static string GetVectorType(VertexAttributeRenderInfo attributeInfo) { var attribute = attributeInfo.AttributeInfo; string typeName = GetVectorTypeName(attribute.Type, attribute is VertexIntAttribute); return($"{typeName}{(int)attributeInfo.AttributeInfo.ValueCount}"); }
private static string GetAttributeFunction(VertexAttributeRenderInfo attribute) { if (attribute.Normalize) { return("normalize"); } else { return(""); } }
private static string GetTypeDeclaration(VertexAttributeRenderInfo attribute) { if (attribute.AttributeInfo.ValueCount == ValueCount.One) { return(GetScalarType(attribute)); } else { return(GetVectorType(attribute)); } }
private static string GetAttributeRemapOperation(VertexAttributeRenderInfo attribute) { if (attribute.RemapToVisibleRange) { return("* 0.5 + 0.5;"); } else { return(""); } }
private static string GetScalarType(VertexAttributeRenderInfo attribute) { switch (attribute.AttributeInfo.Type) { case VertexAttribPointerType.Int: return("int"); case VertexAttribPointerType.UnsignedInt: return("uint"); case VertexAttribPointerType.Float: return("float"); default: throw new NotImplementedException($"Type {attribute.AttributeInfo.Type} is not supported."); } }