Commit Graph

72 Commits

Author SHA1 Message Date
Corentin Wallez a7278454b2 Make dawn_use_x11 = use_x11 when building inside Chromium
The variable use_x11 in Chromium takes into account more thinks like
whether we are building in LaCrOS mode and more. If we don't do this,
compilation of Chromium fails when Dawn tries to include X11/Xlib.h

Bug: chromium:976495
Change-Id: I8b4e865f50f60235466c8ba72683927124aa094e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30220
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-10-15 14:30:23 +00:00
Hidehiko Abe 948b3a0555 Expand is_linux to is_linux || is_chromeos.
Currnetly ,is_linux GN variable is set to true on Chrome OS build,
but it is planned to be set false. This CL is the preparation
to keep the bahavior compatible.

Bug: chromium:1110266
Test: Build locally.
Change-Id: Iffbfafe3ac5b00899804afa7471a04709046610a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28340
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
2020-09-11 02:24:16 +00:00
Ryan Harrison c4c4ff9eb4 Enable WGSL support by default
Explictly turned off for Skia, since it does not yet have Tint in its DEPS.

Roll third_party/tint/ e8c12f32f..c5cd8f5bd (3 commits)

https://dawn.googlesource.com/tint/+log/e8c12f32f9a9..c5cd8f5bd382

$ git log e8c12f32f..c5cd8f5bd --date=short --no-merges --format='%ad %ae %s'
2020-07-28 rharrison Remove binutils from DEPS and pull in changes to build.gni from Dawn
2020-07-28 rharrison Get 'gn gen --check' passing
2020-07-28 idanr Fix Tint ninja build

Created with:
  roll-dep third_party/tint

BUG=tint:123

Change-Id: Icd26c2d1b7329c94afa6f23c5c057de8efaee3e8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25523
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-07-28 21:57:18 +00:00
Corentin Wallez 8bd3bcf434 Revert "Turn on WGSL support by default in Dawn"
This reverts commit e1d976ed91.

Reason for revert: crbug.com/tint/123

Original change's description:
> Turn on WGSL support by default in Dawn
> 
> Tint is available in Chromium now, so we can turn this on. For situations were
> WGSL support is not needed it can still be turned off via args.gn.
> 
> Roll third_party/tint/ 16890b9ce..13904a612 (15 commits)
> 
> https://dawn.googlesource.com/tint/+log/16890b9ce8b7..5f43fedcd
> 
> $ git log 16890b9ce..5f43fedcd --date=short --no-merges --format='%ad %ae %s'
> 2020-07-16 rharrison Clean up how deps are defined in BUILD.gn
> 2020-07-16 dsinclair Remove refs.cfg.
> 2020-07-16 dsinclair Fixup group list name
> 2020-07-16 dsinclair [msl-writer] Emitting of program constants.
> 2020-07-16 dsinclair [msl-writer] Fixup matrix and array constructors.
> 2020-07-16 dsinclair Differentiate size and stride in array type name.
> 2020-07-16 dneto [spirv-reader] Support duplicate type definitions
> 2020-07-15 dsinclair [msl-writer] Add struct offset support.
> 2020-07-15 dsinclair [msl-writer] Add builtin support
> 2020-07-15 dsinclair Add helpers for referenced variables.
> 2020-07-15 dsinclair [msl-writer] Refactor some entry point variable code.
> 2020-07-15 dsinclair [msl-writer] Generate entry point functions.
> 2020-07-14 dsinclair [msl-writer] Handle emitting user function calls.
> 2020-07-14 dsinclair Inherit refererenced globals up the call stack.
> 2020-07-14 dsinclair [msl-writer] Generate input/output structs
> 
> Created with:
>   roll-dep third_party/tint
> 
> Change-Id: Ia437e8dc309b06a64ddd4d91ec3af1499af13553
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24920
> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
> Reviewed-by: dan sinclair <dsinclair@chromium.org>
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org,dneto@google.com,rharrison@chromium.org,dsinclair@chromium.org

Change-Id: I21513d5b5d461eccd42aa650fa4b46e85daf642f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-22 14:34:49 +00:00
Ryan Harrison e1d976ed91 Turn on WGSL support by default in Dawn
Tint is available in Chromium now, so we can turn this on. For situations were
WGSL support is not needed it can still be turned off via args.gn.

Roll third_party/tint/ 16890b9ce..13904a612 (15 commits)

