Commit Graph

22 Commits

Author SHA1 Message Date
Luke Street f10e70a26d Vulkan: Allow non-opaque alpha 2023-05-27 14:55:57 -04:00
Corentin Wallez 1b48cc0d6f Add more supported swapchain texture usages.
Adds the CopySrc and CopyDst usages to swapchain textures when
available in backends so that the wgpu::Texture returned from
GetCurrentTexture can be used in copies.

Also adds a swapchain tests to check that these usages indeed
work.

Bug: dawn:1551
Change-Id: I8495075b0bfb5b8dd953a7811a9d75a76096b143
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133464
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-26 15:48:12 +00:00
Corentin Wallez 858ccc8a0c Make GetCurrentTextureView use an internal GetCurrentTexture
This is a small refactor in preparation for exposing GetCurrentTexture
on the SwapChain.

Bug: dawn:1551
Change-Id: I7cc8ec4a9042f48c4af7b2cc2126b1d9248a2003
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133462
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
2023-05-23 12:30:36 +00:00
Albin Bernhardsson 42b688bcff Fix Vulkan swapchain synchronization
It is necessary to use a semaphore to synchronize rendering and
presenting even when the graphics and present queues are the same.

This fixes rendering artifacts encountered on a Mali-G78 device.

Bug: dawn:269
Change-Id: Ieb0240d3668b7f9f68857ed3cf8d3bfea18cf33a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/130221
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Albin Bernhardsson <albin.bernhardsson@arm.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-05-03 17:06:13 +00:00
Stephen White ebafab6556 Rename vulkan::Adapter -> vulkan::PhysicalDevice.
Bug: dawn:1774
Change-Id: Iad2896033fc4ae04513444db1a0c941c6c1681ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131000
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-02 20:48:09 +00:00
Le Hoang Quyen 335573116c Add Device::GetSupportedSurfaceUsage() method.
This method will return supported usage flags that can be used to create
a swap chain.

Bug: dawn:1760
Change-Id: I7699c2c4ef7142c6bd06e72239d6e4f9112f15a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127440
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-04-20 20:42:05 +00:00
Corentin Wallez 1226684b09 Merge NewSwapChainBase in SwapChainBase
Bug: dawn:269
Change-Id: I514c210f88e2bf1f501e2d814f8ab931c5ed724f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126423
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-07 13:30:50 +00:00
Corentin Wallez 8a6ed63809 Remove OldSwapChain*
Bug: dawn:269
Change-Id: I5bc6f5f8b98a88c5d0bd69e0d2eaf1e4bbd12e2b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126422
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2023-04-05 10:13:01 +00:00
Loko Kung 53893a3d77 Adds error promoting to device loss when disallowed error occurs in a scope.
- Defaults consume error calls to only allow validation and device loss
  errors.
- Allows OOM errors on Buffers, QuerySets, and Textures only.
- Adds initial suite of unit tests (and any necessary updates to mock
  framework).

Bug: dawn:1336
Change-Id: I82112ea6c147e894280e605bf8ae0ce00488c9f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119800
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-28 04:34:32 +00:00
Corentin Wallez 1105ec78fe Merge DAWN_FORMAT_VALIDATION_ERROR in DAWN_VALIDATION_ERROR.
Done with changes to Error.h and the following command:
git grep -l DAWN_FORMAT_VALIDATION_ERROR | xargs sed -i "" "s/DAWN_FORMAT_VALIDATION_ERROR/DAWN_VALIDATION_ERROR/"
then fixing compilation errors in ErrorTests.cpp, Pipeline.cpp and
CommandEncoder.cpp.

Bug: dawn:563
Change-Id: I081a514d662e81f4842b6d7fadfcea67c12720d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100468
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-08-30 13:39:47 +00:00
Shrek Shao 7e74c21873 DAWN_PLATFORM and DAWN_COMPILER macro improvements
Change #if DAWN_PLATFORM_XXX to #if DAWN_PLATFORM_IS(XXX)
To prevent #ifdef usage and reference without including
dawn/common/Platform.h

Also change #if DAWN_COMPILER_XXX to # if DAWN_COMPILER_IS(XXX)

Bug: dawn:1447
Change-Id: If6c9dab15fd2676f9a087507f5efcceeff468d33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92625
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-06-08 19:52:42 +00:00
Corentin Wallez 2e22d9285c Add support for SurfaceDescriptorFromWaylandSurface
Bug: dawn:1246
Change-Id: I0af28e1820ad8da2121a00bdef7202695d23bbf7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75422
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-06-01 09:30:50 +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
dan sinclair a2e94a5ac3 Fix readability/todo issues.
This CL adds names to the TODOs which did not have them and enables
the readability/todo lint. The names are based on the git blame for
the TODO lines.

Bug: dawn:1339
Change-Id: I25a2920bc8fa9606f5dda67a629fdef1c10f8948
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87600
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-21 20:48:11 +00:00
dan sinclair 13e9699b1c Fix build/include_what_you_use
This CL adds the needed headers to pass the include what you use lint
check.

Bug: dawn:1339
Change-Id: Ib8df68e51b2c3711169b400e84768d4804568580
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86941
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 00:58:34 +00:00
dan sinclair b02535557e Fixup build/include_order issues in src/dawn.
This Cl moves the cpp includes to above the project includes fixing up
the build/include_order issues and enabling the lint check.

A couple includes are marked as NOLINT as the c header has to come after
the project header due to setting defines.

Bug: dawn:1339
Change-Id: Ia47499c94fff99106397b83f6c5c7fe100c44a0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86513
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 20:38:44 +00:00
Austin Eng e1f2dcd3b3 Implement rendering with view format reinterpretation
Includes fixes for the backends to create and use a texture view
if reinterpretation is required. Multiple backends used the original
texture and its format instead of the view.

Bug: dawn:1276
Change-Id: Ic31231b2955314e90e011905c9048db6f7899299
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84704
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-07 12:14:55 +00:00
Corentin Wallez 982188ac16 Rename Surface::Type::Xlib to XlibWindow for consistency.
Bug: None
Change-Id: I2750c2fc86cc893d6f124cf7d539a85458bd4105
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84761
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-29 19:32:23 +00:00
AlexVestin 1e627e23f3 Android: Fix incorrect variable name
Bug: dawn:286

Change-Id: I2ad301a243112db1cc11ef83e241eab0812a197f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85062
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-29 18:10:13 +00:00
Corentin Wallez e690a6654a Make SwapChain use a CreateView() instead of APICreateView()
This simplifies reference management and make the swapchain's reentrant
code avoid APIEntryPoints.

Bug: dawn:723
Change-Id: I6c456b9ec349c73d783dbb12a284f322d0be4e1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84763
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-29 09:35:53 +00:00
Alexander Vestin f2556ab35c Initial Android surface
Bug: dawn:286

Change-Id: I50b45706f031254ac5beba5c07c3c4c3d7f9ea12
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84200
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-25 13:18:46 +00:00
Ben Clayton 818001d32e tint->dawn: Move src/dawn_native -> src/dawn/native
Bug: dawn:1275
Change-Id: Ic60a00107a015bc677ff929c492f1085ffc38482
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79083
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-02-04 17:07:46 +00:00