98 {
101 return MTLVertexFormatFloat;
103 return MTLVertexFormatFloat2;
105 return MTLVertexFormatFloat3;
107 return MTLVertexFormatFloat4;
109 if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
110 return MTLVertexFormatHalf;
111 } else {
112 return MTLVertexFormatInvalid;
113 }
115 return MTLVertexFormatHalf2;
117 return MTLVertexFormatHalf4;
119 return MTLVertexFormatInt2;
121 return MTLVertexFormatInt3;
123 return MTLVertexFormatInt4;
125 if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
126 return MTLVertexFormatChar;
127 } else {
128 return MTLVertexFormatInvalid;
129 }
131 return MTLVertexFormatChar2;
133 return MTLVertexFormatChar4;
135 if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
136 return MTLVertexFormatUChar;
137 } else {
138 return MTLVertexFormatInvalid;
139 }
141 return MTLVertexFormatUChar2;
143 return MTLVertexFormatUChar4;
145 if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
146 return MTLVertexFormatUCharNormalized;
147 } else {
148 return MTLVertexFormatInvalid;
149 }
151 return MTLVertexFormatUChar4Normalized;
153 return MTLVertexFormatShort2;
155 return MTLVertexFormatShort4;
157 return MTLVertexFormatUShort2;
159 return MTLVertexFormatUShort2Normalized;
161 return MTLVertexFormatInt;
163 return MTLVertexFormatUInt;
165 if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
166 return MTLVertexFormatUShortNormalized;
167 } else {
168 return MTLVertexFormatInvalid;
169 }
171 return MTLVertexFormatUShort4Normalized;
172 }
173 SK_ABORT(
"Unknown vertex attribute type");
174}
@ kUShort_norm_GrVertexAttribType
@ kFloat2_GrVertexAttribType
@ kUShort2_GrVertexAttribType
@ kUInt_GrVertexAttribType
@ kUByte4_norm_GrVertexAttribType
@ kUByte_GrVertexAttribType
@ kShort2_GrVertexAttribType
@ kUShort4_norm_GrVertexAttribType
@ kInt_GrVertexAttribType
@ kByte_GrVertexAttribType
@ kByte4_GrVertexAttribType
@ kFloat3_GrVertexAttribType
@ kFloat_GrVertexAttribType
@ kByte2_GrVertexAttribType
@ kFloat4_GrVertexAttribType
@ kShort4_GrVertexAttribType
@ kUShort2_norm_GrVertexAttribType
@ kInt3_GrVertexAttribType
@ kHalf2_GrVertexAttribType
@ kHalf4_GrVertexAttribType
@ kUByte4_GrVertexAttribType
@ kUByte2_GrVertexAttribType
@ kInt4_GrVertexAttribType
@ kUByte_norm_GrVertexAttribType
@ kInt2_GrVertexAttribType
@ kHalf_GrVertexAttribType
#define SK_ABORT(message,...)