https://dawn.googlesource.com/tint/+log/16890b9ce8b7..5f43fedcd

$ git log 16890b9ce..5f43fedcd --date=short --no-merges --format='%ad %ae %s'
2020-07-16 rharrison Clean up how deps are defined in BUILD.gn
2020-07-16 dsinclair Remove refs.cfg.
2020-07-16 dsinclair Fixup group list name
2020-07-16 dsinclair [msl-writer] Emitting of program constants.
2020-07-16 dsinclair [msl-writer] Fixup matrix and array constructors.
2020-07-16 dsinclair Differentiate size and stride in array type name.
2020-07-16 dneto [spirv-reader] Support duplicate type definitions
2020-07-15 dsinclair [msl-writer] Add struct offset support.
2020-07-15 dsinclair [msl-writer] Add builtin support
2020-07-15 dsinclair Add helpers for referenced variables.
2020-07-15 dsinclair [msl-writer] Refactor some entry point variable code.
2020-07-15 dsinclair [msl-writer] Generate entry point functions.
2020-07-14 dsinclair [msl-writer] Handle emitting user function calls.
2020-07-14 dsinclair Inherit refererenced globals up the call stack.
2020-07-14 dsinclair [msl-writer] Generate input/output structs

Created with:
  roll-dep third_party/tint

Change-Id: Ia437e8dc309b06a64ddd4d91ec3af1499af13553
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24920
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-07-21 15:43:44 +00:00
Kai Ninomiya 82961129b0 Use canned CheckPatchFormatted instead of our own linting
This calls into git cl format, so it should always be consistent with
that.

Removes all the old clang-format scripts and dependencies.

Change-Id: I879577a5c1df81617ec0d33096ce7884f4413659
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24840
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-15 20:47:57 +00:00
Kai Ninomiya 01aeca22a9 Add .clang-format files and format more files
The .clang-format files tell clang-format to ignore certain directories
(replacing code in lint_clang_format.sh which will be removed).

$ git ls-tree -r master --name-only | grep '\.\(c\|h\|cpp\|gn\|gni\|mm\|m\|py\)$' | xargs ./append-space-to-files
$ git checkout -- generator/templates third_party/khronos/{KHR,vulkan}
$ git cl format --full --python

Followed by manual reformatting of a few things in Python for
readability.

Bug: none
Change-Id: I4c9e472cc9a5cd80c07286e808f4e597cfef5428
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24785
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-15 19:51:17 +00:00
Kai Ninomiya 3d80b5c378 lint_clang_format.sh: Un-skip tests and examples
These were previously skipped because clang-format was messing up our
builder-pattern code. But we got rid of the builder pattern long ago.

The actual files will be autoformatted in the next CL.

Bug: none
Change-Id: Ia01a2cabc2daa9d94a15bf44687bc2e5801b49bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24621
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-10 19:41:38 +00:00
Ryan Harrison 92554d75f3 Update path of third_party/spirv-tools to SPIRV-Tools
Change-Id: Id0ee4940c7cec255558bcca3bfa578ee4bdb87ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24421
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-07-06 21:31:00 +00:00
Ryan Harrison a84ab48150 Add support for different default branches in roll-shader-deps
tint has moved to using origin/main, and shaderc is soon to migrate

Change-Id: I578e4df91330351e10513874b2ca2728e4227803
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23320
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-06-17 23:52:19 +00:00
Jiajie Hu 3e332cd475 Set a default value for dawn_glm_dir like other GN build overrides
Bug: dawn:437
Change-Id: Iffdb281df32a506b1cf21823d27ee18710427457
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22102
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiajie Hu <jiajie.hu@intel.com>
2020-05-27 01:33:33 +00:00
Ryan Harrison 4f3811c064 Add Tint to BUILD.gn
Tint is behind a build flag, since Tint is not yet available in
chromium's third_party.

BUG=dawn:403

Change-Id: If5fa36b36216ef6965341b886c3bd70d27daf23a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-05-07 21:15:55 +00:00
Ryan Harrison 991b947173 Add Tint to DEPS for standalone checkouts
BUG=dawn:386

Change-Id: I0f518bed7e81e4d42ed2a1ef154738d9e8fa4a9c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21160
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-05-06 23:15:54 +00:00
Sean Gilhuly c9e28b1463 Use dawn_has_build in dawn_component
//build/config/gcc:rpath_for_built_shared_libraries is being pulled in
on Skia Linux builds. Don't include it if //build isn't present.

