Commit Graph

94 Commits

Author SHA1 Message Date
Aleksi Sapon 97b880e6ff Add missing CMake spirv-cross dependency
Also add a missing SPIRV-Tool link

Change-Id: I0d81b6878f09017147b9ccbe21a5784383535ba9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28280
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-09-09 16:39:00 +00:00
Aleksi Sapon 0a1061da0c Fix CMake build with MSVC
Bug: None

Change-Id: I061984e649f89e92e2769fd8aba141bbfdc0d4bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28144
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-09-09 07:08:38 +00:00
Ryan Harrison 2cdb9f1ed1 Remove SPVC toggles and excise remaining references
BUG=dawn:521

Change-Id: Ib6428ca366a70d73096f9b4442c1b7fb69a539ba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28142
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-09-03 18:39:37 +00:00
Ryan Harrison c35e2ba379 Remove usages of SPVC
Remove all usages of SPVC from the code and update the fuzzers. Some
of the include paths and deps came transitively from spvc, so needed
to update build rules.

This patch does NOT remove the flags related to spvc usage, they are
just no-ops as the moment. After this patch lands I will remove the
usage of those flags from the bots, then remove the flags.

BUG=dawn:521

Change-Id: I0d7c3e28f79354c78f00c48b6a383b823094a069
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27900
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-09-02 22:09:08 +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
Sylvain Defresne 212c5bd9b2 Convert GN libs lists to frameworks
GN recently added support for Apple frameworks to link, rather than
overloading the libs lists. This pulls .frameworks out of the libs
lists, so that GN can stop supporting .frameworks in libs in the
future.

Bug: chromium:1052560
Change-Id: I0b57a3c4c995887a57937317db30b67cf7a7f0f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24281
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-15 09:59:46 +00:00
Corentin Wallez 75f55bfaa3 Fix and enable -Wgnu-anonymous-struct
Bug: dawn:394
Change-Id: I7753b7daff2beaeb67fe6cbb54b002ddbe077f6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20701
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-30 16:01:08 +00:00
Corentin Wallez e642b1d959 Fix and enable -Wnested-anon-types
Bug: dawn:394
Change-Id: I51b533c07f21bcacd22a058cf4a080b9b2b853f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20700
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-30 15:58:28 +00:00
Corentin Wallez 42450c6d1c Fix the CMake build because of CMP0077
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>
2020-04-10 17:04:31 +00:00
Corentin Wallez d11cc3961a Split third_party/BUILD.gn in per-project files.
Bug: chromium:1064305

