Commit Graph

18 Commits

Author SHA1 Message Date
Austin Eng ba2b7fc9b1 Fix multiple device leaks in dawn_end2end_tests and dawn_unittests
Adds ForTesting APIs to the instance to track the number of devices.

Bug: dawn:1164
Change-Id: Ib743afb1e86ef16740d49613f43f9e2f009232bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90583
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-05-18 13:28:21 +00:00
Kai Ninomiya 455f573d09 Reland "[chromium-style] Adding constructors and destructors."
This reverts commit 63cea3f8c0.

...except it skips adding the the constructor/destructor/copy
definitions for dawn::native::Format. Adding them triggers "constexpr
variable cannot have non-literal type" (or "declaration requires a
global constructor" if it's not marked constexpr), unless they're
explicitly marked as =default in the header - which just triggers a
different chromium-style warning, so there's no point.

A better solution to the chromium-style warning on Format may be to just
make the class physically smaller:
https://www.chromium.org/developers/coding-style/chromium-style-checker-errors/#constructordestructor-errors

Bug: dawn:1405
Change-Id: Ied6e9d0abff6bf1330131a40c6583bab18888b67
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90303
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2022-05-17 06:11:42 +00:00
Austin Eng 1a4cb65561 Remove final qualifiers from WireClient/Server HandleCommands
It's useful to override them in Chrome so that HandleCommands
can be wrapped with some logic.

Bug: chromium:1315260
Change-Id: I856c360575bf6696cd51c13d8ce326afa2f2e08b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89704
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-05-12 13:17:47 +00:00
Austin Eng 6400e3bfc0 Add a way to query if a device exists on the wire server
Chromium tracks the devices which live on the wire so it can
automatically call tick on devices that have pending work. This used
to be done by querying an (id, generation) pair and checking if it
resolves to a non-null device.

This CL adds a new way to query directly using the device, since a
refactor in Chrome will change creation such that the id and generation
is not known when a new device is requested.

Also fixes a bug for device callbacks where the required callback
userdata wasn't fully populated for devices created with
requestAdapter. Update a test to check for this as well.

Bug: chromium:1315260
Change-Id: I7468edc3e77bade191e1e9f3eaadebbf4441d88a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89520
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-05-12 00:09:26 +00:00
Kai Ninomiya 63cea3f8c0 Revert "[chromium-style] Adding constructors and destructors."
This reverts commit efab8c894e.

Reason for revert: breaks check_static_initializers check in Chromium
https://chromium-review.googlesource.com/c/chromium/src/+/3636809/
due to the line `static Format kUnusedFormat;` in Texture.cpp.

Error: file "Texture.cpp" is not expected to have static initializers in binary "chrome"

# Static initializers in chrome:
# 000101 _Unwind_Resume@plt
# 000101 guard variable for std::__1::ios_base::Init::Init()::init_the_streams
# 000101 std::__1::DoIOSInit::DoIOSInit()
# 000101 std::__1::DoIOSInit::~DoIOSInit()
# 000101 std::__1::ios_base::Init::Init()::init_the_streams
# 000101 __cxa_atexit@plt [registers a dtor to run at exit]
# 000101 __cxa_guard_abort
# 000101 __cxa_guard_acquire
# 000101 __cxa_guard_release
# 000101 __dso_handle
# InstrProfilingRuntime.cpp __llvm_profile_initialize
# Texture.cpp dawn::native::Format::Format()
# Texture.cpp dawn::native::kUnusedFormat
# Texture.cpp __dtor__ZN4dawn6nativeL13kUnusedFormatE
# Texture.cpp atexit
# iostream.cpp: (empty initializer list)
# Found 15 static initializers in 4 files.


Original change's description:
> [chromium-style] Adding constructors and destructors.
>
> This CL adds missing constructors and destructors.
>
> Bug: dawn:1405
> Change-Id: I0a0ea7ca50643d48cfc4a4dcf4ce46ff37ed10ad
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89200
> Reviewed-by: Austin Eng <enga@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>

TBR=enga@chromium.org,dsinclair@chromium.org,bclayton@google.com,noreply+kokoro@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I86daffc227c2411e8c2c69cc4683224320f4480c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:1405
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89702
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-05-10 23:32:44 +00:00
dan sinclair efab8c894e [chromium-style] Adding constructors and destructors.
This CL adds missing constructors and destructors.

