241 {
242 enum TestTypeMatcher {
CPU, Ganesh, Graphite,
GPU };
243
244 struct TestDisable {
245 std::optional<std::regex> deviceName;
246 std::optional<std::string_view> backendAPI;
247 std::optional<TestTypeMatcher> testTypeMatcher;
248 std::optional<bool> platform;
249 };
250
252
253
255 #define ADRENO "Adreno \\(TM\\) "
256 #define NVIDIA "(Tegra|Quadro|RTX|GTX) "
257
258 TestDisableMap disables;
259 constexpr std::nullopt_t _ = std::nullopt;
261
262#if defined(SK_BUILD_FOR_UNIX)
263 constexpr bool kLinux = true;
264#else
265 constexpr bool kLinux = false;
266#endif
267#if defined(SK_BUILD_FOR_MAC)
268 constexpr bool kMac = true;
269#else
270 constexpr bool kMac = false;
271#endif
272#if defined(SK_BUILD_FOR_IOS)
273 constexpr bool kiOS = true;
274#else
275 constexpr bool kiOS = false;
276#endif
277#if defined(SK_BUILD_FOR_WIN)
278 constexpr bool kWindows = true;
279#else
280 constexpr bool kWindows = false;
281#endif
282#if defined(SK_BUILD_FOR_ANDROID)
283 constexpr bool kAndroid = true;
284#else
285 constexpr bool kAndroid = false;
286#endif
287
288
289
290 for (
const char*
test : {
"LogicalAndShortCircuit",
291 "LogicalOrShortCircuit"}) {
292 disables[
test].push_back({_,
"OpenGL",
GPU, kMac || kiOS});
293 }
294
295
296 for (
const char*
test : {
"MatrixScalarNoOpFolding",
297 "MatrixScalarMath",
298 "SwizzleIndexStore",
299 "OutParamsAreDistinctFromGlobal",
300 "IntrinsicMixFloatES3"}) {
301 disables[
test].push_back({_,
"ANGLE",
GPU, kMac});
302 }
303
304
305 for (
const char*
test : {
"SwitchWithFallthrough",
306 "SwitchWithFallthroughGroups"}) {
307 disables[
test].push_back({_,
"OpenGL",
GPU, kiOS});
308 }
309
310
311
312 for (
const char*
test : {
"Matrices",
313 "MatrixNoOpFolding",
314 "MatrixScalarMath",
315 "MatrixSwizzleStore",
316 "MatrixScalarNoOpFolding",
317 "UnaryPositiveNegative",
318 "Cross"}) {
319 disables[
test].push_back({
regex(
"Mali-400"), _,
GPU, _});
320 }
321
322
323
324 for (
const char*
test : {
"Switch",
325 "SwitchDefaultOnly",
326 "SwitchWithFallthrough",
327 "SwitchWithFallthroughAndVarDecls",
328 "SwitchWithFallthroughGroups",
329 "SwitchWithLoops",
330 "SwitchCaseFolding",
331 "LoopFloat",
332 "LoopInt",
333 "MatrixScalarNoOpFolding",
334 "MatrixScalarMath",
335 "MatrixFoldingES2",
336 "MatrixEquality",
337 "IntrinsicFract",
338 "ModifiedStructParametersCannotBeInlined"}) {
339 disables[
test].push_back({
regex(
"Tegra 3"), _,
GPU, _});
340 }
341
342
343
344 for (
const char*
test : {
"MatrixConstructorsES2",
345 "MatrixConstructorsES3",
346 "MatrixScalarNoOpFolding",
347 "PreserveSideEffects",
348 "StructFieldNoFolding"}) {
351 }
352
353 disables[
"IntrinsicMixFloatES3"].push_back({
regex(
"RTX "),
"Vulkan", _, kWindows});
354
355
356 for (
const char*
test : {
"PreserveSideEffects",
357 "CommaSideEffects"}) {
358 disables[
test].push_back({
regex(
"Quadro P400"), _, _, kLinux});
359 }
360
361
362 for (
const char*
test : {
"UniformArray",
363 "TemporaryIndexLookup",
364 "MatrixIndexLookup"}) {
365 disables[
test].push_back({
regex(
"Quadro P400"),
"Dawn Vulkan", Graphite, kWindows});
366 }
367
368
369 for (
const char*
test : {
"OutParamsAreDistinct",
370 "OutParamsAreDistinctFromGlobal"}) {
371 disables[
test].push_back({
regex(
"PowerVR Rogue GE8300"), _,
GPU, _});
372 }
373
374
375 for (
const char*
test : {
"DeadReturnES3",
376 "IntrinsicAll",
377 "MatrixConstructorsES3",
378 "MatrixScalarNoOpFolding",
379 "StructIndexStore",
380 "SwizzleIndexLookup",
381 "SwizzleIndexStore"}) {
382 disables[
test].push_back({
regex(
"Radeon.*(R9|HD)"),
"OpenGL",
GPU, _});
383 disables[
test].push_back({
regex(
"Radeon.*(R9|HD)"),
"ANGLE GL",
GPU, _});
384 }
385
386
387 for (
const char*
test : {
"IntrinsicDFdy",
388 "IntrinsicDFdx",
389 "IntrinsicFwidth"}) {
390 disables[
test].push_back({
regex(
"AMD RADV RENOIR"), _,
GPU, _});
391 }
392
393
394
395 for (
const char*
test : {
"ArrayCast",
396 "ArrayComparison",
397 "CommaSideEffects",
398 "IntrinsicMixFloatES2",
399 "IntrinsicClampFloat",
400 "SwitchWithFallthrough",
401 "SwitchWithFallthroughGroups",
402 "SwizzleIndexLookup",
403 "SwizzleIndexStore"}) {
405 }
406
407
408 for (
const char*
test : {
"VoidInSequenceExpressions",
409 "InoutParameters",
410 "OutParams",
411 "OutParamsDoubleSwizzle",
412 "OutParamsNoInline",
413 "OutParamsFunctionCallInArgument"}) {
414 disables[
test].push_back({
regex(
ADRENO "[56]"),
"Vulkan", _, kAndroid});
415 }
416
417 for (
const char*
test : {
"MatrixToVectorCast",
418 "StructsInFunctions"}) {
419 disables[
test].push_back({
regex(
ADRENO "[345]"),
"OpenGL", _, kAndroid});
420 }
421
422
423 for (
const char*
test : {
"Matrices",
424 "MatrixNoOpFolding"}) {
426 }
427
428
429 disables[
"IntrinsicIsInf"].push_back({
regex(
ADRENO "6"),
"OpenGL", _, kAndroid});
430
431
432 disables[
"EmptyBlocksES3"].push_back({
regex(
ADRENO "(540|630)"), _, _, kAndroid});
433
434
435 disables[
"OutParamsAreDistinctFromGlobal"].push_back({
regex(
ADRENO "[3456]"),
"OpenGL",
436 _, kAndroid});
437
438 disables[
"StructFieldFolding"].push_back({
regex(
ADRENO "[56]"),
"OpenGL",
439 _, kAndroid});
440
441
442 for (
const char*
test : {
"PrefixExpressionsES2",
443 "MatrixToVectorCast",
444 "MatrixConstructorsES2"}) {
445 disables[
test].push_back({
regex(
ADRENO "620"),
"Vulkan", Graphite, kAndroid});
446 }
447
448
449
450
451 disables[
"IntrinsicFloor"].push_back({
regex(
"Intel.*(Iris|HD)"),
"ANGLE D3D", _, _});
452
453
454 for (
const char*
test : {
"IntrinsicNot",
455 "IntrinsicMixFloatES3"}) {
456 disables[
test].push_back({
regex(
"Intel.*(Iris|6000)"),
"Metal", _, kMac});
457 }
458
459
460 disables[
"SwizzleIndexStore"].push_back({
regex(
"Intel"),
"OpenGL", _, kMac});
461 disables[
"SwizzleIndexStore"].push_back({
regex(
"Intel.*Iris"), _, _, kWindows});
462
463
464 for (
const char*
test : {
"VectorToMatrixCast",
465 "VectorScalarMath",
466 "TrivialArgumentsInlineDirectly"}) {
467 disables[
test].push_back({
regex(
"Intel"),
"ANGLE", _, kWindows});
468 }
469
470 for (
const char*
test : {
"MatrixFoldingES2",
471 "MatrixEquality",
472 "TemporaryIndexLookup",
473 "SwizzleIndexLookup"}) {
474 disables[
test].push_back({
regex(
"Intel.*(Iris|4400)"),
"OpenGL", _, kWindows});
475 disables[
test].push_back({
regex(
"Intel.*(Iris|4400)"),
"ANGLE", _, kWindows});
476 }
477
478 for (
const char*
test : {
"ReturnsValueOnEveryPathES3",
479 "OutParamsAreDistinctFromGlobal",
480 "StructFieldFolding"}) {
481 disables[
test].push_back({
regex(
"Intel"),
"OpenGL", _, kWindows});
482 disables[
test].push_back({
regex(
"Intel"),
"ANGLE GL", _, kWindows});
483 }
484
485 for (
const char*
test : {
"SwitchDefaultOnly",
486 "ReturnsValueOnEveryPathES3"}) {
487 disables[
test].push_back({
regex(
"Intel"),
"Vulkan", _, kLinux});
488 }
489
490 for (
const char*
test : {
"SwitchDefaultOnly"}) {
491 disables[
test].push_back({
regex(
"Intel"),
"ANGLE", _, kWindows});
492 }
493
494 for (
const char*
test : {
"SwizzleAsLValueES3"}) {
495 disables[
test].push_back({
regex(
"Intel"), _, _, kWindows});
496 disables[
test].push_back({_,
"ANGLE", _, kWindows});
497 }
498
499
500 for (
const char*
test : {
"IntrinsicDFdy",
501 "IntrinsicDFdx",
502 "IntrinsicFwidth"}) {
504 }
505
506 disables[
"LoopFloat"].push_back({
regex(
"Intel.*(Iris|6000)"), _, _, kMac});
507
508 #undef ADRENO
509 #undef NVIDIA
510
511 return disables;
512 }()};
513
514 if (
const std::vector<TestDisable>* testDisables = testDisableMap->find(
name)) {
515 for (
const TestDisable&
d : *testDisables) {
516 if (
d.platform.has_value() && !*
d.platform) {
517 continue;
518 }
520 continue;
521 }
522 if (
d.deviceName.has_value() &&
523 !std::regex_search(deviceName.begin(), deviceName.end(), *
d.deviceName)) {
524 continue;
525 }
527 continue;
528 }
530 continue;
531 }
533 continue;
534 }
536 continue;
537 }
538
539 return true;
540 }
541 }
542
543
544 return false;
545}
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
constexpr bool contains(std::string_view str, std::string_view needle)