Bug: chromium:1072449
Change-Id: I92f2d0ae0b4325ae672a86d6a38caf241929b65b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20320
Commit-Queue: Sean Gilhuly <sgilhuly@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-04-23 16:24:42 +00:00
Corentin Wallez 59382b7d3f Use python3 for all of Dawn's python scripts
Bug: dawn:389
Change-Id: I5034ab2791f0cca0b7690eae5f4d7f4e6efc4bd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19863
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-17 20:43:07 +00:00
Corentin Wallez 0925720ecb Add the Vulkan loader as an optional dependency and use it on Mac
On macOS we can't rely on having the Vulkan loader installed in the
system. So we add the Vulkan loader as an optional dependency of Dawn
and use it on macOS when building Dawn in standalone with Vulkan
support.

Usage of building our own loader might broaden if the loader gains
features that are useful on other OSes. For example the ability to pass
in the "root ICD" entrypoint to the loader so we can have both
Swiftshader and the system driver at the same time.

Bug: dawn:388

Change-Id: I7ade4961cce0463c66846ad17aebf95224f1afcc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19723
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-17 08:22:25 +00:00
Corentin Wallez b31015b836 Split examples, test and utils in their own BUILD.gn
The basic change was to copy-paste targets in the new BUILD.gn files and
fixup paths / add includes. There's a couple more changes that had to be
done at the same time:

 - Multiple files need to know if GLFW is supported so the variable was
moved to dawn_features.gni.
 - The gtest_and_gmock target used to abstract between Dawn's copy of
GTest/GMock is only needed by tests and was moved in src/tests/BUILD.gn.
 - A leftover dawn_end2end_tests target is left in the main BUILD.gn
file that is an exact copy of the on in src/tests/BUILD.gn. This is
because the GN path is hardcoded in Chromium's isolate_map.pyl that also
can't support GN groups. The only way to move a target I could figure
out was to duplicate it temporarily.

Bug: chromium:1064305
Change-Id: I96820e9d6510b8c9b9112c3e6cd8df2413f04287
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19201
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-10 08:20:10 +00:00
Corentin Wallez 6574f92747 Fix the @rpath of dawn_components
When the libdawn_native target was renamed to dawn_native, the output
library name stayed the same (GN inserts a lib prefix if it isn't
present) but the @rpath annotation changed to be just dawn_native.dylib.

Fix this by adding the lib prefix in the rpath annotation. This requires
changing libdawn_proc to dawn_proc otherwise the rpath annotation would
be liblibdawn_proc.dylib.

Bug: dawn:380
Change-Id: Id8610a6318af3468dcc486ee8d3c035f0273fe0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19200
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-04-09 17:31:40 +00:00
Zhenyao Mo d9d9d1ec73 Make the Vulkan Validation Layers an optional dependency.
The build_overrides directory for the VVL will default to "" which
causes support for them to be skipped if the dependents don't set the
dawn_vulkan_validation_layers_dir variable.

Bug: chromium:1064305
Change-Id: I0a31f5d1d55982b5c953ce8ac6542d38829eedb5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19085
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@google.com>
2020-04-08 20:00:12 +00:00
Corentin Wallez 30ec4fc626 Fixes to be able to build Dawn inside Skia
Add a dawn_has_build override similarly to angle_has_build that makes
Dawn not depend on Chromium //build if it can avoid it. (this was
previously used for mac_sdk.gni).

Only load the Vulkan Validation Layers' gni if it is enable via
dawn_enable_vulkan_validation_layers.

Fix a GN build warning where the source of dawn_components would be
built twice: for example libdawn_native.MetalBackend.o would be built
once for libdawn_native static and once for libdawn_native shared. Fix
this by making libdawn_native as a static library libdawn_native_static.

Change-Id: Ib8fb72282435eb475d7a11dae0d5a9977572fd57
Bug: chromium:1064305
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18963
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-04-07 19:35:47 +00:00
Bryan Bernhart 4b1be08ec9 perf_tests: Update perf_test_runner format.
CL#14740 modified the result format but
the test runner script was never updated.
This fixes the result format and metric check.

Bug: dawn:208
Change-Id: I3a128b91e20ff8629b091ef4bf8fdd6fb616ba0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17921
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2020-03-26 17:46:25 +00:00
Austin Eng eb1ca45df7 Fix Vulkan fuzzer on mac_libfuzzer_chrome_asan
This commit fixes two problems:
1) It includes testing/libfuzzer/libfuzzer_exports.h which exports
   the LLVMFuzzerInitialize symbol. On Mac, not doing so causes it
   to be removed by the linker.
