Commit Graph

602 Commits

Author SHA1 Message Date
Corentin Wallez ec72443bf1 GN: Fix MSVC compilation
third_party/BUILD.gn was adding compile flags to suppress failures that
were GCC/Clang specific and caused MSVC to error out. Replace them by
suppression using MSVC's flags.

Change-Id: Ia25ae315dcf8904dbfd8eff877065a24e8c88769
2018-08-29 17:33:10 -04:00
Corentin Wallez a715469b5a Mirror CI builders in the try pool
This will allow testing specific configurations that are on CI
builders when trying to fix them.

Change-Id: If0bc5449e8d5088eff6695ac8671d06d7119dd59
2018-08-28 14:59:13 -04:00
Jiawei Shao 425428f97b Descriptorize Texture
This patch introduces texture descriptor for texture creation instead
of texture builders.

This patch also adds "arrayLayer" to texture descriptor and removes
mDevice in TextureD3D12.
2018-08-28 03:00:48 -04:00
Stephen White 75559bf1be
Change WIN32 to _WIN32. (#260)
WIN32 is defined by the SDK, but _WIN32 is defined by the compiler.
Since Dawn doesn't necessarily include <windows.h> everywhere dawn.h is
included, we should use _WIN32 (which will always be defined).
2018-08-27 10:13:34 -04:00
Corentin Wallez 7b0f760a9a Update Travis to use clang-format-8 after LLVm release
LLVM 7.0 was branched from ToT because it is going to be released soon.
This means that the repo we use to get clang-format now is LLVM 8.0 so
we update to clang-format-8.

We cannot add the LLVM 7.0 specific repo because it isn't in the Travis
APT source whitelist yet. Opened an issue to add to the whitelist:
https://github.com/travis-ci/apt-source-whitelist/issues/386

Change-Id: I30b1cbf3ab5567bfa7fa3073e27eee5fcf3d1785
2018-08-27 05:32:07 -04:00
Corentin Wallez 503e31edcb Make all CI bots scheduled by the gittiles trigger
Change-Id: I255128f881243ae5588db2e85b8a9fe415d4631c
2018-08-24 12:30:16 -04:00
Corentin Wallez 37812a642e DEPS: Use Chromium git mirrors for gtest, SPIRV-Cross and glfw
Change-Id: I69d931e22f58e0a655be5fa059d68b932ebb42d2
2018-08-24 12:28:28 -04:00
Corentin Wallez 0fa2feb96a Roll SPIRV-Cross and use upstream repo.
In the DEPS file we are going to use Chromium's mirror of
github.com/KhronosGroup/SPIRV-Cross so we need to adjust .gitmodules to
point to it instead of Kangz/SPIRV-Cross. Also take that opportunity to
roll SPIRV-Cross.

Change-Id: I4f53a4fc54f5b1b9a754ac55e976c81e5eeabeb2
2018-08-24 12:28:28 -04:00
Corentin Wallez d90748b256 Fix VkNonDispatchableHandle's alignment on 32bit platforms
On 32bit platforms, even if it contains a uint64_t the handle wrapper
will align to 4 bytes because the assembly load operations can't take
advantage of 64bit aligned loads.

Fix this by forcing the alignment to the alignment of what would be the
native Vulkan handle type.

Also use macros with defined()

Change-Id: I0de9b4a77e648c416b04311b854c956762248868
2018-08-24 05:47:57 -04:00
Corentin Wallez 25b4d318c9 Fix typos in cr-builbucket.cfg
Change-Id: I9f8cb76cdae0de8c03afd1ca2f9ecf1d29b1783c
2018-08-23 17:31:37 -04:00
Corentin Wallez 0c601f2646 Fixes for cq.cfg
Remove the extra cq_name and add gerrit {} which is required.

A fun bug happened because our CQ config landed both global/ and
branch/ in the same commit. LUCI tries to discover where cq.cfg with
refs.cfg, however the processing of cq.cfg is done before refs.cfg. This
means that when everything was landed at once, the processing of cq.cfg
didn't where to look, and then refs.cfg was processed, but too late.

Change-Id: I9024278c6a32c806f4ed25b59f54a0365ac24566
2018-08-23 17:27:16 -04:00
Corentin Wallez 7efbacca83 cr-buildbucket.cfg: Fix missing clang and no_clang mixins 2018-08-23 10:07:23 -04:00
Corentin Wallez 99612ae059 Initial CQ configuration
Change-Id: I6af1836b6a3dddab0291bb4166e94d57c9e5eaa0
2018-08-23 08:33:35 -04:00
Corentin Wallez 82b6573d54 Descriptorize Buffer
We still keep a dummy BufferBuilder object around so that it can be used
for the builder error callback tests of the wire.

Change-Id: If0c502bb8b62ee3ed61815e34e9b6ee6c03a65ef
2018-08-23 08:23:06 -04:00
Corentin Wallez 0202250464 Check ShaderModuleDescriptor->nextInChain
Change-Id: Iffa7485b3a2dc43911c86ac614e7d99d737aaf6f
2018-08-23 08:23:06 -04:00
Corentin Wallez 62c774391b Rename GetAllowedUsage to GetUsage.
Resources used to have both a current and an allowed usage but the
concept of current usage has been removed so we can rename "allowed
usage" to "usage" to make the name match WebGPU's
WebGPUBufferDescriptor::usage and WebGPUTextureDescriptor::usage

Change-Id: I5190950bf7f7f5b86c92247ef0240fead9886268
2018-08-23 08:23:06 -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 5800712897 Workaround a _GLIBCXX_DEBUG bug for std::hash<std::bitset>
This fixes the GN debug build on Linux.

Change-Id: I847a8c67eda1f9069477de0af910f0cd520ccc2c
2018-08-21 02:28:16 -04:00
Corentin Wallez f35eff3fde Remove BindGroupBuilder::SetUsage
BindGroup usage isn't something that's part of WebGPU's sketch.idl and
it might never exist. Remove it to simplify the migration of bindgroup
to descriptor.

Change-Id: I21e0a98eb60434d4009e748cd9afcbf89edd7e6a
2018-08-21 02:27:12 -04:00
Corentin Wallez df6710358b Descriptorize ShaderModule
Change-Id: Ic79d00380f583485de0fb05bd47b1f869919ebe6
2018-08-21 02:26:24 -04:00
Corentin Wallez 3ccde9ce72 Fix list nesting in README.md
Github Markdown needs at least two spaces of nesting to add a nesting
level in lists.
2018-08-20 11:11:15 -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 d273d33a63 Add OWNERS and README.chromium 2018-08-17 11:51:42 +02:00
Corentin Wallez 3b24668283 Rewrite the README for Dawn. 2018-08-17 11:51:42 +02:00
Jiawei Shao 94c92fa5e7 Enable RenderPassLoadOpTests on Vulkan back-ends
RenderPassLoadOpTests can pass on Vulkan back-ends now.
2018-08-17 09:53:15 +02: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 682c44af92 DEPS: update toolchain files to not require GYP
build/vs_toolchain.py used to require GYP that we don't have, update it
past a commit that removes that requirement.
2018-08-14 21:42:32 +02:00
Corentin Wallez c28936043a Add a .gclient file to be copied to boostrap a dawn checkout. 2018-08-14 14:33:19 +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 a5696c7aa5 Fix samples not working in Release builds
Calls to flush command buffers were wrapped in ASSERT() which caused
them to be skipped in Release builds.
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 c978fe8d15 Fix D3D12Binding crach after the GetProc refactor 2018-08-09 20:54:43 +02:00
Corentin Wallez ee2fb75b09 Roll several external dependencies.
This makes their revision match the revision that will be in the gclient
DEPS file.
2018-08-09 20:54:43 +02:00
Corentin Wallez ac986030b9 Travis: update to use clang 6.0, build on one thread
Compiling on Linux Debug fails with what may be an out of memory for
clang. Limit the number of jobs to try and avoid OOM.
2018-08-09 20:54:43 +02:00
Corentin Wallez de4dbc3cf7 Fix VulkanBindings crash 2018-08-06 21:39:17 +02:00
Corentin Wallez e046e6b2ab Fix -Wsign-compare warnings in unittests 2018-08-06 21:39:17 +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
Corentin Wallez dcb71a131c dawn_native: Factor getting procs into a single function.
Now the backends only expose the creation of devices. Getting the procs
is moved to DawnNative that will over time more backend-agnostic APIs.
2018-08-06 16:38:33 +02:00
Corentin Wallez f9f44ae289 Update which backends are enabled by default
This changes the Vulkan backend to be enabled by default on Windows and
Linux as well as changes the OpenGL backend to be disabled by default on
OSX.
2018-08-02 13:39:07 +02:00
Corentin Wallez 0a17aa751d Update glad with the fix for the OSX linker issue. 2018-08-02 13:39:07 +02:00
Corentin Wallez fe253f135b Generate a single ProcTable instead of one per backend.
This required putting Queue::Submit on QueueBase which is something we
would want to do anyway, and removes the need for Queue::ValidateSubmit
being called in the ProcTable.

This removes the need for all the "GeneratedCodeIncludes" files and
leads to a bunch of simplifications in BindGroup as well as the
dawn_native CMakeLists.txt.

Finally this was done in order to simplify the writing of BUILD.gn
files.
2018-08-02 13:39:07 +02:00
Corentin Wallez 1ac25e850a Fix the utils copy of glad not being initialized 2018-08-02 13:39:07 +02:00
Corentin Wallez 1a796039d9 Make shared library dependencies private.
By default CMake makes dependencies public, which is not what we want
for libdawn, libdawn_native and libdawn_wire
2018-07-30 17:22:45 +02:00
Corentin Wallez bdc867713a Make dawn_wire a shared library
Also moves the TerribleCommandBuffer to utils:: because it isn't part of
the implementation of the wire, renames dawn::wire to dawn_wire, moves
src/wire to src/dawn_wire and puts the interface of dawn_wire in
src/include/dawn_wire.
2018-07-30 17:22:45 +02:00
Corentin Wallez 012c149fd9 Build with nortti/exceptions and fvisibility=hidden
This both makes the CMake build closer to the Chromium build, and
reduces the binary size heavily.
2018-07-30 17:22:45 +02:00