Commit Graph

9 Commits

Author SHA1 Message Date
Corentin Wallez 943a1a2d7a Add SwapChain::GetCurrentTexture
This is to eventually allow more using swapchain textures as CopySrc and
CopyDst. Note that this commit doesn't add any additional usages.

Because textures can reflect their creation parameters, swapchains now
need to pass in the correct texture descriptor in all code paths. This
requires additional handling in dawn::native error swapchains, and
dawn::wire::client's SwapChain reservation and Device::CreateSwapChain
code.

Tests are added for all of these code paths except
dawn::wire::client::Device::CreateSwapChain because there is no way to
create a Surface in wire tests at the moment (they don't have an
instance).

Bug: dawn:1551
Change-Id: I22d5e909e1e94d48eb52cae57aabff8a7f0c04c1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133463
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
2023-05-26 10:32:17 +00:00
Corentin Wallez 0ebe86d1ca dawn::wire::client: Merge object allocators, add variadic Make.
This commit changes all the [Object]Allocators from the Client into a
PerType<ObjectStore> member that contains a bunch of ObjectStore acting
on ObjectBase.

Adds a new (template) member functions to the client, Make/Get/Free that
act on any object type, and update all the uses of previous
[Object]Allocator to use these new methods.

Also removes generated code that was generated per object type in favor
of using the type-generic ObjectAllocator.

Bug: dawn:1451
Change-Id: I6463b2fc4a827e3000c2a666abf08aa1a71c3b3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93141
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-06-17 21:21:39 +00:00
Corentin Wallez 87af04b769 dawn::wire: Separate ObjectHandle to its own header.
This allows using it without including all of WireCmd_autogen.h. Start
using in client::ObjectBase to use the typedef for ObjectId.

Bug: dawn:1451
Change-Id: I80e7247cc0e83ae48818b0d73b5236c6980204d1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93145
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-06-14 13:22:16 +00:00
Corentin Wallez 45820ae995 Add reflection APIs for wgpu::QuerySet.
Bug: dawn:1451
Change-Id: I8bce40e4fc0c7caca3c3a4b8c385ba8a393a3f1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92662
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-06-09 10:12:13 +00:00
Corentin Wallez 736e97c5e0 Add reflection APIs for wgpu::Texture.
This requires adding a custom implementation of DeviceCreateTexture and
the Texture object in the wire client.

In dawn::native this requires the format enum separately from mFormat
which is a `const Format&` so that garbage format values can be
reflected correctly for error textures.

Bug: dawn:1451
Change-Id: I75b5635f36647f6f04dae54e92154f2b552beb64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92661
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-06-08 18:14:02 +00:00
dan sinclair 357bfa89d8 [chromium-style] Adding/moving constructors and destructors.
This CL adds some missing constructors and destructors. Others are moved
from the header file to implementation files.

Bug: dawn:1405
Change-Id: I17e98f6da48518112bafb0876679cc3989ba2548
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89160
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-09 20:28:54 +00:00
dan sinclair fb5a492787 Fix inclusive language presubmit
The current presubmit has the filter inverted so it would only attempt
to match the filtered files. The file name also has to be converted to
`LocalPath` otherwise it's attempting to compare a python object to a
string and always fails to match.

Bug: dawn:1339
Change-Id: Ie7712dee60f6b9df2cb78c9feab11769f7ea1f02
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 22:25:45 +00:00
Ben Clayton 96e245e576 CMake: Fix sanitizer builds
The sanitizer flags need to be applied to all compilation units, and to all final link stages.

As this is whole-project (dawn + tint), these options have been promoted to DAWN_ options.

Bug: dawn:1339
Change-Id: I17beb5bd2a8f15de9d8f13d132356b5c663d71bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86143
Kokoro-Run: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-04-08 18:08:36 +00:00
Ben Clayton 20cbe6d9e8 tint->dawn: Move src/dawn_wire -> src/dawn/wire
Bug: dawn:1275
Change-Id: I56535bf4d387c4bd423140705ea70812be073eac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79081
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-02-04 12:51:25 +00:00