Bug: dawn:1405
Change-Id: I0a0ea7ca50643d48cfc4a4dcf4ce46ff37ed10ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89200
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-05-10 00:14:04 +00:00
Loko Kung 9b34bece93 Removes device from load/store in caching interface.
- No longer needed since the device information should be stored in the cache key.

Bug: dawn:549
Change-Id: I7c4e31e61df93ba317bc6eeb6a84074585f7eed2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88365
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-05-03 02:53:33 +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
Loko Kung 4091e0fa9c Factor out common cache testing code.
- To be used for pipeline cache testing.
- Plumbs overriding the platform to the adapters for testing.
- Restructures build a little bit so that the test infrastructure can have full access to dawn native internals. Also differentiates end2end and white_box a bit more to make it clear that end2end should not have access to dawn native internals.

Bug: dawn:549, dawn:1374
Change-Id: Ibcc6c44a116c7967ee2317c74409f613e896eb0a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86841
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-21 03:14:37 +00:00
dan sinclair d0fb4a36ac Convert all dawn includes to use non-system include syntax.
This CL changes several includes which were using the system include
syntax to the local syntax. This causes GN check to verify that the
headers are specified correctly in the dependencies.

Two missing dependencies are added to the BUILD.gn file for the
Dawn tests.

Bug: dawn:1373
Change-Id: I7afd5ab48f4f2e2ddaf1839058c6bbeec2b97fd0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 14:24:04 +00:00
dan sinclair 51bab8067a Remove redundant override in include/dawn.
This CL removes two redundant override annotations in the include/dawn
folder. The override is redundant due to the final attribute.

This fixes readability/inheritance in include/dawn.

Bug: dawn:1339
Change-Id: I8d58d099ec36f379b2f0beb55007aafc64dab7c1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86445
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-12 17:53:11 +00:00
dan sinclair 265761220b Fix build/include_order in include/dawn.
This CL moves a couple of the import statements around in order to make
the build/include_order lint pass in include/dawn.

Bug: dawn:1339
Change-Id: I0570d150e938ebd27beda3d9d1516491344999b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86444
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-12 17:48:19 +00:00
dan sinclair 012098a86b Add explicit in include/dawn
This CL adds some explicit notations to single argument constructors in
the include/dawn folder.

Bug: dawn:1339
Change-Id: Ie4e31bf68f920acfcfb27828a465e45fe0977af6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86443
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-12 17:43:21 +00:00
dan sinclair 479dc6b7eb Enable build/header_guard
This CL enables the build/header_guard lint check. The existing headers
which failed the check were updated, missing headers added. An exclusion
file for the generator templates was added as well.

Bug: dawn:1339
Change-Id: If572e460179ad501293d5d6cf01e0ea900daa979
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86207
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-11 18:30:50 +00:00
dan sinclair fcf56791c1 Create more targeted CPPLINT.cfg files.
This CL moves the filters out of the PRESUBMIT.py file and into specific
folder CPPLINT.cfg files. This allows having all the lints enabled in
the Tint code and specifically disabling in Dawn code as needed.

Bug: dawn:1339
Change-Id: Ieb0178b0aac0ea67c52cc5547984ea5696eef5a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86208
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-04-11 13:05:40 +00:00
dan sinclair db9db31cab Fixup whitespace/comments issues.
This CL fixes a few tabs to be spaces which makes the whitespace/comments
lint check pass. The check is set to enabled.

Change-Id: I2a6c590aa3bfee888239adc89d1ce4c8c99f3e78
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86083
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-08 19:23:36 +00:00
Shaobo 0a6c2b0f99 Wrap multiplanar iosurface in wgpuTexture
This CL supports wrapping multiplanar iosurface in wgpuTexture.
It also provides mechanism to create TextureView on each planes.

Bug:1307194

Change-Id: I5e82f47944fdea542abba097240c880628b1181f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81482
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-03-28 06:59:22 +00:00
Ben Clayton 9fb7a5146a tint->dawn: Move src/include -> include
Also simplify the target names.

Bug: dawn:1275
Change-Id: I2929b70897f64903b91b693b48c2e8dd7c11d07b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79102
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 18:18:18 +00:00