2) It makes it so that dawn_use_swiftshader is enabled by default
   when fuzzing, and enabling swiftshader also enables the Vulkan
   backend.

Bug: chromium:1042426
Change-Id: Ic0ae0d59c91476b0079148f33a4b1ebd1cc6743c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15462
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-01-25 02:14:39 +00:00
Corentin Wallez 3a1746e71c Introduce wgpu::Surface and implement it for HWND, X11 and Metal
This is another step to implement webgpu.h swapchains, Surface is
essentially a union type of all the types of windows that can be used to
create swapchains.

Changes to allow implementing wgpu::Surface and test its creation are:

 - Add GLFWUtils.cpp/.h/_metal.mm  that contains helpers used to use
WebGPU with GLFW. This deprecates BackendBinding.h that will be removed
when the NXT swapchain is removed.
 - Add a `dawn_use_x11` GN variable to factor all the places in BUILD.gn
where we checked whether we should use X11.
 - Add a `supports_glfw_for_windowing` GN variable in the main BUILD.gn
file to control which configuration tests and samples using GLFW can be
built.
 - Add a ObjCUtils.h to contain some ObjC functionality that we'd need
in files that otherwise would be C++ (so that they can be compiled on
all platforms).

Bug: dawn:269

Change-Id: I25548142a1d1d1f05b0f4d71aa3bdc4698d19622
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15081
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-01-15 13:14:12 +00:00
Austin Eng c3609d224a Reland "Use Swiftshader by default when fuzzing"
This is a reland of d08a14b709

It gates dawn_use_swiftshader on dawn_enable_vulkan because the
Vulkan backend isn't supported on Mac. We may support Swiftshader
Vulkan on Mac in the future, but that will first require changes
to how we initialize the Vulkan backend.

Original change's description:
> Use Swiftshader by default when fuzzing
>
> Note: This still requires Chromium to have set dawn_swiftshader_dir
> to take effect.
>
> Bug: dawn:295
> Change-Id: I0c953196630dd2694f68d290e6f3f1e427c20a2f
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14821
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

Bug: dawn:295
Change-Id: Ia125005b35951021702104a99a78712bcd47dd1e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14941
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-01-08 22:59:47 +00:00
Austin Eng 9b2712456f Revert "Use Swiftshader by default when fuzzing"
This reverts commit d08a14b709.

Reason for revert: This breaks the Mac fuzzer builds because it tries
to build with Swiftshader without Vulkan enabled. Reverting this now
to unblock the roll while I work on a fix.

Original change's description:
> Use Swiftshader by default when fuzzing
> 
> Note: This still requires Chromium to have set dawn_swiftshader_dir
> to take effect.
> 
> Bug: dawn:295
> Change-Id: I0c953196630dd2694f68d290e6f3f1e427c20a2f
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14821
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:295
Change-Id: I7b73d5edc844e090d5d2c8efe9efacc60040463e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14940
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-01-08 18:16:47 +00:00
Austin Eng 470921fe46 Reland "fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer"
This is a reland of f58f69f66b

The whitebox dawn_end2end_tests are updated to link statically against
libdawn_native. This is required because the test link against and use
libdawn_native as sources. It is an error with MSVC to both import and
export symbols from libdawn_native.

Original change's description:
> fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer
>
> This option will be used by backends that support error injection so
> that errors can be injected into a "clean" corpus to generate a seed
> corpus with good examples of injected error conditions.
>
> Bug: dawn:295
> Change-Id: I837acdde6dd4274adb56edf8e4307427f8d6333b
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14681
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

Bug: dawn:295
Change-Id: Ifa092d28aa7ac57cfb197aa4daeb8408f8036d4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14820
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-01-06 19:56:17 +00:00
Austin Eng d08a14b709 Use Swiftshader by default when fuzzing
Note: This still requires Chromium to have set dawn_swiftshader_dir
to take effect.

Bug: dawn:295
Change-Id: I0c953196630dd2694f68d290e6f3f1e427c20a2f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14821
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-01-06 19:42:47 +00:00
Austin Eng 87d3138158 Revert "fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer"
This reverts commit f58f69f66b.

Reason for revert: This breaks the MSVC build because the whitebox end2end tests try to both import and export the error injector symbols from libdawn_native

