Commit Graph

113 Commits

Author SHA1 Message Date
Ben Clayton 1affadcab7 CMake: Disable Tint's GLSL writer
Currently enabling this build target requires a dependency on glslang, which Dawn does not provide.
Just disable this target while we figure how we want to tackle this.

Bug: tint:1217
Change-Id: I79f2ef6e1b007e69ad4aa0d40500b0d1c6a52d6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66605
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-10-15 19:10:23 +00:00
Aleksi Sapon 9a10674bb9 CMake: fix third parties when dawn is a sub-build
Set BUILD_TESTING to OFF, mainly so Abseil doesn't build its tests,
which aren't configured properly for sub-builds.

Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR, so third
parties are built in the same directory as the rest of dawn.

Change-Id: I51a2c0887bfb42c1c21223c41bfcbd2816e34034
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-28 16:48:01 +00:00
Ben Clayton 30eeac7578 CMake: Simplify overriding of options / settings
Outer projects can just set() the option / setting before calling add_subdirectory() on Dawn.

Also provide a build directory for Dawn's third_party dependencies. Allows the outer project to specify a third_party directory that's out of the dawn tree.

Change-Id: I04c5f12b362ee9c9488b7b78a6aa5fa6f55dec98
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64743
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-24 10:38:18 +00:00
Brandon Jones a04663c13d Added Abseil as a third-party dependency (Take 2)
Another attempt at https://dawn-review.googlesource.com/c/dawn/+/63780
Depends on https://skia-review.googlesource.com/c/skia/+/451638

This version of the CL fixes the Cmake and Skia compatibility issues
from the previous CL.

Bug: dawn:563
Change-Id: I41a7ee0aef1924df08a9be41e94effb7cd0025df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64600
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-23 20:36:03 +00:00
Ben Clayton 0ecd67a3fa CMake: Fix build when DAWN_BUILD_EXAMPLES=0
glfw is used by several `src/utils/*.cpp` files, regardless of whether examples are being built or not.

Change-Id: Iba90fbf96e254979c72acf792af3cb86d889f5db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64742
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-23 20:13:53 +00:00
Ben Clayton c19329c832 CMake: Only require SPIRV-Cross when enabling OpenGL backend
Change-Id: Ie6be1301c3f2f9877a9dfb04ab5025559b90d926
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64741
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-23 19:24:43 +00:00
Shrek Shao 2f8f2518e5 Revert "Added Abseil as a third-party dependency"
This reverts commit 020d69905e.

Reason for revert: Causing Dawn Skia roll build fails

https://task-scheduler.skia.org/job/AZXXBm9h9ozj3kKiRJM5

Original change's description:
> Added Abseil as a third-party dependency
>
> Using the version in the Chromium repo in order to make use of the .gn
> files it contains.
>
> Doing so also appears to require us to switch where we pull googletest
> from so that the directory structure matches what the Abseil build
> config expects. Fortunately this doesn't seem to cause issues in our
> tests.
>
> Bug: dawn:563
> Change-Id: I55831ad33f282b3d8b03b67826fd2776e5602d89
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63780
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Auto-Submit: Brandon Jones <bajones@chromium.org>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:563
Change-Id: I0fc4e5fc73ab9b0887591135ec01adde990edd6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64361
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2021-09-15 19:22:19 +00:00
Brandon Jones 020d69905e Added Abseil as a third-party dependency
Using the version in the Chromium repo in order to make use of the .gn
files it contains.

Doing so also appears to require us to switch where we pull googletest
from so that the directory structure matches what the Abseil build
config expects. Fortunately this doesn't seem to cause issues in our
tests.

Bug: dawn:563
Change-Id: I55831ad33f282b3d8b03b67826fd2776e5602d89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63780
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
2021-09-14 16:56:15 +00:00
Corentin Wallez 9037669b2e Remove the dependency on shaderc and glslang.
With all tests converted to WGSL we only use shaderc to assemble SPIRV
assembly to binary. shaderc requires glslang but we don't use it at all.
By using SPIRV-Tools directly to assemble SPIR-V, we can remove both the
shaderc and glslang dependencies.

