示例#1
0
        private static string GetVectorType(VertexAttributeRenderInfo attributeInfo)
        {
            var attribute = attributeInfo.AttributeInfo;

            string typeName = GetVectorTypeName(attribute.Type, attribute is VertexIntAttribute);

            return($"{typeName}{(int)attributeInfo.AttributeInfo.ValueCount}");
        }
示例#2
0
 private static string GetAttributeFunction(VertexAttributeRenderInfo attribute)
 {
     if (attribute.Normalize)
     {
         return("normalize");
     }
     else
     {
         return("");
     }
 }
示例#3
0
 private static string GetTypeDeclaration(VertexAttributeRenderInfo attribute)
 {
     if (attribute.AttributeInfo.ValueCount == ValueCount.One)
     {
         return(GetScalarType(attribute));
     }
     else
     {
         return(GetVectorType(attribute));
     }
 }
示例#4
0
 private static string GetAttributeRemapOperation(VertexAttributeRenderInfo attribute)
 {
     if (attribute.RemapToVisibleRange)
     {
         return("* 0.5 + 0.5;");
     }
     else
     {
         return("");
     }
 }
示例#5
0
        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.");
            }
        }