Original change's description:
> fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer
> 
> This option will be used by backends that support error injection so
> that errors can be injected into a "clean" corpus to generate a seed
> corpus with good examples of injected error conditions.
> 
> Bug: dawn:295
> Change-Id: I837acdde6dd4274adb56edf8e4307427f8d6333b
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14681
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org

Change-Id: I14a15fcd094d431cbb8a29d5642a4a7fe6a11f4c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:295
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14741
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-12-20 23:07:40 +00:00
Austin Eng 2cb76ab598 perf_tests: Manually serialize JSON and remove dependency on jsoncpp
jsoncpp causes some flaky failures because of inconsistencies in nested
DEPS. We barely use it for JSON serialization so the simplest solution
is to just manually write the serialization for perf test tracing data.

Bug: dawn:208
Change-Id: Ie5e4b5436e2c9e32e6817d64c6e95c774cb8751f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-12-20 19:39:10 +00:00
Austin Eng f58f69f66b fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer
This option will be used by backends that support error injection so
that errors can be injected into a "clean" corpus to generate a seed
corpus with good examples of injected error conditions.

Bug: dawn:295
Change-Id: I837acdde6dd4274adb56edf8e4307427f8d6333b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14681
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-12-20 15:52:20 +00:00
Austin Eng 5e98e38744 fuzzing: Remove download of existing testcases in seed corpus script
ClusterFuzz already has facilities to minimize testcases daily. It is
not necessary to do so in our update script.

Bug: dawn:295
Change-Id: I9869d25f657b40f1af1aac90c27200a59f46b9c1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14621
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-12-18 00:35:06 +00:00
Austin Eng 6ea362cae0 fuzzing: Add error injection macros to the Vulkan backend
This will enable fuzzing the Vulkan backend with randomly injected
errors to help ensure the backend properly handles all errors. It also
redefines VkResult in the dawn_native::vulkan namespace such that a
VkResult cannot be used unless it is explicitly wrapped.

Bug: dawn:295
Change-Id: I3ab2f98702a67a61afe06315658a9ab76ed4ccc3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14520
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-12-17 00:47:40 +00:00
Austin Eng 97fb51f4af Add script to generate fuzzer seed corpus from tests
This adds a script which runs the end2end_tests, captures a wire trace,
and then minimizes the corpus with the fuzzer. Minimizing the corpus
requires libfuzzer, so this only works in a Chromium checkout.

Unseeded, the fuzzer starts with coverage of about 600 features.
Using a seed corpus captured from the tests, the fuzzer quickly
increases coverage to about 10,000 features.

Change-Id: I8d0db5121745bd5ee4a350cf46fb37cfa434e3dc
Bug: dawn:295
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14242
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-12-13 01:27:31 +00:00
Corentin Wallez 673146475f Allow compilation of Dawn on Android
BUG=dawn:286

Change-Id: Ia65b57fde12a1260d29913f61f9b24eded7dbc30
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13822
Reviewed-by: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-11-28 09:40:54 +00:00
Corentin Wallez 74cebd6879 Allow using swiftshader with the Vulkan backend
This adds swiftshader as a dependency of Dawn, and when it is present
dawn_use_swiftshader=true will force usage of it. (due to a Vulkan
loader limitation we can't have both regular drivers and swiftshader in
the same VkInstance).

BUG=dawn:283

Change-Id: Ib94f4dcca652eb380e994f007cdcfb145b1a5102
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13440
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-11-26 18:21:51 +00:00
Ryan Harrison 80d71ecd12 Remove build rules for spvc support & spirv-cross fuzzers
Disabling this while refactoring how dependencies are set up to avoid
breaking various builds and rolls.

BUG=dawn:285

Change-Id: Iaca2614fb73277a1ea850f90a487693cd4c54fcb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14040
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-11-26 17:42:51 +00:00
Ryan Harrison 48bf745b96 Revert "Convert spvc build flag to a runtime toggle"
This reverts commit 1954436fe2.

Reason for revert:
The shaderc side of this multi-patch brings in a dependency on glslang, which uses a static initializer, which chromium doesn't like.

Original change's description:
> Convert spvc build flag to a runtime toggle
> 
> Also moves some of the spirv_cross code into the main library that was
> feature guarded, since spvc requires it.
> 
> BUG=dawn:281
> 
> Change-Id: I482d1d5a5c851956d3815bad90665c52a1ea15bb
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13860
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org,rharrison@chromium.org