Bug: dawn:572
Bug: chromium:1150045
Change-Id: I1588428dfb9478e7b724478bec662d002ee920e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45765
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-03-24 16:02:13 +00:00
Corentin Wallez a9439199b7 Use Tint/WGSL unconditionally
Bug: dawn:706
Change-Id: I102c37e67e7833bb7441ed8a355a4411bd7b9fb9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45421
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-03-22 21:23:36 +00:00
Aleksi Sapon 9f6bc4e3a9 CMake fix
Add missing source files to CMakeLists.txt (introduced in e3f10e3d8e).

Change-Id: Iac013e6119e9401a2b94a43220ca8f11d86f82dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/43961
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-03-11 16:27:00 +00:00
dan sinclair 4e6b52a21b Revert "Use upstream SPIRV-Cross GN files."
This reverts commit 9fdbb74072.

Reason for revert: The SPIRV-Cross GN files have a bug which is fixed upstream, but Skia is on an old version of SPIRV-Cross so they don't have the fix. So, the build fails when rolling Dawn into Skia complaining about unknown `-fno-exceptions` on the windows bots. Need Skia to either move to vulkan-deps, or roll their spirv-cross forward before this can re-land.

Original change's description:
> Use upstream SPIRV-Cross GN files.
>
> Previously spirv-cross didn't have its own sources files but this
> changed recently so we should use them. This will ultimately allow
> sharing targets between multiple components in Chromium.
>
> Bug: chromium:1179277
> Change-Id: Ib4bb1884b9ba9c4c3804e96d8adbb8905c60c9a3
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/41725
> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Peng Huang <penghuang@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>

Bug: chromium:1179277
Change-Id: If1003bafa7b35f502c08b2dab91dd3d416aab077
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/42420
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-02-24 18:34:21 +00:00
Corentin Wallez 9fdbb74072 Use upstream SPIRV-Cross GN files.
Previously spirv-cross didn't have its own sources files but this
changed recently so we should use them. This will ultimately allow
sharing targets between multiple components in Chromium.

Bug: chromium:1179277
Change-Id: Ib4bb1884b9ba9c4c3804e96d8adbb8905c60c9a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/41725
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-02-19 10:06:42 +00:00
Stephen White 30959dd4d2 Fix libEGL.so.1 issue with ANGLE build.
On Linux, ANGLE only builds a libEGL.so, while GLFW expects to find
libEGL.so.1. The fix is to force GLFW to load libEGL.so instead.

Bug: dawn:447
Change-Id: I4baa5b175a093b5b5d7a5c121085db3006c0e097
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/39561
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2021-01-29 21:44:45 +00:00
Corentin Wallez 99d6c14a3b CMake: set DAWN_ENABLE_WGSL to ON by default.
Bug: dawn:605
Change-Id: Ie18e438b4db81c5197290afd02fb7392196cd1c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35283
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-12-09 15:13:57 +00:00
Corentin Wallez e969861490 Roll vulkan-headers right before the ray tracing breakage.
The next commit in vulkan-headers contains breaking changes that removes
the provisional ray-tracing extension and add the final version of it.
To ease the roll past that, we first roll just before the breaking
changes.

A smaller scale breaking change required rolling the Vulkan Validation
Layers at the same time.

Roll third_party/vulkan-headers/ ced848d69..30e70cbd9 (11 commits)

ced848d699..30e70cbd98

$ git log ced848d69..30e70cbd9 --date=short --no-merges --format='%ad %ae %s'
2020-11-16 jdrouan Add GGP (Stadia) WSI platform support to vk_icd.h
2020-11-15 oddhack Update for Vulkan-Docs 1.2.161
2020-11-08 oddhack Update for Vulkan-Docs 1.2.160
2020-11-01 oddhack Update for Vulkan-Docs 1.2.159
2020-10-18 oddhack Update for Vulkan-Docs 1.2.158
2020-10-12 oddhack Update for Vulkan-Docs 1.2.157
2020-10-12 oddhack Update for Vulkan-Docs 1.2.157
2020-10-04 oddhack Update for Vulkan-Docs 1.2.156
2020-09-28 oddhack Update for Vulkan-Docs 1.2.155
2020-09-21 oddhack Update for Vulkan-Docs 1.2.154
2020-09-06 oddhack Update for Vulkan-Docs 1.2.153

Created with:
  roll-dep third_party/vulkan-headers

Roll third_party/vulkan-validation-layers/ e8b96e86f..8756b1cb9 (498 commits)

