コード例 #1
0
 public static int ToSerializedVersion(Version version)
 {
     // VertexFormat enum has been changed
     if (VertexFormatExtensions.VertexFormat2019Relevant(version))
     {
         return(3);
     }
     // ShaderChannel enum has been changed
     if (ShaderChannelExtensions.ShaderChannel2018Relevant(version))
     {
         return(2);
     }
     return(1);
 }
コード例 #2
0
        public static int GetSize(this VertexFormat _this, Version version)
        {
            switch (_this)
            {
            case VertexFormat.Float:
                return(4);

            case VertexFormat.Float16:
                return(2);

            case VertexFormat.Color:
                return(ShaderChannelExtensions.ShaderChannel5Relevant(version) ? 1 : 4);

            case VertexFormat.Byte:
                return(1);

            case VertexFormat.Int:
                return(4);

            default:
                throw new Exception(_this.ToString());
            }
        }