The default value for optional object structure members wasn't set
correctly for C++ structures.
Bug: dawn:22
Change-Id: I09e7f3675f6e0b5990ddcf03601b3b91cd25f553
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31200
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This makes it a lot easier to modify old tests to test deprecation
behavior, and means we can mark all of the places that are going to
break in the deprecation CL (while we're thinking about it) instead of
the removal CL (which is weeks later).
It also makes it so all deprecation warnings in the tests will be
caught. Turns out that they were already clean.
Bug: dawn:520
Change-Id: I429f667207b88df04341179369bb6d24e034ca65
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31141
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
With some refactoring of the relevant validation code.
Bug: dawn:520
Change-Id: Iedda0f7b1b67c20d3a88f2c4183dcc8eeae2096f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30742
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This solves an issues where when switching swapchains the previous
one was destroyed before the new one was created, doing so detached
itself from the Surface, which in turn made the new swapchain not do
a graceful transition via vkSwapchainCreateInfoKHR::oldSwapchain.
Keeping the reference on the surface makes sure we always have
knowledge of the previous swapchain when replacing it. It requires
re-working the lifetime model of NewSwapChainBase to not require a
call to DetachFromSurface in the destructor, and having the Device
explicitly tell a swapchain it got attached on creation (otherwise
there are ASSERTs firing when swapchain creation fails).
In addition, backends are changed to use a SwapChain::Create method
and fail with a validation error (for now) when the previous swapchain
didn't use the same API.
vulkan::SwapChain is updated to use the previous swapchain's device's
fenced deleter to destroy it which is important in the device
switching tests.
The SwapChainValidationTests are updated because with the lifetime
changes the texture view can be kept alive after the application has
lost the last reference to the wgpu::SwapChain.
TBRing since it was reviewed in a different CL (but for the wrong
branch).
TBR=enga@chromium.orgTBR=senorblanco@chromium.org
Bug: dawn:269
Change-Id: Ie4374b5685af990d68969ab9cd7767e53c287ace
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31041
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch fixes a crash issue when the device is destroyed before
the callback of CreateReady{Render, Compute}Pipeline is called. Now
when the callback is called in DeviceBase::ShutDown(), the cached
pipeline object will also be destroyed before the callback returns.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I91ec2608b53591d265c0648f5c02daf7fadac85e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30744
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
vkQueuePresentKHR() may return VK_SUBOPTIMAL_KHR when "a swapchain no
longer matches the surface properties exactly, but can still be used to
present to the surface successfully", so it can also be treated as a
valid return value that indicates vkQueuePresentKHR() has returned
successfully.
This patch fixes the crash when we run the dawn_end2end_test
SwapChainTests.ResizingWindowOnly on the latest Intel Vulkan Windows
driver.
BUG=dawn:269
TEST=dawn_end2end_tests
Change-Id: I571ee74ea75b7a7f6fa59c7eebeed87a2429180d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30842
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Changed upstream in:
- https://github.com/gpuweb/gpuweb/pull/1014
- https://github.com/gpuweb/gpuweb/pull/1130
Note that in some of the cases where width==0 || height==0 || depth==0,
this increases the number of linear data bytes required for a copy.
Since this is a corner case, no deprecation logic is added.
Removes a duplicated copy of this logic in TestUtils.cpp.
Bug: dawn:520
Change-Id: I3b3d079c6ef316df7d95ba5c349bf8de4646fa4d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30741
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
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>
In Vulkan the swapchain can stop working if the window resizes and
doesn't match the size of the swapchain images anymore. WebGPU
applications might not handle resizes instantly, so if the swapchain
becomes incompatible we give them a temporary texture that we'll then
blit inside the real swapchain texture.
This also handles the case where the application requires more usages
than what the swapchain can support.
In addition, temporary checks are added that fail swapchain creation if
the VkSurface doesn't support BGRA8Unorm which is the only allowed
format for WebGPU swapchains at the moment.
SwapChainTests should now work on Vulkan and are enabled.
Bug: dawn:269
Change-Id: I812c0653125ed86d3a0f8f67347e961c7b207a98
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30700
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
The atomic_uint64_t typedef does not appear to be defined on Ubuntu and
you need to use atomic<uint64_t>
Bug: None
Change-Id: I66f92ae6939723a5ca6f7b80dbb1ad8ab633ce4c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30726
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This is mostly a CL to see if the CQ is able to land commits after the
renaming of Dawn's primary branch to "main".
Bug: dawn:555
Change-Id: I8bf176be2320521de72adb2d91893fb350a379b1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30702
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
- There are some methods need to know which query indexes are used in
encoders: endOcclusionQuery, endPipelineStatisticsQuery, resolveQuerySet.
- On Vulkan, we also need to use the used query indexes to reset each
queries between uses. And because the reset command must be called
outside render pass, we need to check whether a query index is writen
twice on command encoder and render/compute encoders.
- Add validation on writeTimestamp for duplicate writes at same index.
Bug: dawn:434
Change-Id: I6d00dd91e565d960246b6d01ad434d2d5c095deb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27561
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This CL updates the Dawn tests to use the new WGSL struct syntax.
Bug: tint:175
Change-Id: I7ce43385f9107f1a133117c41325a344d2241657
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30640
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This CL adds the algorithm include to, hopefully, satisfy the MSVC
build.
Change-Id: Ic0a8a9dfeffe7a02d94d748dbb2813ac576b5371
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30660
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Fix build breakage in libstdc++:
../../third_party/dawn/src/dawn_wire/ChunkedCommandSerializer.h:84:34: error: ‘unique_ptr’ is not a member of ‘std’
84 | auto cmdSpace = std::unique_ptr<char[]>(new (std::nothrow) char[requiredSize]);
| ^~~~~~~~~~
../../third_party/dawn/src/dawn_wire/ChunkedCommandSerializer.h:24:1: note: ‘std::unique_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include <memory>’?
Bug: chromium:957519
Change-Id: I35b129225882a3f9b758c4f49d1a3cace22aacfe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30600
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
The HOMEPAGE_URL is a CMake 3.12ism, and seems to cause some issues on
3.10
Change-Id: I567bd86bb86db7d383efcde8526e57ce8714844f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30641
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
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>
Also output more context when failing to run the code generator.
Bug: None
Change-Id: I6685c062a074ad11a8fd67f19b8698ce9bcf6694
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30560
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>