e8b96e86fe..8756b1cb93

$ git log e8b96e86f..8756b1cb9 --date=short --no-merges --format='%ad %ae %s'
2020-11-25 mark threading: Check DevWaitIdle ext sync on all device queues
2020-11-25 s.fricke layers: Label VU 04563
2020-11-25 locke tests: Fix wrong descriptor type
2020-11-24 locke layers: Skip some CMD_TYPE
2020-11-23 mark tests: Add some checks for imageFormatMaybeLinear & 02259
2020-11-20 mark stateless: Calculate correct state for 02257, add 02259
2020-11-17 mark corechecks: Use named initializing for vuid structs
2020-11-17 mark drawdispatch: Use named initializing for DrawDispatch structs
2020-11-12 mark corechecks: Moved some #defines to static consts
2020-11-12 mark cmddraw: Align non-CF'd source
2020-11-19 locke layers: Attachment lifetime
2020-10-27 locke tests: Test protected, instance index, filter cubic
2020-10-26 locke layers: Validate filter cubic
2020-10-26 locke layers: Set enum for push constat byte state
2020-10-26 locke layers: Move validation for both image and sampler
2020-10-25 locke layers: Change map lastBound into array
2020-10-20 locke layers: Find Sampler in CmdBind
2020-10-23 locke layers: Validate maxMultiviewInstanceIndex
2020-11-18 locke layers: Save shared_ptr
2020-10-23 locke layers: Protected command buffer
2020-11-23 tony layers: Fix spirv-headers known good
2020-11-19 marky build: Fix clang warnings
2020-11-18 shannon build: Update known-good files for 1.2.161 header
2020-11-16 jeremyg syncval: Use correct raster order for depth/stencil resolve
2020-11-16 mark lifetimes: Correct for non-device parent objects
2020-11-13 shannon build: Reconcile VUIDs for 1.2.160 header
2020-11-13 shannon build: Update known-good files for 1.2.160 header
2020-11-16 locke tests: Using depth stencil image in both
2020-11-16 locke layers: VUID 02687 to 04584
2020-11-11 karl tests: Add test for destroyed buffer during draw validate
2020-11-11 karl layers: Remove duplicate handles from Descriptor subclasses
2020-11-16 mark repo: Update issue templates
2020-11-16 mark repo: Update issue templates
2020-11-13 pankratz layers: Removed duplicate type declaration
2020-11-13 mark scripts: Suppress warning for empty difflist
2020-11-12 mark scripts: Remove format checking shell scripts
2020-11-11 mark scripts: Add python format-checking script and update travis
2020-11-05 mark tests: Add oldSwapchain-from-different-device test
2020-11-09 mark threading: Make swapchain objects traceable to parent
2020-11-10 mark tests: Added specialuse extension BP tests
2020-11-10 mark practices: Add checking of specialuse extensions
2020-11-09 mark practices: Check for specialuse extensions and warn
2020-11-09 mark practices: Added specialuse extension table
2020-11-10 karl layers: Fix typedef and spelling
2020-11-09 jeremyg syncval: Convert enum SyncStageAccessFlags to a std::bitset
2020-11-09 jeremyg syncval: Change generated lookup tables to be const.
2020-11-06 marshall tests: Test queue retirement over timeline semaphores
2020-11-06 marshall layers: Fix queue retirement via waited-on timeline semaphores
2020-11-06 rgarcia layers: Check nullDescriptor when validating vertex attributes
2020-11-02 shannon build: Update known-good files for 1.2.159 header
(...)
2020-04-07 jzulauf layers: Add support for fake device memory address
2020-04-07 locke syncval: Refactor Image encoder/generator
2020-04-06 jzulauf syncval: Cleanup/Refactor AccessContext
2020-04-03 jzulauf layers: Add range operator + and copy constructor
2020-03-20 jzulauf layers: Add subpass transition info to RP state
2020-04-03 jzulauf syncval: Clean up and bugfix Access state resolve
2020-03-25 locke syncval: Change offset generator to image generator
2020-03-17 locke syncval: Add default constructors for Encoders
2020-03-19 jzulauf syncval: Clean attachment first/last for RP creation
2020-03-18 jzulauf syncval: Add end renderpass access context resolve
2020-03-10 jzulauf syncval: Change hazard check to use resolved map.
2020-03-10 locke syncval: Add function name to hazard log messages
2020-03-04 locke tests: Test copy buffer image and blit hazards
2020-03-02 locke syncval: Add copy buffer image and blit entry points
2020-02-28 locke syncval: Use new generator in synchronization
2020-03-04 locke tests: Fix test synchronization errors
2020-03-02 locke syncval: Add dest image adjustment for compressed
2020-02-27 locke syncval: Add new RangeEncoder and RangeGenerator
2020-03-09 jzulauf syncval: Add context interface for detect/update
2020-02-21 jzulauf layers: Enhance Subpass DAG tree information
2020-02-10 jzulauf syncval: Adding race hazard support
2020-02-03 jzulauf syncval: Add logical stage extension to exec scope
2020-01-31 jzulauf sync: Add earlier/later stage maps to codegen
2020-01-23 jzulauf syncval: Add image layout transition hazard checks
2019-12-26 jzulauf tests: Add first image sync tests
2019-12-26 jzulauf syncval: Add image sync validation for CopyImage
2019-12-26 jzulauf tests: Add more flexible interface to VkImageObj
2019-12-18 jzulauf tests: Add testcases for buffer region copies
2019-09-30 jzulauf syncval: Init Sync Val Resource Hazard
2020-07-03 s.fricke tests: Add Protected Resource VUIDs
2020-07-03 s.fricke layers: Add Protected Resource VUIDs
2020-07-09 timvp build: Add a virtual dtor to AspectParameters
2020-07-08 jan-harald.fredriksen tests: Add VUID 04059
2020-07-08 jan-harald.fredriksen layers: Add VUID 04059
2020-07-09 s.fricke tests: Add YCbCr Swizzle VUIDs
2020-07-04 s.fricke layers: Add YCbCr Swizzle VUIDs
2020-07-09 tony layers: Remove leftover enum
2020-07-08 liyl chassis: Fix memory leaks
2020-07-02 lionel.g.landwerlin layers: fix image/view with modifier format feature storage
2020-07-06 shannon build: Fix VUID inconsistencies for 1.2.146 header
2020-07-06 shannon build: Update known-good files for 1.2.146 header
2020-07-08 tony layers: Fix log message
2020-07-07 tony gpu: Fix enabling of required features
2020-07-07 tony tests: Add PhysicalDeviceFeatures to device profile api
2020-07-03 s.fricke layers: Move some sparse VU to stateless
2020-07-08 40687079+rumblehhh Update BUILD.md to use correct helper.cmake path
2020-07-02 s.fricke tests: Add VUID 02711
2020-07-01 s.fricke layers: Add VUID 02711
2020-07-06 mark objtracker: Don't report undestroyable objects
2020-07-01 mark threading: Audit VkDisplay, VkDisplayMode object handling

