Commit Graph

14 Commits

Author SHA1 Message Date
Corentin Wallez 31d1e78d57 BUILD.gn: Add a dawn_samples group
BUG=

Change-Id: I328bdc960bfc28a1ea16ca0c6705cb60b929109f
Reviewed-on: https://dawn-review.googlesource.com/1542
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-09-20 21:17:14 +00:00
Corentin Wallez 21d8438ad6 Validate SPIR-V code when creating ShaderModules
This integrates spirv-val in dawn_native so that regular and
WebGPU-specific validation of shaders is done.

Also adds tests to check OpUndef is correctly rejected so we know
WebGPU-specific validation is working.

Change-Id: If49d276c98bca8cd3c6c1a420903fe34923a2942
2018-09-07 05:41:25 -04:00
Corentin Wallez d8597b2e1f D3D12: Dynamically load D3D12, DXGI and D3DCompiler
Linking against their .lib makes loading Dawn fail on systems that don't
have the DLLs. This happens for example on Windows7 that doesn't have
d3d12.dll. Instead we dynamically load functions pointers from these
DLLs at d3d12::Device startup.

Change-Id: I4d01a12d0f91bec45bf125450d2c08aaa9ff9fac
2018-08-31 09:13:35 -04:00
Yan,Shaobo d958b68cb2 Add correct rpath for dawn samples on linux when using gn build
Dawn Samples missing correct rpath settings on linux platform in
BUILD.gn. This failed program to find .so like libdawn_native on linux.
2018-08-21 05:39:24 -04:00
Corentin Wallez 59e7fad99b BUILD.gn: Remove use of exec_script
Chromium's BUILD files try to avoid uses of exec_script when possible
because they slow down every GN invocation. In preparation for building
Dawn inside Chromium, the calls to exec_script for the code generator
are removed.

In GN, the generator now outputs a "JSON tarball", a dictionnary mapping
filenames to content. This allows us to use the "depfile" feature of GN
to avoid the exec_script call to gather the script's inputs.

Outputs of the generator are now listed in the BUILD.gn files. To keep
it in sync with the generator, GN outputs a file containing "expected
outputs" that is checked by the code generator.

Finally the dawn_generator GN template doesn't create a target anymore,
but users are expected to gather outputs using get_target_outputs.
2018-08-20 07:24:55 -04:00
Corentin Wallez 5b61abce09 Fix Windows compilation using GN and clang-cl.
This includes a bunch of fixes for clang warnings in Windows specific
code that was only compiled by MSVC previously. This also tidies up some
BUILD.gn issues on Windows.
2018-08-14 21:42:32 +02:00
Corentin Wallez 3bb0bb940e Generator,BUILD.gn: add optional python path, use it for Jinja2
This makes the Jinja2 (and MarkupSafe) installation hermetic by
adding it to the DEPS and making the code generator add them in the
first spot of the python path.
2018-08-14 21:42:32 +02:00
Corentin Wallez f5f7ab128f BUILD.gn: Move last third_party deps to third_party/BUILD.gn 2018-08-14 14:33:19 +02:00
Corentin Wallez 4d7d1697fa Add samples to BUILD.gn and their deps to DEPS
Also add missing GLFW DEPS entry
2018-08-14 14:33:19 +02:00
Corentin Wallez d2969a7d3d Make Dawn "gn check" by default (except SPIRV-Tools)
This required adding some missing dependencies, splitting public headers
of libdawn_[native|wire] so they aren't hidden in the
libdawn_[native|wire]_sources targets, and making unittests depend on
sources directly instead of static libraries (which is almost equivalent).

As a byproduct, Empty.cpp is no longer needed and is removed.
2018-08-14 14:33:19 +02:00
Corentin Wallez 649e2feda4 Add GN build for tests and their third party deps. 2018-08-09 20:54:43 +02:00
Corentin Wallez 5aea8d15be BUILD.gn: Use idiomatic string substitution 2018-08-06 21:39:17 +02:00
Corentin Wallez c0494762b7 Speed up the code generator for exec_script.
The code generator doesn't need to load the JSON file to compute the
dependencies our outputs for a codegen target. To better integrate in
noop builds, the lazy-write of generated file is removed because it led
to the code generator running even in noop build (the timestamp of
generated file not being updated).

Also document what could be done to avoid exec_script calls for the Dawn
code generator.
2018-08-06 16:38:33 +02:00
Corentin Wallez 21a23857dc Add initial BUILD.gn files for libdawn[|_native|_wire] 2018-08-06 16:38:33 +02:00