Commit Graph

4 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 04f12142bd dawn::wire::client: Make object constructors less barebones.
This uses the variadic template arguments to Client::Make to
pass more data to object constructors and move the copying of data from
descriptors into the constructors.

This required adding a descriptor to the textures created in
ReserveTexture. The descriptor should come from the outside to give the
correct reflection data to textures (for example textures from
GPUCanvasContext). So a descriptor argument is added to ReserveTexture
that currently defaults to nullptr, but will be required once current
uses are updated.

Bug: dawn:1451
Change-Id: I44cbd5718b8d75fdde3ab1321d24f69a8e2486de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93142
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-06-19 20:13:01 +00:00
dan sinclair 41e4d9a34c Consistent formatting for Dawn/Tint.
This CL updates the clang format files to have a single shared format
between Dawn and Tint. The major changes are tabs are 4 spaces, lines
are 100 columns and namespaces are not indented.

Bug: dawn:1339
Change-Id: I4208742c95643998d9fd14e77a9cc558071ded39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87603
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-01 14:40:55 +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