Change-Id: Ia9a025fb4440c96874d1b45776a9f97023ca591d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:281
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13941
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-11-21 20:31:05 +00:00
Ryan Harrison 1954436fe2 Convert spvc build flag to a runtime toggle
Also moves some of the spirv_cross code into the main library that was
feature guarded, since spvc requires it.

BUG=dawn:281

Change-Id: I482d1d5a5c851956d3815bad90665c52a1ea15bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13860
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-21 18:08:15 +00:00
Brian Ho 858f93b86f Disable Vulkan validation layers on Chrome OS
An earlier CL [1] enabled Vulkan validation layers on Linux which
also enables validation layers on Chrome OS. Unfortunately, this
changes breaks the Chrome OS build of Dawn:

.../vulkan.h:63:10: fatal error: 'xcb/xcb.h' file not found

This is because including the validation layers also includes
the Vulkan-Headers repo which has a BUILD file that defines
VK_USE_PLATFORM_XCB_KHR [2]. XCB (and all of X11, for that matter)
is not supported on Chrome OS even though it is a Linux platform.

This is a quick fix for the problem to unbreak the BUILD, but I
think we should discuss what a long-term fix looks like. Do we send
a patch to Khronos to add an "is_chromeos" branch to their BUILD
file a la Fuchsia?

Also, as mentioned by cwallez@ in a different CL of mine, we should
really set up a Chrome OS trybot to catch these earlier. I can
assign a bug to myself for that!

[1] https://dawn-review.googlesource.com/c/dawn/+/13787
[2] https://github.com/KhronosGroup/Vulkan-Headers/blob/master/BUILD.gn#L23

Change-Id: Ic5fb4fa7990cc2232a7416145877e24b10a2a7b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13880
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brian Ho <hob@chromium.org>
2019-11-20 20:31:31 +00:00
Ryan Harrison 8f3dc5836b Add in flag for using spvc instead of direct spriv-cross access
Currently does nothing interesting, future CLs will flesh out the
functionality.

BUG=dawn:281

Change-Id: I89750a45ff5a42a13e1494cafd433bb7ef719b10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13841
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2019-11-20 18:10:11 +00:00
Jiajie Hu 9e5b9edb43 Enable Vulkan validation layers on Linux
When vkDestroyDebugReportCallbackEXT() is called in Backend::~Backend()
and Vulkan validation layers are in use, the variable unique_id_mapping
is referenced internally[1]. However, the variable is global[2] and it's
destructed before Backend::~Backend(), which causes a use-after-free
issue. The issue was unnoticed on Windows, but we observed the crash at
exit on Linux.

[1] 9fba37afae/layers/generated/layer_chassis_dispatch.cpp (4961)
[2] 9fba37afae/layers/generated/chassis.cpp (40)

Bug: dawn:150
Change-Id: I505373a88ef9795243dd18da9785fb49d253e498
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13787
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-11-20 09:45:41 +00:00
Li, Hao 0e1bef3251 Add Vulkan validation layers on Windows
Deploy self-built Vulkan validation layers instead of system installed
one. And it will reuse third_party/angle's Vulkan validation layers if
building with chromium.

Bug: dawn:150
Change-Id: I94e26f7a152fb2a1c39bcb102d60024f4d65eee6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11120
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-11-07 12:13:27 +00:00
Austin Eng 92a011a253 Record and dump trace events in the perf tests
Trace data can be used to build additional metrics which measure
validation costs, GPU time, etc. It will also be helpful to store in
the test output for later analysis.

This CL also adds jsoncpp as a DEP so we can dump trace file json
output.

Bug: dawn:208
Change-Id: Ia6c05ca90aecae308ee6a4fd11e5f43bb03b1dc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12080
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-17 19:00:32 +00:00
Corentin Wallez 8d000e0cc2 Remove unneeded GN config removal after generated file cleanup
We now have a build step that ensures only the allowed generated file
directories are present so we don't need to remove the default includes
config anymore.

BUG=dawn:22

Change-Id: Id835d1bbb1f52a46ea6502f33b419e70207bba10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12420
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2019-10-17 15:51:38 +00:00
Ryan Harrison d561448d0d Add build time flag to control enabling SPIRV-Cross reflection
This adds a flag to enable using the reflection compiler from
SPIRV-Cross, and also updates the build rules to make sure that the
GLSL compiler is also present when using reflection, since the
reflection compiler subclassess the GLSL compiler.

