skia2/tools
Kevin Lubick 14abec45f0 [bazel] Add support for Dawn (via Vulkan)
sk_app has existing support for Dawn on top of Vulkan, and
this adds support to build //example:hello_world_dawn and
get this to run on Linux.

Dawn depends on Tint and abseil-cpp. Tint further depends on
spirv_tools and spirv_headers (for writing to the SPIR-V format).
Dawn and Tint only have GN and CMake support, so we need to make
our Bazel rules for them (see //third_party/BUILD.bazel).

abseil-cpp and the SPIR-V libraries have Bazel support, so we
can just include them (see //WORKSPACE.bazel). It is important
that @spirv_headers be called that exactly because @spirv_tools
depends on it by that name.

The hand-crafted cc_library rules for Dawn and Tint were produced
by reading the appropriate GN files and using the parts necessary
for a supporting Vulkan+Linux. If we use Dawn for other backends
(e.g. WebGPU), we will need to expand the Bazel rules. One day,
we might contribute the Bazel rules to Dawn and Tint so they
can support them and avoid breaking us if new files are added.

Suggested Review Order
 - bazel/common_config_settings/BUILD.bazel to see introduction
   of new select-able option "has_gpu_backend" which cleans up
   some of our code that is enabled for any GPU backend.
 - src/*/BUILD.bazel to see has_gpu_backend rolled out.
 - WORKSPACE.bazel to see DEPS declared there (using the files
   in third_party/externals, which are brought in via
   tools/git-sync-deps).
 - third_party/BUILD.bazel which adds Dawn and Tint rules.
   It may be helpful to look in third_party/externals for
   the Dawn [1] and Tint [2] GN files. Especially interesting
   are the Python scripts [3] Dawn uses to generate some
   header and source files.
 - All other files.

[1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183
[2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174
[3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774
Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-22 13:05:52 +00:00
..
android Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
calmbench Update references to master branch 2021-05-21 15:18:16 +00:00
copyright Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
debugger Dump path in json representaion of DrawPath command 2022-03-02 16:34:46 +00:00
doxygen Fix doxygen README.md to use python3. 2022-03-04 14:21:35 +00:00
fiddle Prepare to reenable unreachable-code warnings. 2022-02-04 21:45:39 +00:00
flags test slugs by converting blobs to slugs in drawTextBlob 2022-03-21 17:17:04 +00:00
fm [bazel] Use toolchain features to opt files into being IWYU compliant. 2022-03-16 13:09:46 +00:00
fonts [bazel] Update to use emsdk 3.1.4 2022-02-15 17:47:03 +00:00
gdb Update gdb bitmap viewer. 2018-06-20 21:24:27 +00:00
gpu [bazel] Add support for Dawn (via Vulkan) 2022-03-22 13:05:52 +00:00
graphite [graphite] Make Context no longer ref counted. 2022-02-03 17:18:40 +00:00
infra [infra] Use "mod download" and "install", not "get" in chrome_release_branch 2019-12-06 11:16:41 +00:00
lottie-web-perf HTML typo egde => edge 2020-06-19 15:12:06 +00:00
lottiecap HTML typo egde => edge 2020-06-19 15:12:06 +00:00
malisc Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
mdbviz [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
perf-canvaskit-puppeteer [canvaskit] Remove deprecated MakeTypefaceFromData and RefDefault 2021-10-21 16:45:42 +00:00
rebaseline Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
run-wasm-gm-tests [infra] Fix timeouts on WebGL GMs+Unit Tests 2022-03-22 12:42:33 +00:00
sk_app [bazel] Add support for Dawn (via Vulkan) 2022-03-22 13:05:52 +00:00
skdiff Remove static from template functions in headers. 2022-02-08 20:17:04 +00:00
skiaserve [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
skottie_ios_app Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h" 2022-03-10 04:47:51 +00:00
skottie-wasm-perf Reland "[canvaskit] Change SkRects to be arrays, not objects." 2020-09-03 14:31:38 +00:00
skp Add skia_motionmarksuites_desktop.py 2021-07-29 19:16:05 +00:00
skpbench Add SK_PRINTF_LIKE to existing variadic print functions. 2022-02-07 14:55:39 +00:00
skqp [bazel] Fix/update rules 2022-03-21 17:19:54 +00:00
skui [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
svg Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
timer [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
trace [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
viewer [bazel] Use toolchain features to opt files into being IWYU compliant. 2022-03-16 13:09:46 +00:00
__init__.py
abandon_gerrit_cls.py Add wrapper script to call tool to bulk abandon Gerrit CLs 2020-03-11 18:50:57 +00:00
add_codereview_message.py Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
AndroidSkDebugToStdOut.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
AutoreleasePool.h Reland "Added AutoreleasePool for managing pool memory in testing apps." 2019-05-31 15:40:01 +00:00
AutoreleasePool.mm Reland "Added AutoreleasePool for managing pool memory in testing apps." 2019-05-31 15:40:01 +00:00
bloaty_treemap.py bloaty_treemap.py: Fix path/symbol name collisions; make symbols unique with _1, _2, ... instead of _x, _x_x, ... 2021-12-01 21:38:55 +00:00
blob_cache_sim.cpp move SkRemoteGlyphCache.h to private 2021-12-10 20:20:56 +00:00
build_command_buffer.py Update build_command_buffer to copy ANGLE libs 2022-03-08 17:29:47 +00:00
BUILD_simulator.py Fix Google3 fonts. Use fontconfig rather than custom_directory_factory. Add Google3 font caching. 2015-12-01 11:12:05 -08:00
build_workaround_header.py Correct a typo in build_workaround_header.py 2021-07-29 13:06:01 +00:00
BUILD.bazel [bazel] Use toolchain features to opt files into being IWYU compliant. 2022-03-16 13:09:46 +00:00
check-headers-self-sufficient rm SkPreConfig.h and SkPostConfig.h 2020-02-06 19:16:43 +00:00
chrome_fuzz.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
clang-tidy.sh don't run clang-tidy on third_party 2020-03-30 15:26:32 +00:00
compare_codereview.py Further tweak compare_codereview.py. 2014-03-25 18:02:17 +00:00
convert-to-nia.cpp Fix convert-to-NIA stillImage check 2021-11-24 16:45:43 +00:00
cpu_modules.cpp Particle cleanup: split SkParticleBinding out of SkParticleEffect 2019-08-30 15:32:38 +00:00
CrashHandler.cpp Reland "Add format-specifier warnings to SkDebugf." 2021-06-25 17:57:43 +00:00
CrashHandler.h rewrite ambiguous comment 2015-02-10 07:47:31 -08:00
DDLPromiseImageHelper.cpp Reland "Remove GrBackendFormat's textureType use from isFormatTexturable call." 2021-08-13 22:37:13 +00:00
DDLPromiseImageHelper.h Only include SkJSONWriter when SK_ENABLE_DUMP_GPU defined 2021-11-02 16:17:17 +00:00
DDLTileHelper.cpp Reland "Remove GrBackendFormat's textureType use from isFormatTexturable call." 2021-08-13 22:37:13 +00:00
DDLTileHelper.h Move SkSpan to include/, for use in public API 2021-05-12 13:19:32 +00:00
doxygen_footer.txt
dump_record.cpp Fix cases of variable shadowing in /tools/. 2021-08-11 16:05:52 +00:00
embed_resources.py Tweak scripts to fix CK builds with python 3 2020-06-29 12:59:05 +00:00
find_run_binary.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
fix_pythonpath.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
force_older_glibc_math.h roll cast toolchain 2019-08-15 20:02:18 +00:00
gcov_shim
get_current_monitor_profile.cpp Convert 0 and NULL to nullptr. 2022-02-09 14:20:57 +00:00
get_images_from_skps.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
git-sync-deps Remove obsolete python2 references. 2022-03-16 19:56:37 +00:00
HashAndEncode.cpp Reland "Add kR8_unorm_SkColorType" 2022-02-10 18:00:19 +00:00
HashAndEncode.h [canvaskit] POC bindings for testing gms 2020-10-08 16:03:08 +00:00
image_diff_metric.cpp pdf-comparison and image_diff_metric tools 2019-09-19 21:18:28 +00:00
imgcvt.cpp Move skcms.h to include/third_party/skcms 2019-04-29 15:02:45 +00:00
install_dependencies.sh Add optional --yes argument to tools/install_dependencies.sh. 2021-01-05 16:30:22 +00:00
ios_utils.h Fix bugs with fence sync API on iOS devices 2017-10-10 19:05:13 +00:00
ios_utils.m rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
jsondiff.py Fix pylint check in presubmit 2018-06-22 14:38:28 +00:00
list_gms.cpp gm: GMFactory returns a unique_ptr<> 2019-08-12 19:02:40 +00:00
list_gpu_unit_tests.cpp Add CurrestTestHarness helper method. 2022-03-10 18:05:28 +00:00
LsanSuppressions.cpp stifle leaks in terminator_CreateDevice() 2020-04-08 15:28:48 +00:00
merge_static_libs.py Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
milestone.py Update references to master branch 2021-05-21 15:18:16 +00:00
mirror-dev.sh Update mirror-dev for *-dev:amd64 packages. 2017-11-09 22:44:57 +00:00
misc_utils.py Whitespace fixes for Python tools 2014-06-25 08:40:58 -07:00
MSKPPlayer.cpp Move canvas helper structs to header 2021-08-10 17:53:16 +00:00
MSKPPlayer.h Move canvas helper structs to header 2021-08-10 17:53:16 +00:00
OverwriteLine.h eliminate SK_BUILD_FOR_WIN32 2018-01-26 19:52:04 +00:00
parse_llvm_coverage.py Walk through files in parse_llvm_coverage.py instead of using 'git ls-files' 2016-04-18 04:18:56 -07:00
pathops_sorter.htm fix pathops bug 8380 2018-12-21 19:15:54 +00:00
pathops_visualizer.htm fix pathops bug 8380 2018-12-21 19:15:54 +00:00
ProcStats.cpp Convert 0 and NULL to nullptr. 2022-02-09 14:20:57 +00:00
ProcStats.h Add heap usage of SkSL::Compiler to nanobench output 2020-07-09 00:05:28 +00:00
public_headers_warnings_check.cpp GN: add public headers warnings check. 2016-11-16 19:27:29 +00:00
random_parse_path.cpp Fix cases of variable shadowing in /tools/. 2021-08-11 16:05:52 +00:00
random_parse_path.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
reformat-json.py Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
Registry.h Remove obsolete double-initialization check. 2022-03-08 16:01:48 +00:00
remote_demo.cpp cleanup TODOs, and warnings 2021-12-15 17:38:34 +00:00
ResourceFactory.h rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
Resources.cpp rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
Resources.h Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h" 2022-03-10 04:47:51 +00:00
retrieve_from_googlesource.py Update references to master branch 2021-05-21 15:18:16 +00:00
rewrite_includes.py Fix rewrite_includes to work in both Python 2 and 3. 2021-08-17 11:53:50 +00:00
RuntimeBlendUtils.cpp [bazel] Compile gms for wasm and WebGL 2022-02-09 18:56:17 +00:00
RuntimeBlendUtils.h Simplify GetRuntimeBlendForBlendMode. 2021-07-30 16:42:36 +00:00
sanitize_source_files.py Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
serve_wasm.py [infra] Deduplicate serve.py 2021-10-12 11:42:50 +00:00
SkMetaData.cpp Move fontmgr_bounds labels to tight bounds 2020-08-24 15:02:44 +00:00
SkMetaData.h Move fontmgr_bounds labels to tight bounds 2020-08-24 15:02:44 +00:00
skottie2movie.cpp Fix skottie2movie gpu async crash 2021-09-11 15:49:19 +00:00
skp_parser.cpp Remove an uncessary and unused parameter for partially generating the JSON command list 2019-12-13 19:30:03 +00:00
skpinfo.cpp Print out picture version even if its unsupported 2021-07-20 00:11:39 +00:00
SkSharingProc.cpp Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h" 2022-03-10 04:47:51 +00:00
SkSharingProc.h Accept a callback used in MultiPictureDocument::endPage 2021-01-06 16:52:50 +00:00
Stats.h Update SkTQSort to use half-open ranges. 2020-07-14 22:13:59 +00:00
test_all.py Fix Python3 compatibility 2021-03-25 14:15:35 +00:00
test_pdfs.py
ToolUtils.cpp Reland "Add kR8_unorm_SkColorType" 2022-02-10 18:00:19 +00:00
ToolUtils.h Extract ToolUtils::sniff_paths 2021-10-19 17:39:11 +00:00
UrlDataManager.cpp begin refactoring SkTDynamicHash and SkTMultiMap 2020-03-16 14:06:30 +00:00
UrlDataManager.h Enable ClangTidy check readability-redundant-smartptr-get. 2020-08-16 15:56:48 +00:00
using_skia_and_harfbuzz.cpp Remove unnecessary ctors now that we have C++17 copy-elision. 2022-01-27 20:26:54 +00:00
valgrind.supp Add another make_get_error_with_random_oom valgrind suppression 2020-06-24 22:15:33 +00:00
win_dbghelp.cpp Remove "dummy" to comply with Android's inclusive language guidance 2020-07-31 19:11:23 +00:00
win_dbghelp.h eliminate SK_BUILD_FOR_WIN32 2018-01-26 19:52:04 +00:00
win_lcid.cpp Move SkTSearch.h into src. 2019-05-15 14:15:07 +00:00
xsan.supp rename tools/xsan.blacklist 2020-07-24 18:12:31 +00:00