Commit Graph

719 Commits

Author SHA1 Message Date
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 ae62847f1c Roll SPIRV-Tools
Change-Id: I0b30e4d2b0a142bb073e61329a49a517629e3234
2018-09-07 05:41:25 -04:00
Corentin Wallez cee1a43448 infra: Add a presubmit builder to the CQ.
Change-Id: Iec65e03fb8cb9d673cd611968e4204a46e92c561
2018-09-06 07:16:46 -04:00
Corentin Wallez 0f2a106a2a Revert "cr-buildbucket.cfg: Add cache for win_toolchain"
We already had these caches set up and luci-config now complains about
duplicate keys.

This reverts commit 484aca1d1f.
2018-09-05 08:44:23 -04:00
Corentin Wallez 8e335a5585 Descriptorize ComputePipeline
Change-Id: Ic9d7014ba44d927d7f9ddf81a8870432c68941e8
2018-09-05 08:32:53 -04:00
Corentin Wallez eb7d64a17f D3D12: Destroy all COM objects before the DLLs are unloaded
Change-Id: I00109460fa83110bd9af6d6b8ff2b5022ed580f3
2018-09-05 08:32:53 -04:00
Corentin Wallez 98ca29b582 Fix VkNonDispatchableHandle alignment on Linux x86
There alignof(uint64_t) is 8 but it is aligned to 4 inside structures.

Change-Id: Ia94e9e5c962e9f5898a8f39977b83a9e10cbf454
2018-09-05 08:01:24 -04:00
Corentin Wallez ca81bd3481 GN: Use hermetic builds on Linux
This makes the Linux GN builds use the Chromium copy of binutils and
also makes all platforms use the "custom libcxx" which is libc++.

We do this so that the build doesn't depend on anything from the system
on Linux because our bots are still on trusty with very old libstdc++
and linkers.

Change-Id: I0570fb474f2945c3565e78a56aba66c1a2619afc
2018-09-05 05:18:10 -04:00
Corentin Wallez 484aca1d1f cr-buildbucket.cfg: Add cache for win_toolchain
Change-Id: I80de1062b3fc2a9649a123adc8374cc350db5ac4
2018-09-04 12:36:00 -04:00
Li Hao 3cc58af801 Update reason for hiding vktrace layer 2018-09-03 05:45:37 -04:00
Li Hao 92bddc47c9 Vulkan: add macro for vktrace
Hide vktrace layout behide a marco 'DAWN_USE_VKTRACE' and enable it in
build if need.
2018-09-03 05:45:37 -04:00
Jiawei Shao 9daa4ad1c8 Fix the barrier in vulkan::Texture::TransitionUsageNow to make the
barrier cover all the slices in a 2D array texture.
2018-09-03 05:43:49 -04:00
Jiawei Shao 4ccf4e3fdd Support 2D array texture copying on D3D12, Metal and OpenGL
This patch implements the creation of 2D array textures and copying
between a buffer and a layer of a 2D array texture on D3D12, Metal
and OpenGL back-ends.

TEST=dawn_end2end_tests
2018-09-03 05:43:49 -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
Jiawei Shao 748a5d5b28 Implement DAWN_SKIP_TEST_IF for dawn_end2end_tests
This patch implements a micro DAWN_SKIP_TEST_IF in DawnTest.h which
can be used to skip running a test in dawn_end2end_tests when the
given condition is satisfied.
2018-08-31 03:29:11 -04:00
Corentin Wallez 12ee5a530c cr-buildbucket.cfg: Tighten bot dimensions
There was flakiness on CI because of two things:
 - On Windows there is a bot that's only 32bit and our tools are 64bit
so the gn gen step was failing.
 - On macOS we require a minimum SDK version of 10.12 (the default in
build/'s GN files) and would get scheduled on macOS 10.9.

Change-Id: I47db92ec111d310d9b8cf8d9ee75a415df021581
2018-08-30 08:38:57 -04:00
Jiawei Shao 4b74dbef7b Implement copying between a buffer and a texture 2D array on Vulkan (#257)
Implement copying between a buffer and a texture 2D array on Vulkan

This patch implements the creation of a 2D array texture and data
copying between a buffer and a layer of a 2D array texture on
Vulkan back-ends.

TEST=dawn_end2end_tests
2018-08-30 04:27:38 -04:00
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