170 {
172 static const char kTegraStr[] = "NVIDIA Tegra";
173 if (0 == strncmp(rendererString, kTegraStr,
std::size(kTegraStr) - 1)) {
174
175
178 }
179 int lastDigit;
180 int n = sscanf(rendererString, "PowerVR SGX 54%d", &lastDigit);
181 if (1 == n && lastDigit >= 0 && lastDigit <= 9) {
183 }
184 if (strstr(rendererString, "PowerVR B-Series")) {
186 }
187
188 static const char kAppleA4Str[] = "Apple A4";
189 static const char kAppleA5Str[] = "Apple A5";
190 static const char kAppleA6Str[] = "Apple A6";
191 if (0 == strncmp(rendererString, kAppleA4Str,
std::size(kAppleA4Str) - 1) ||
192 0 == strncmp(rendererString, kAppleA5Str,
std::size(kAppleA5Str) - 1) ||
193 0 == strncmp(rendererString, kAppleA6Str,
std::size(kAppleA6Str) - 1)) {
195 }
196 static const char kPowerVRRogueStr[] = "PowerVR Rogue";
197 static const char kAppleA7Str[] = "Apple A7";
198 static const char kAppleA8Str[] = "Apple A8";
199 if (0 == strncmp(rendererString, kPowerVRRogueStr,
std::size(kPowerVRRogueStr) - 1) ||
200 0 == strncmp(rendererString, kAppleA7Str,
std::size(kAppleA7Str) - 1) ||
201 0 == strncmp(rendererString, kAppleA8Str,
std::size(kAppleA8Str) - 1)) {
203 }
204 int adrenoNumber;
205 n = sscanf(rendererString, "Adreno (TM) %d", &adrenoNumber);
206 if (n < 1) {
207
208 n = sscanf(rendererString, "FD%d", &adrenoNumber);
209 }
210 if (1 == n) {
211 if (adrenoNumber >= 300) {
212 if (adrenoNumber < 400) {
214 }
215 if (adrenoNumber < 500) {
218 }
219 if (adrenoNumber < 600) {
222 }
223 if (adrenoNumber < 700) {
224 if (adrenoNumber == 615) {
226 }
227 if (adrenoNumber == 620) {
229 }
230 if (adrenoNumber == 630) {
232 }
233 if (adrenoNumber == 640) {
235 }
237 }
238 }
239 }
240
241 if (const char* intelString = strstr(rendererString, "Intel")) {
242
243 if (0 == strcmp("Intel Iris OpenGL Engine", intelString) ||
244 0 == strcmp("Intel Iris Pro OpenGL Engine", intelString)) {
246 }
247 if (strstr(intelString, "Sandybridge")) {
249 }
250 if (strstr(intelString, "Bay Trail")) {
252 }
253
254
255
256 if (strstr(intelString, "RKL")) {
258 }
259 if (strstr(intelString, "TGL")) {
261 }
262
263 if (strstr(intelString, "ADL") || strstr(intelString, "AlderLake")) {
265 }
266
267
268
269 if (strstr(intelString, "Xe")) {
271 }
272
273
274
275
276
277
278
279
280 if (const char* intelGfxString = strstr(intelString, "Graphics")) {
281 int intelNumber;
282 if (sscanf(intelGfxString, "Graphics %d", &intelNumber) ||
283 sscanf(intelGfxString, "Graphics P%d", &intelNumber)) {
284 if (intelNumber == 2000 || intelNumber == 3000) {
286 }
287 if (intelNumber == 2500 || intelNumber == 4000) {
289 }
290 if (intelNumber >= 4200 && intelNumber <= 5200) {
292 }
293 if (intelNumber >= 400 && intelNumber <= 405) {
295 }
296 if (intelNumber >= 5300 && intelNumber <= 6300) {
298 }
299 if (intelNumber >= 500 && intelNumber <= 505) {
301 }
302 if (intelNumber >= 510 && intelNumber <= 580) {
304 }
305 if (intelNumber >= 600 && intelNumber <= 605) {
307 }
308
309
310 if (intelNumber == 610 || intelNumber == 630) {
313 }
314 if (intelNumber >= 610 && intelNumber <= 650) {
316 }
317 if (intelNumber == 655) {
319 }
320
321
322 if (intelNumber >= 710 && intelNumber <= 770) {
324 }
325 if (intelNumber >= 910 && intelNumber <= 950) {
327 }
328 }
329 }
330 }
331
332
333 static constexpr char kRadeonStr[] = "Radeon ";
334 if (const char* amdString = strstr(rendererString, kRadeonStr)) {
335 amdString += strlen(kRadeonStr);
336
337 static constexpr char kTMStr[] = "(TM) ";
338 if (!strncmp(amdString, kTMStr, strlen(kTMStr))) {
339 amdString += strlen(kTMStr);
340 }
341
342 char amd0, amd1, amd2;
343 int amdModel;
344 n = sscanf(amdString, "R9 M3%c%c", &amd0, &amd1);
345 if (2 == n && isdigit(amd0) && isdigit(amd1)) {
347 }
348
349 n = sscanf(amdString, "R9 M4%c%c", &amd0, &amd1);
350 if (2 == n && isdigit(amd0) && isdigit(amd1)) {
352 }
353
354 n = sscanf(amdString, "HD 7%c%c%c Series", &amd0, &amd1, &amd2);
355 if (3 == n && isdigit(amd0) && isdigit(amd1) && isdigit(amd2)) {
357 }
358
359 n = sscanf(amdString, "Pro 5%c%c%c", &amd0, &amd1, &amd2);
360 if (3 == n && isdigit(amd0) && isdigit(amd1) && isdigit(amd2)) {
362 }
363
364 n = sscanf(amdString, "Pro Vega %i", &amdModel);
365 if (1 == n) {
367 }
368 }
369
370 if (strstr(rendererString, "llvmpipe")) {
372 }
373 static const char kMaliGStr[] = "Mali-G";
374 if (0 == strncmp(rendererString, kMaliGStr,
std::size(kMaliGStr) - 1)) {
376 }
377 static const char kMaliTStr[] = "Mali-T";
378 if (0 == strncmp(rendererString, kMaliTStr,
std::size(kMaliTStr) - 1)) {
380 }
381 int mali400Num;
382 if (1 == sscanf(rendererString, "Mali-%d", &mali400Num) && mali400Num >= 400 &&
383 mali400Num < 500) {
385 }
386
387 static const char kAppleStr[] = "Apple";
388 if (0 == strncmp(rendererString, kAppleStr,
std::size(kAppleStr) - 1)) {
390 }
391
392 if (strstr(rendererString, "WebGL")) {
394 }
395
397}