Prior to CMake 3.12 option() is a cache variable operation which meant
that the overriding of third_party project variables in
third_party/CMakeLists.txt needs to write to the cache.
Also remove a couple extra commas that were causing warnings.
Bug: None
Change-Id: I35efce70cf3e0cb923ebdbad654b2b9883b8f734
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19280
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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>
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>
This helps take advantage of the GN feature where when a directory is
used as a target name, like //foo/bar/baz, the //foo/bar/baz:baz target
is used automatically.
Bug: chromium:1064305
Change-Id: I2e2d9f308fda1b811482026962ab0770ac45e988
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18862
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Previously the surface extensions were only enabled so we could import
VkSurfaceKHR's created from GLFW. To implement the webgpu.h
surface-based swapchains, we are going to use the extension entrypoints
too.
This changes vulkan_platform.h to set defines that make vulkan.h expose
the entrypoints and datatypes for all the Vulkan extensions we might
care about for a given compilation configuration.
Bug: dawn:269
Change-Id: If4202ff5e31c816eccb5f5381bd36b660a3b6c5b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17964
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Adds CMake support for:
- Generating the Dawn headers and C++ wrappers
- libdawn_wire
- libdawn_native with the Metal backend for now
- All the examples.
Bug: dawn:333
Change-Id: I6ffbe090b0bd21d6a805c03a507ad51fda0275ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15720
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
BUG=dawn:287
Change-Id: If39e1211cedefa5d02f1ea2f3ae00f6195e1e916
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14141
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Switch over to using the rule for building spirv-cross from spvc. This
allows GN to avoid double symbol issues in future patches.
Roll third_party/shaderc/ 1d6155d86..30f0559dd (2 commits)
1d6155d867..30f0559dd2
$ git log 1d6155d86..30f0559dd --date=short --no-merges --format='%ad %ae %s'
2019-11-27 rharrison Remove spvc's dependency on shaderc's util library (#914)
2019-11-27 rharrison Clean up how include dirs are propegated for spirv_cross (#912)
Created with:
roll-dep third_party/shaderc
BUG=dawn:281
Change-Id: I49cf237dcab884e84180f83cbbb21acfa549fe61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14121
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Also update shaderc override to be the correct directory
BUG=dawn:285
Change-Id: I021755bbc8f50daa65b6964f3e42d395b51bb94a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
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>
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>
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>
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>
It invokes [NSObject center] which is ambiguous as of the 10.15 SDK.
For now, ignore the ambiguity; a proper upstream fix to glfw will
happen later.
Bug: chromium:973128
Change-Id: Ia0b4186294b16928f55d0a3417c7840e50e8754b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Recently, BUILD.gn has been added to spirv-cross repo:
https://github.com/KhronosGroup/SPIRV-Cross/blob/master/gn/BUILD.gn
However, it is incomplete, currently only inlcudes small config needed
by ANGLE's metal backend.
When building ANGLE and Dawn together with chromium, errors were thrown:
ERROR at //third_party/spirv-cross/spirv-cross/spirv_common.hpp:21:11: Include not allowed.
#include "spirv_cross_containers.hpp"
^-------------------------
It is not in any dependency of
//third_party/dawn/third_party:spirv_cross
The include file is in the target(s):
//third_party/spirv-cross/spirv-cross/gn:spirv_cross_sources
which should somehow be reachable.
___________________
ERROR at //third_party/spirv-cross/spirv-cross/spirv_common.hpp:22:11: Include not allowed.
#include "spirv_cross_error_handling.hpp"
^-----------------------------
It is not in any dependency of
//third_party/dawn/third_party:spirv_cross
Bug: angleproject:2634
Change-Id: Idb328643db0b765ab228ee7d59d7996b6e6073e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13020
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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>
BUG=dawn:231
Change-Id: Id037b8c6179ff1582b05a4923447ab292a0e1258
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11820
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
ChromeOS has is_linux = true so the code to skip compiling GLFW on
ChromeOS didn't work correctly.
BUG=dawn:221
BUG=chromium:1002895
Change-Id: Ifbf8527407ad20b4368531da1d7653ce620d37be
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11200
Reviewed-by: Mitsuru Oshima <oshima@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Due to the way GN target discovery works, glfw would get discovered in
Fuchsia / Android / ChromeOS builds when it isn't supported causing
compilation failures. This changes third_party/BUILD.gn so that glfw
targets are only created on supported platforms. It also changes
dawn_glfw in BUILD.gn to be more robust to building on all platforms.
Bug=dawn:221
BUG=chromium:1002895
Change-Id: I8f40b06f680094406d24e9a6dea44b128e59b854
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11160
Reviewed-by: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
For some unknown reason, during the Chromium build, the
third_party/dawn/third_party:glfw always get rebuilt even when
nothing actually references is (as is the case for "is_fuchsia ==
true").
This ends up in a build failure, since glfw doesn't support this
platform. See [1] for an example.
This CL is a work-around that makes the library empty for Fuchsia
instead. Note that this is never linked into anything so should
not be an issue for any Chromium-related code either.
[1] https://chromium-review.googlesource.com/c/chromium/src/+/1795302
Bug=dawn:221
Change-Id: Ia4344e93b01722b3dd0cddf70a5d13a5b71488b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11041
Commit-Queue: David Turner <digit@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The Fuchsia platforms relies on a number of Vulkan extensions
that have not been upstreamed to Khronos yet, and thus are not
part of the official Vulkan headers (i.e. <vulkan/vulkan.h>).
This CL adds a new header under src/common/ that contains these
declarations, extracted from the Fuchsia source tree, and ensures
they are included automatically from <common/vulkan_platform.h>
This is necessary to support certain features when building
Dawn on Fuchsia.
IMPORTANT NOTE: Some of the things declared in this header will
change once everything is upstreamed, which will require updating
the source code using them. For example,
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TEMP_ZIRCON_EVENT_BIT_FUCHSIA
Will likely be renamed officially as:
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT
And will be assigned a new value by Khronos.
BUG=dawn:221
Change-Id: If88a1dd06083a01d7b34b5cf5ab93f4e3f3681eb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10940
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: David Turner <digit@google.com>
Everyone using spirv-cross includes its headers via <spirv_msl.hpp> for
example. Make Dawn match that convention so it can play better with the
setup used by other projects.
Still leave <spirv-cross/spirv_msl.hpp> working for now because it is
used by shaderc_spvc. A follow up CL to that repo will do the same
change.
BUG=
Change-Id: I9dc590a809d7ba733113b07930a285acfca64a66
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10801
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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>
This updates the content of third_party/khronos/vulkan
to match the upstream v1.1.115 headers.
+ update third_party:vulkan_headers to define the VK_USE_PLATFORM_XXX
macros directly, since this better matches the upstream BUILD.gn
file behaviour.
NOTE: A better patch would use a DEPS entry to get the Vulkan
headers. That's exactly what [1] does, but fails to
integrate with Chromium due to its messy situation
regarding the use of vulkan headers.
Once the Chromium situation is fixed, it will be possible
to remove third_party/khronos/vulkan entirely and rely
on a DEPS entry.
[1] https://dawn-review.googlesource.com/c/dawn/+/9080
BUG=NONE
Change-Id: Id9a3be3e079119368236c0323823e36bec1a056d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9082
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This completely removes the dependency on glad by generating the GL
headers from gl.xml directly.
This requires adding khrplatform.h so all Khronos dependencies are
gathered in third_party/khronos.
Also removes a stray CMakeLists.txt that was still hanging out.
BUG=dawn:165
Change-Id: Ia64bc51bc8b18c6b48613918e2f309f7405ecb3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8163
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This makes the OpenGL entry points loaded at Adapter creation from the
getProcAddress passed in the DiscoveryOptions and update all GL calls in
the backend to go through the new OpenGLFunctions object.
A code generator is added that generates the function loader and list of
GL procs from Khronos' gl.xml file but we can't get rid of glad yet
because it is used to have the PROC typedefs and enum values.
BUG=dawn:165
Change-Id: I2a583d79752f55877fa4190846f5be16cf91651a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7983
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This is necessary because we currently use GLAD to generate all the
OpenGL enums and proc typedef that we use.
BUG=dawn:165
Change-Id: Ie1b88fd676421703e9af63dafe6dee168c600d4d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7982
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Function name changed in shaderc.
SPIRV-Cross split up into additional files.
BUG=chromium:951016
Change-Id: I49abb0a163fefdd61b7d6352e57e2a10f519abd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6440
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This symbol conflicts with a duplicate symbol when we link Dawn into
Chromium on Linux.
Bug: chromium:877147
Change-Id: Iadf8ac81760085a04d82ea9116e367a1bd17cd4d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5260
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Just reorders some files.
Change-Id: I58845fe72fb8381fff32b0d81bb0561d6656c7be
Reviewed-on: https://dawn-review.googlesource.com/c/2900
Commit-Queue: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This CL adds in fuzzers for SPIRV-Cross for HLSL, GLSL, and MSL
outputs. These fuzzers live in Dawn because there is not appropriate
location in the Chromium source repo for them and it is unlikely they
would be land-able in the SPIRV-Cross repo, because it is not coupled
with Chromium's build system and thus Clusterfuzz so would be
effectively dead code. Dawn depends on this code, but it is also
integrated into the Chromium build system, so this was the best place
I could find for them
The code under fuzz unfortunately uses exceptions/aborting as its
error reporting mechanism. This is an acknowledge short coming and
there are efforts to remove this behaviour. To work around this and
reduce the number of false positives found by the fuzzers, a signal
trap has been implemented which will be removed once the code under
fuzz has been updated.
The trap replaces the existing signal handler and silencing signals
while running the code under test. This allows the code under test to
call abort() and not crash the fuzzing process. Theoretically, only
SIGABRT should need to be trapped, but something is causing the signal
from abort() to be converted to SIGSEGV when running under ASAN.
This signal trap has been tested with the fuzzing/sanitizers by
intentionally inserting bad calls that will occur after a few thousand
test cases. It was confirmed that the fuzzer detected the issue and
stops fuzzing.
The alternate to implementing this signal trap would be to turn on
exceptions for the fuzzer. This was attempted, but proved to be
fruitless due to what was reported as an ODR issue, but couldn't
couldn't be silenced. The likely underlying issue was a pre-built
library or other object being built without exceptions was causing
different versions of symbols or the exception version of the standard
library not being instrumented by ASAN. Given the majority of Chromium
eco-system turns off exceptions, fixing this issue would not be
helpful to the larger community and was looking like it would require
significant effort.
BUG=chromium:903380
Change-Id: I63a5595383f99b7a0e150d72bb04c89b8d722631
Reviewed-on: https://dawn-review.googlesource.com/c/2260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This also removes support for Travis and AppVeyor, as well as git
submodules for dependencies.
It also adjusts .gitignore to include dependencies (submodules are
implicitly ignored but are removed in this commit).
Finally, removes some CMake-specific code from the code generator.
BUG=
Change-Id: I4ebc04e530a574b412ef0ca81e4672db01f0ed92
Reviewed-on: https://dawn-review.googlesource.com/c/2040
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Running test in a Chromium build requires using their gtest and gmock
targets as well as a harness that is in //base. Since we want to run
Dawn tests on the Chromium GPU bots, we need to support two
configurations both building tests standalone and in Chromium.
BUG=chromium:870747
Change-Id: I862e62a607e193a27562ece0f1f6d46d8728e446
Reviewed-on: https://dawn-review.googlesource.com/c/2080
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
These new versions contain the fix for not having static libraries
with no sources depending on source sets in their BUILD.gn
BUG=chromium:870747
Change-Id: Ib979d5ee581f37db22347f0f725086a9b9833d07
Reviewed-on: https://dawn-review.googlesource.com/c/1900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This rolls glslang and shaderc to be able to use their BUILD.gn files,
and also rolls SPIRV-Tools and spirv-headers to have compatible
versions.
BUG=chromium:870747
Change-Id: I13c615f6f3d148c9b69f06547992bf5910e04e62
Reviewed-on: https://dawn-review.googlesource.com/c/1680
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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
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