BUG=dawn:231

Change-Id: I4e227cb955a3bb794d906dabdadffdaca001352b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11920
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-10-07 15:47:27 +00:00
Corentin Wallez a9a84dfe1e BUILD.gn: Delete stale generated files in Dawn's gen dir.
This normalizes even more the directory structure of generated files in
Dawn and removes stale autogenerated files that could be included
wrongly using a GN action.

See comment on top of dawn_generator.gni in this commit for more
context.

BUG=dawn:22

Change-Id: I8ec038f949c048431b2b643af4462f98c4ae610b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11361
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-09-19 23:30:42 +00:00
David 'Digit' Turner b749d07ac9 Enable Vulkan for Chromium Fuchsia build.
Enable the Vulkan backend when building Dawn with
the Chromium build system for Fuchsia. To make this
work properly the following is required:

- Modify VulkanInfo.cpp and BackendVk.cpp to correctly probe
  the Fuchsia swapchain layer and its layer extension, as well
  as enabling them when creating a new VkInstance.

- Modify VulkanFunctions.cpp to load the Fuchsia swapchain
  related extension for this platform only.

- Provide a small mock GLFW library for Fuchsia under
  src/utils/Glfw3Fuchsia.cpp, since the upstream project
  does not support this platform at all. Its purpose is
  only to allow the creation of the right VulkanBinding
  instance, which depends on the creation of a display
  surface for latter swapchain creation.

- Add //third_party/fuchsia-sdk:vulkan_base and
  //third_party/fuchsia-sdk:vulkan_validation as
  data_deps of the libdawn_native_sources target in
  order to ensure that the Fuchsia package created by
  the build system will include the correct Vulkan
  libraries (loader and validation layers).

This builds correctly, and both dawn_unittests and
dawn_end2end_tests will run on a real Fuchsia device
or inside the Fuchsia emulator, using either GPU
virtualization or a software-based renderer.

Note: dawn_unittests will also run inside QEMU, but
not dawn_end2end_tests, since the latter requires
proper GPU emulation which is not available in this
environment.

NOTE: All end2end tests pass using a device with
      an "Intel HD Graphics 615 (Kaby Lake GT2)"
      adapter. However:

       - For some reason, a single test takes up
         to 129 seconds to pass
	 (BufferSetSubDataTests.ManySetSubData/Vulkan).

       - The test process crashes inside VkDestroyInstance(),
         apparently inside the Fuchsia-specific imagepipe
	 layer (which implements swapchain support).
	 This is likely a bug in the layer itself, and
	 not Dawn.

    Also, may end2end tests will crash when run inside
    the Fuchsia emulator (which uses GPU virtualization
    to talk to the host GPU). The crashes happen inside
    libvulkan-goldfish.so, the emulator-specific Vulkan
    ICD on this sytem. Not a Dawn bug either.

Bug=dawn:221
Change-Id: Id3598b673e8c6393f24db728b8da49fdde3cac76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8963
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-09 10:52:08 +00:00
Austin Eng ca0eac314b Add Dawn perf test harness
This patch adds a perf test harness for Dawn and a simple test of
buffer upload performance. The test harness is based off of ANGLE's
perf tests.

Because perf tests are parameterized to support multiple test
variants, this patch also adds DawnTestWithParams and ParamGenerator
to support instantiating tests with additional parameters.

Bug: dawn:208
Change-Id: I60df730e9f9f21a4c29fc21ea1a8315e4fff1aa6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10340
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-08-28 23:18:10 +00:00
Brian Ho 0ebd54cf38 Update BUILD flags to support Chrome OS
This CL updates a few flags to support Chrome OS:

- Disables the OpenGL backend on Chrome OS builds.
- Removes the X11 dependency for Chrome OS builds because we do not
support X11.
- Removes the XCB dependency (again, no X11).

BUG=chromium:993457
TEST=e2e and unit tests build and pass on Intel Chrome OS devices

Change-Id: I1cb06453ccc94d1b68a6998ea635bddd6fb7b5ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10100
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-08-13 22:45:14 +00:00
Ryan Harrison eee3e41c55 Add shaderc to DEPS to roll in script
Also adds in forwarding commandline args.

BUG=chromium:979206

Change-Id: I29f7de40d88e71edae6b9f324ce502193263afbb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8400
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2019-06-27 15:35:14 +00:00