Change-Id: I6fc2da97e20865b62ff34a9d1c3f42120ac90348
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19202
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-10 08:24:00 +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
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 2d10e954ce BUILD.gn: rename libdawn_native/wire to dawn_native/wire
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>
2020-04-07 07:44:00 +00:00
Corentin Wallez ba53617f6f Vulkan: Load functions for surface extensions we support.
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>
2020-03-27 16:50:59 +00:00
Corentin Wallez 35645a601a Roll Dawn's copy of the Vulkan headers.
Bug: None
TBR=enga@chromium.org
Change-Id: I5c5ff19601b6506c9e2ff7b852a4b97b3eb5d70f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: David Turner <digit@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-03-04 12:23:54 +00:00
Corentin Wallez 33466973bc CMake: Add support for the D3D12 backend
Bug: dawn:333
Change-Id: I61defcd7d5a66fc728c92d1e702ed09b5c84968f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16000
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-02-24 13:27:28 +00:00
Corentin Wallez d353ca0881 CMake: Add support for the Vulkan backend
Bug: dawn:333
Change-Id: Id509e5f06862d6fee517ef47c40418077ccf4759
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15941
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-02-18 02:12:35 +00:00
Corentin Wallez 215b5370bc CMake: Add support for the OpenGL backend
Bug: dawn:333
Change-Id: Ic5386dc2fda3ba21f1437ee0b2c3f508ffb9dff7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15940
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-02-15 00:39:13 +00:00
Corentin Wallez 7fe6efba4a Add initial CMakeLists.txt files
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>
2020-02-05 17:16:05 +00:00
Ryan Harrison 77f6db7a0b Fix BUILD.gn issues for Android & Fuschia
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>
2019-11-28 19:48:45 +00:00
Ryan Harrison 22e73a5b28 Use spvc's rules for spirv-cross
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>
2019-11-28 17:14:55 +00:00
Ryan Harrison 2559fc0b84 Removing for_fuzzers target
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>
2019-11-27 15:07:53 +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
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
Elly Fong-Jones 39b4b38f4f mac newsdk: build glfw with -Wno-objc-multiple-method-names
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>
2019-11-08 19:16:10 +00:00
Le Quyen dbf9f7c39c Fix conflicts between ANGLE & Dawn's spirv-cross build config
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>
2019-11-05 09:36:15 +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
Ryan Harrison cc47878116 Adding missing reflection API sources to SPIRV-Cross targets
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>
2019-10-04 15:55:42 +00:00
Corentin Wallez 785ec66b66 BUILD.gn: Correctly skip GLFW on ChromeOS
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>
2019-09-12 16:33:31 +00:00
Corentin Wallez fad96f6e59 BUILD.gn: Only expose the GLFW target on platforms that support it
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>
2019-09-11 16:53:46 +00:00
David 'Digit' Turner f60522f5a4 [fuchsia] Fix Chromium build.
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>
2019-09-10 13:01:59 +00:00
David 'Digit' Turner 882ff72742 [fuchsia] Add headers containing extra vulkan definitions.
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>
2019-09-09 16:48:58 +00:00
Corentin Wallez f5c44772a6 Use the agreed upon include path for spirv-cross.
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>
2019-09-04 08:47:14 +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
David 'Digit' Turner ee0fa175a3 Update Vulkan headers to v1.1.115
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>
2019-07-17 14:48:27 +00:00
Corentin Wallez 8f4046b0b6 Remove glad and replace it with our own GL header
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>
2019-06-17 09:17:29 +00:00
Corentin Wallez df69f24824 OpenGL: Don't use glad to load OpenGL entrypoints
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>
2019-06-13 10:22:32 +00:00
Corentin Wallez 3dc8bf4c6f Update glad for Desktop GL 4.6 and GLES 3.2
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>
2019-06-12 21:59:42 +00:00
Austin Eng f3f5bf480d Remove glTFViewer from samples
Bug: dawn:152
Change-Id: I5bd36f4ae56889bf12652f8a201a7f7be5e2d25d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7360
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2019-05-18 03:14:46 +00:00
Frank Henigman 9a9b837519 Roll all SPIR-V dependencies together.
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>
2019-04-11 14:52:55 +00:00
Austin Eng 8d79f78c78 Remove GLVersion from GLAD header and make it static
Bug: chromium:877147
Change-Id: I9635fdf977dd13658a957bd247e453f3b6511dca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5520
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2019-03-11 21:20:42 +00:00
Austin Eng c8eff1c1e1 Remove export of GLVersion from GLAD
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>
2019-03-04 23:41:28 +00:00
Corentin Wallez d56f8d2e05 Remove Chrome-specific configs for GLFW and GLM
BUG=chromium:935641
BUG=chromium:935704

Change-Id: I3ebe97beb330ff8e446a54c218f4c34001259b33
Reviewed-on: https://dawn-review.googlesource.com/c/5061
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2019-02-26 09:55:23 +00:00
Corentin Wallez fd3717fa7c Fix the build with only the OpenGL and Null backends enabled
BUG=chromium:914375

Change-Id: I07dbdbdb7518ac6b9800483f570fe97c16f08ee1
Reviewed-on: https://dawn-review.googlesource.com/c/3243
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2018-12-14 08:28:55 +00:00
Stephen White 0f50114b3c Disable/avoid some warnings.
Implement DAWN_DECLARE_UNUSED macro to avoid -Wunneeded-internal-declaration
warning.

Change-Id: I4d087d2b09b74e35ba7ea69533df2c5adef4ef82
Reviewed-on: https://dawn-review.googlesource.com/c/2943
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-12-06 19:01:22 +00:00
Stephen White 9fca812285 Minor clang-format on third_party/BUILD.gn.
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>
2018-12-04 19:44:52 +00:00
Corentin Wallez 391c8a9224 Roll GLFW to pick up macOS Mojave fixes
BUG=dawn:35

Change-Id: Id9f71ab3a6023b21883d1b3d2f8afcebcf5b2f71
Reviewed-on: https://dawn-review.googlesource.com/c/2480
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2018-11-19 10:21:23 +00:00
Ryan Harrison 9854295ff6 Add fuzzers for SPIRV-Cross
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>
2018-11-12 12:20:21 +00:00