xref: /aosp_15_r20/external/skia/tools/flags/CommonFlagsGraphite.cpp (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1 /*
2  * Copyright 2024 Google LLC
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #include "tools/flags/CommonFlagsGraphite.h"
9 #include "tools/graphite/TestOptions.h"
10 
11 namespace CommonFlags {
12 
13 #if defined(SK_DAWN)
14 static DEFINE_bool(disable_tint_symbol_renaming, false, "Disable Tint WGSL symbol renaming when "
15                                                         "using Dawn");
16 static DEFINE_bool(neverYieldToWebGPU, false, "Run Graphite with never-yield context option.");
17 static DEFINE_bool(useTintIR, false, "Run Graphite with Dawn's use_tint_ir feature");
18 static DEFINE_bool(useWGPUTextureView, false, "Run Graphite w/ a wrapped WGPU texture view as "
19                                               "the destination");
20 #endif // SK_DAWN
21 
SetTestOptions(skiatest::graphite::TestOptions * testOptions)22 void SetTestOptions(skiatest::graphite::TestOptions* testOptions) {
23 #if defined(SK_DAWN)
24     testOptions->fDisableTintSymbolRenaming = FLAGS_disable_tint_symbol_renaming;
25     testOptions->fNeverYieldToWebGPU = FLAGS_neverYieldToWebGPU;
26     testOptions->fUseTintIR = FLAGS_useTintIR;
27     testOptions->fUseWGPUTextureView = FLAGS_useWGPUTextureView;
28 #endif // SK_DAWN
29 }
30 
31 }  // namespace CommonFlags
32