Created with:
  roll-dep third_party/vulkan-validation-layers

Change-Id: Ie55286cecb8b7d0163a629968786195d211ea662

Bug: chromium:1153258
Change-Id: I0bb6a910c5a7d3f13731097abb1fe4b8de38c6d0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34143
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-27 15:30:07 +00:00
dan sinclair bb3d7981ec CMake updates.
This CL updates the CMake file to allow building Dawn with WGSL support
enabled. A few other required fixes are included.

Bug: None
Change-Id: I11a09710f0ad075a07e23c44ff884826850655e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30841
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-10-23 13:10:20 +00:00
dan sinclair ecd46ab123 Use CMAKE_CURRENT_SOURCE_DIR for third_party/khronos.
The third_party/khronos folder is directly commited into the Dawn repo.
This means it isn't really move-able to a different third_party folder
but it still uses the `DAWN_THIRD_PARTY_DIR` variable. This makes it
difficult to change where the rest of the third party code lives.

This CL changes the `third_party/khronos` references to use
`CMAKE_CURRENT_SOURCE_DIR` instead of `DAWN_THIRD_PARTY_DIR`.

Change-Id: I791bf3dc25e8149da44bbf686b5cdcfd5f4a392e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30620
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-10-20 17:43:00 +00:00
Corentin Wallez bf7fc62175 Roll our copy of the Vulkan headers.
Bug: None
Change-Id: I6d24e9ef21b8c00c5e50d65fdd0c454ae16a42ba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29601
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-10-07 16:47:23 +00:00
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