Headers only INTERFACE library with generated headers don't work in CMake
because the GENERATED property is local to a directory. Instead we make a
STATIC library with a Dummy cpp file.
INTERFACE libraries can only have INTERFACE sources so the sources get added
to the dependant's list of sources. If these dependents are in another
directory, they don't see the GENERATED property and fail to configure
because the file doesn't exist on disk.
Use this trick for both dawn_headers and dawncpp_headers that are header
only libraries with generated headers.
Bug: dawn:333
Change-Id: Ib0d6dcc5f351a638d1c5360214c0ce14a28fee3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15921
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The symbol was not marked as static and would cause linking errors
because it would be defined in multiple translation units. Replace it
with a more traditional C-style #define.
Bug:
Change-Id: I19151884b7e8e171f829ffa47b1d119aff12ff99
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15740
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This also changes the name to be consistent with the option being set
in the spvc API.
BUG=dawn:335
Change-Id: I6f7431095493874e1fef0856e563f7f1225cfc21
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15780
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
There appears to be issues with the CTS + spvc that are preventing
chromium to roll, so I am reverting spvc by default, until the CTS
issues are resolved.
BUG=dawn:337
Change-Id: I171ee5325b9afbf5d240a469009433105caf6ddb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15840
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@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>
This reverts commit 97c3be2699.
Reason for revert: Breaks linking on MSVC
Original change's description:
> Use libshaderc_spvc as a source_set, so complete_static_lib applies properly
>
> Brings the list of dependencies for a standalone Dawn app down from:
>
> obj/libdawn_native.a
> obj/libdawn_utils.a
> obj/src/dawn/libdawn_proc.a
> obj/third_party/shaderc/libshaderc_spvc/spvc.o
> obj/third_party/shaderc/libshaderc_spvc/spvc_private.o
> obj/third_party/shaderc/libshaderc_spvc/spvcir_pass.o
> obj/third_party/SPIRV-Tools/libspvtools_opt.a
>
> to
>
> obj/libdawn_native.a
> obj/src/dawn/libdawn_proc.a
>
> Bug: dawn:327
> Change-Id: I74654b304a9cb5f2aff19e72aa6a8bf1eb708c15
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15481
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
TBR=kainino@chromium.org,rharrison@chromium.org
Change-Id: Ib6d17eccebf371b71e74f1857b50bb3cfd67595a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:327
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15722
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Falling-back to direct allocation ensures allocation failure returns OOM.
If no OOM, the resource could be left then used while in an invalid state.
BUG=chromium:1045811,chromium:1047220,chromium:1047048
Change-Id: I927962b1dc6a7422a7d6eac114d82f28a42794a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15600
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Brings the list of dependencies for a standalone Dawn app down from:
obj/libdawn_native.a
obj/libdawn_utils.a
obj/src/dawn/libdawn_proc.a
obj/third_party/shaderc/libshaderc_spvc/spvc.o
obj/third_party/shaderc/libshaderc_spvc/spvc_private.o
obj/third_party/shaderc/libshaderc_spvc/spvcir_pass.o
obj/third_party/SPIRV-Tools/libspvtools_opt.a
to
obj/libdawn_native.a
obj/src/dawn/libdawn_proc.a
Bug: dawn:327
Change-Id: I74654b304a9cb5f2aff19e72aa6a8bf1eb708c15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15481
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
The SampleUtils uses CreateSwapChain with a nullptr surface. This is
currently valid with implementation-based swapchains so the argument
should be tagged as optional.
Bug: dawn:269
Change-Id: Ic00d5a67fb038d2771174bb36f99b66b84f1a252
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15680
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
signatures of Vulkan functions, changing their ABI and making us
incompatible with real drivers. This removes that magic, and replaces it
with an explicit wrapper, VkHandle, which has much of the same
functionality as the original VkNonDispatchableHandle.
It adds definitions for dawn_native::vulkan::VkBuffer et al, which
shadow the native ::VkBuffer et al. This retains type safety throughout
the Vulkan backend without changing every single usage.
Notably, the following things had to change:
- An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
arrays. This is implemented as a reinterpret_cast, which is still
safe as the new VkHandle still has the same memory layout properties
as VkNonDispatchableHandle did.
- When pointing to a VkHandle as an output pointer, it's now necessary
to explicitly get the native ::VkBuffer (via operator*) and point to
it.
Previously reviewed on:
https://dawn-review.googlesource.com/c/dawn/+/15580
Bug: chromium:1046362
Change-Id: I7d34ec38a805025f92165ea9a7ee07ae5c182076
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15641
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This reverts commit 4e17d5c248.
Reason for revert: broken on chromeos
Original change's description:
> Remove VK_DEFINE_NON_DISPATCHABLE_HANDLE magic, use explicit VkHandle wrapper
>
> Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
> signatures of Vulkan functions, changing their ABI and making us
> incompatible with real drivers. This removes that magic, and replaces it
> with an explicit wrapper, VkHandle, which has much of the same
> functionality as the original VkNonDispatchableHandle.
>
> It adds definitions for dawn_native::vulkan::VkBuffer et al, which
> shadow the native ::VkBuffer et al. This retains type safety throughout
> the Vulkan backend without changing every single usage.
>
> Notably, the following things had to change:
> - An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
> arrays. This is implemented as a reinterpret_cast, which is still
> safe as the new VkHandle still has the same memory layout properties
> as VkNonDispatchableHandle did.
> - When pointing to a VkHandle as an output pointer, it's now necessary
> to explicitly get the native ::VkBuffer (via operator*) and point to it.
>
> Bug: chromium:1046362
> Change-Id: I9c5691b6e295aca1b46d4e3d0203956e4d570285
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15580
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org
Change-Id: I500df2e34fd0f245ad04c517ff028ddd7bb5a2bf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1046362
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15620
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Overriding VK_DEFINE_NON_DISPATCHABLE_HANDLE changes the function
signatures of Vulkan functions, changing their ABI and making us
incompatible with real drivers. This removes that magic, and replaces it
with an explicit wrapper, VkHandle, which has much of the same
functionality as the original VkNonDispatchableHandle.
It adds definitions for dawn_native::vulkan::VkBuffer et al, which
shadow the native ::VkBuffer et al. This retains type safety throughout
the Vulkan backend without changing every single usage.
Notably, the following things had to change:
- An explicit conversion from VkBuffer* to ::VkBuffer* is needed for
arrays. This is implemented as a reinterpret_cast, which is still
safe as the new VkHandle still has the same memory layout properties
as VkNonDispatchableHandle did.
- When pointing to a VkHandle as an output pointer, it's now necessary
to explicitly get the native ::VkBuffer (via operator*) and point to it.
Bug: chromium:1046362
Change-Id: I9c5691b6e295aca1b46d4e3d0203956e4d570285
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15580
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
BUG=dawn:325
Change-Id: I66bed7fec65cadecc956878bf11fc204b66ad195
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15500
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Roll third_party/SPIRV-Tools/ 323a81fc5..1b3441036 (9 commits)
323a81fc5e..1b3441036a
$ git log 323a81fc5..1b3441036 --date=short --no-merges --format='%ad %ae %s'
2020-01-24 syoussefi Fix chromium build (#3152)
2020-01-24 dneto Clarify mapping of target env to SPIR-V version (#3150)
2020-01-24 greg Use dummy switch instead of dummy loop in MergeReturn pass. (#3151)
2020-01-23 alanbaker Fix structured exit validation (#3141)
2020-01-23 dneto Add spvParseVulkanEnv (#3142)
2020-01-23 jaebaek Handle conflict between debug info and existing validation rule (#3104)
2020-01-23 syoussefi Use spirv-headers' BUILD.gn (#3148)
2020-01-23 syoussefi Roll external/spirv-headers/ af64a9e82..dc77030ac (4 commits) (#3147)
2020-01-21 afdx spirv-fuzz: Refactoring and type-related fixes (#3144)
Roll third_party/glslang/ b0ada8035..07a55839e (15 commits)
b0ada80356..07a55839ee
$ git log b0ada8035..07a55839e --date=short --no-merges --format='%ad %ae %s'
2020-01-27 rharrison Use correct enum type in case statement
2020-01-27 cepheus Build: Fix more build warnings caused by PR #2038.
2020-01-26 cepheus Build warning: Fix#2062, missing enum value in a switch.
2020-01-08 sk Public: replaced tabs with spaces
2020-01-08 sk CInterface: replaced tabs with spaces
2019-12-30 sk CInterface: added static asserts to compare C/C++ enums
2019-12-30 sk Added LAST_ELEMENT_MARKER for every enum used in the C interface
2019-12-26 sk CInterface: replaced SH_ prefix with GLSLANG_
2019-12-25 sk CInterface: added glslang_program_SPIRV_get_ptr()
2019-12-25 sk CInterface: added files to CMakeLists.txt
2019-12-25 sk CInterface: added _BIT suffix to glslang_messages_t and glslang_reflection_options_t, fixed const-correctness
2019-12-25 sk CInterface: reformatted according to .clang-format rules
2019-12-24 sk Added original glslang_c_interface implementation by Viktor Latypov
2019-12-24 laddoc Add Tess machine dependent built-in variables initialization for GLES 3.2
2019-10-18 timo.suoranta Fixes for gcc 9 / -Werror=deprecated-copy
Roll third_party/shaderc/ a4f9acedf..0681dd61d (2 commits)
a4f9acedf3..0681dd61d3
$ git log a4f9acedf..0681dd61d --date=short --no-merges --format='%ad %ae %s'
2020-01-27 rharrison Remove deprecated APIs (#974)
2020-01-24 dneto Handle new Glslang profile enum in switch (#973)
Roll third_party/spirv-cross/ f9818f080..68bf0f824 (6 commits)
f9818f0804..68bf0f824c
$ git log f9818f080..68bf0f824 --date=short --no-merges --format='%ad %ae %s'
2020-01-27 post Compile fix on older compilers.
2020-01-27 post GLSL: Support GL_ARB_enchanced_layouts for XFB.
2020-01-25 cdavis MSL: Move inline uniform blocks to the end of the argument buffer.
2019-12-16 cdavis MSL: Support inline uniform blocks in argument buffers.
2020-01-23 post Make SmallVector noexcept.
2020-01-22 42098783+barath121 Typo at line 324
Roll third_party/spirv-headers/ 204cd131c..dc77030ac (2 commits)
204cd131c4..dc77030acc
$ git log 204cd131c..dc77030ac --date=short --no-merges --format='%ad %ae %s'
2020-01-20 dneto Fix the license to match LICENSE
2020-01-20 syoussefi Add BUILD.gn
Created with:
roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers
Change-Id: I696c1facf47a03e03e09c72c4d44449a37c1b971
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15480
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
The state-tracking of the webgpu.h swapchain is a bit complicated
because contrary to implementation-based swapchains, they have more
guarantees and a "replacing mechanism". For example instead of hoping
the implementation-based swapchain resize automatically, the
surface-based swapchain needs to be replaced by a new swapchain and
invalidated.
This mechanism of invalidation also needs to be triggered when the last
reference to the surface is lost because we don't want to risk the
application destroying the window from under us.
Adds tests for all the cases of invalidation I could think of apart from
device loss.
Bug: dawn:269
Change-Id: Id515dbb640e13c6e30bb1f1e93b8e54f1e2bba4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15400
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
If Device creation fails, several things are just partially initialized
and the destroy sequence crashes dereferencing null data.
This commit marks the Vulkan device as lost until after it is created.
This avoids parts of the destroy sequence which are unecessary since
the Device was never successfully created and no commands are in flight.
Bug: chromium:1043095
Change-Id: I8e121709fa19b215e118a615b639380d1db1f3f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15460
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
In the webgpu-headers PR it was decided that in the C header
WGPUChainedStruct would be included as a member instead of members being
inlined.
See https://github.com/webgpu-native/webgpu-headers/pull/30
Bug: dawn:160
Change-Id: I8caf91f3106578077c80778621a632411da44423
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15441
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit fixes two problems:
1) It includes testing/libfuzzer/libfuzzer_exports.h which exports
the LLVMFuzzerInitialize symbol. On Mac, not doing so causes it
to be removed by the linker.
2) It makes it so that dawn_use_swiftshader is enabled by default
when fuzzing, and enabling swiftshader also enables the Vulkan
backend.
Bug: chromium:1042426
Change-Id: Ic0ae0d59c91476b0079148f33a4b1ebd1cc6743c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15462
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
There was a typo in macro name used to do platform detection.
Bug:
Change-Id: I81958419b4283d1d0498f5edc48efc385a648e09
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15440
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit changes wgpu::Device::CreateSwapChain to take an additional
wgpu::Surface argument. Passing nullptr is enough to stay on the
previous swapchain implementation, until the new one is ready.
In order to support both the "old" implementation-based swapchains and
the "new" surface-based swapchains. SwapChainBase is now split into
three abstract classes:
- SwapChainBase that has a virtual method for each of the
wgpu::SwapChain methods.
- OldSwapChainBase that corresponds to the implementation-based
swapchains.
- NewSwapChainBase that will contain the surface-based swapchain
implementation and will eventually just be renamed to SwapChainBase.
The interaction of the surface-based swapchains with the Surface objects
aren't implemented yet, neither are the swapchain methods. Only creation
works.
Validation tests for surface-based swapchain creation are added in the
end2end test target because they need to create OS windows.
Bug: dawn:269
Change-Id: I7e07d6c666479867b9a16d7b1b8c181d5dbd69a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15281
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This macro is used only for testing texture zero initialization so it
didn't need to be in DawnTest.h
Bug:
Change-Id: Ifb7ed06d93ae1bc275c9fd4650858c9b27117b5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15360
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The _BitScanReverse64 intrinsic only exists when compiling for 64bit.
Replace it by two calls to _BitScanReverse (the 32bit one) when on
32bit.
Bug:
Change-Id: Ie294327ec914b0ca4a73732e4b78c1f2a08f100f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15321
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This includes moving the destruction of vkDevice from Destroy to the
Device Destructor since we need vkDevice to destroy child objects.
Bug: dawn:68
Change-Id: Id477206b2e3f80138b3708eedcee073303f1b696
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
- Fix a warning on 32bit for converting uint64_t to size_t for the
buffer mapped range.
- Fix a macro redifinition caused by including glfw3.h before windows.h
Bug:
Change-Id: I3897af55679d943b1dfc34b93bba7bd25d8fb7d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Roll third_party/SPIRV-Tools/ f8d7df760..323a81fc5 (2 commits)
f8d7df760c..323a81fc5e
$ git log f8d7df760..323a81fc5 --date=short --no-merges --format='%ad %ae %s'
2019-09-04 alanbaker Validate Vulkan 1.2 capabilities
2019-08-28 dneto Add basic support for Vulkan 1.2: SPV_ENV_VULKAN_1_2
Roll third_party/glslang/ d203754bc..3ed344dd7 (4 commits)
d203754bc1..3ed344dd78
$ git log d203754bc..3ed344dd7 --date=short --no-merges --format='%ad %ae %s'
2020-01-16 cepheus Fix#2059, and also attempt to skip test bots [skip ci]
2019-12-24 laddoc Add Error check flag in io mapper
2020-01-15 cepheus Update to latest SPIRV-Tools, supporting Vulkan 1.2.
2020-01-15 cepheus SPV/Vulkan: Add support for Vulkan 1.2, which defaults to SPIR-V 1.5.
Roll third_party/shaderc/ df0e683b5..f53792645 (2 commits)
df0e683b58..f53792645f
$ git log df0e683b5..f53792645 --date=short --no-merges --format='%ad %ae %s'
2020-01-15 rharrison Use the correct comparison when checking for not MSL (#960)
2020-01-15 dneto Support Vulkan 1.2 (#958)
Roll third_party/spirv-cross/ 172e39f03..f9818f080 (7 commits)
172e39f039..f9818f0804
$ git log 172e39f03..f9818f080 --date=short --no-merges --format='%ad %ae %s'
2020-01-16 post Update license headers to 2020.
2020-01-16 post Run format_all.sh.
2020-01-16 post MSL: Add support for force-activating IAB resources.
2020-01-16 post Deal with illegal names in types as well.
2020-01-15 post Reflection: Add array stride/matrix stride reflection.
2020-01-15 post Reflection: Emit reflection information for array size literalness.
2020-01-15 post GLSL: Implement geometry shader passthrough extension.
Created with:
roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers
Change-Id: Icf361e327598702ecfc0a4cdd3014d0060f2c083
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15200
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This test often crashes on first run, but succeeds on retry.
Bug: dawn:145
Change-Id: I44303a01eaceded10ba277a837c5b5e7649df033
Tbr: cwallez@chromium.org
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15180
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This may be a short term solution before linking our own version
of the Vulkan Loader.
Bug: dawn:283
Change-Id: Ifeddeaa5170bccc912c61059071a83c2b5fd9524
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15121
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>