Commit Graph

22 Commits

Author SHA1 Message Date
shrekshao 4313dba514 Pipeline cache D3D12 backend impl
Add D3D12 pipeline caching impl: store cachedPSO blob in cached blob.
Record root signature ID3DBlob in cache key together with
D3D_SHADER_BYTECODE, D3D12_GRAPHICS_PIPELINE_STATE_DESC or
D3D12_COMPUTE_PIPELINE_STATE_DESC.

Shader caching is not added.

Add some pipeline caching negative tests.

Bug: dawn:549
Change-Id: Id1cb560b49f1cf495860e2e0bcf92d8d988c5379
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91180
Auto-Submit: Shrek Shao <shrekshao@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-06-02 15:16:20 +00:00
Austin Eng a526167e33 Make child objects ref the device and add a mechanism to break cycles
Update child objects to ref the device. This allows them to outlive
the device, making the implementation more robust such that it is OK
to drop the device before other objects.

Dropping the last external reference to the device is currently an
implicit device.destroy(). This destruction breaks possible ref cycles
where the device refs internal objects which have a back ref to the
device.

Bug: dawn:1164
Change-Id: I02d8e32a21dcc5f05e531bd690baac4a234b5f6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90360
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-05-20 16:57:01 +00:00
Corentin Wallez 420b1fd94e Directly enable -Wglobal-constructors
Relying on the config inside //build breaks in projects that use their
own version of //build instead of Chromium's.

Bug: dawn:1405
Change-Id: I18bbf5c6ddce18e6900f5f4b937d91a152bb2b32
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90524
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-05-18 17:11:17 +00:00
Kai Ninomiya 5eeef7c47f Enable -Wglobal-constructors for dawn/native
Eliminates a static initializer in kUnusedFormat (in Texture.cpp) by
making dawn::native::Format constexpr-constructible.

kUnusedFormat doesn't actually have to be constexpr to fix this, but it
adds explicit enforcement that it's constexpr-constructible.

Includes some extra initializers as a workaround for a bug in the old
version of MSVC (14.26) that's on Kokoro. amaiorano figured out how to
reproduce it locally, with a local install of VS2019 and this magic
CMake incantation:

$ cmake -G "Visual Studio 16 2019" -T v142,version=14.26 ..

Bug: dawn:1405
Change-Id: Ic94324fc624fd720671dec35dcc5ea8ad77ee46d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89863
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2022-05-17 01:41:41 +00:00
Corentin Wallez a569015325 Fix gn check for dawn_unittests.
Fixed: dawn:1404
Change-Id: I203762d4f090554a87b3422023f54627fcc6b4b8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89404
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-05-11 00:22:55 +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
Loko Kung d181a3cf55 Adds pipeline cache and implementation for Vulkan backend.
- Adds testing for Vulkan pipeline caching.
- Removed redundant VK_NULL_HANDLE and use explicit {} initialization for 0 handles when necessary.
- Adds some const qualifiers where applicable and useful.
- Removes overloaded GetCacheKey (const/non-const) versions and exposed the cache key member directly for modifiers in derived classes.

Bug: dawn:549
Change-Id: I5e8ab9716eebc916b813c9d032f8dc1f3f5261bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86581
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-03 00:33:33 +00:00
Corentin Wallez e8592a4913 GN: Rely on the Chromium macOS deployment target again.
Chromium requires macOS 10.11 so we no longer need to special case this
in Dawn for Metal support anymore.

Bug: None
Change-Id: Ib5dee5464a3ec27abdd0f5c62e51caa42171fadb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88303
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-04-28 15:35:13 +00:00
Loko Kung f92040a3d9 Remove PersistentCache and suppress shader cache tests.
- Removed to allow for easier development changes to caching interface as it is implemented for pipeline caching without having to keep supporting this incomplete feature.

Bug: dawn:549, dawn:1341
Change-Id: Id27deca45ac5607a4a6a7a016b19e3d60693ed72
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87610
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-04-27 01:25:12 +00:00
Loko Kung 6d9b322958 Adds new BlobCache "re-declaration" of PersistentCache.
- Note: goal is to merge the two into the same class, but to avoid breaking/fixing the current D3D12 shader caching, introducing a new one, and will merge the old one later on.
- Adds instance of BlobCache to the Instance, and passthrough for the Device to get to it. (We want the cache to be at the Instance so that eventually different devices can still use the cache (assuming same isolation key)).

Bug: dawn:549
Change-Id: Ib7c82a439f32b306f0cccd3db424fb0e427a90a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86400
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-20 23:56:25 +00:00
Loko Kung 83a5d52ed1 Changes dependency on vulkan-tools typemap header.
- Changed path to include only vulkan-tools directory to allow for easier configuration in Skia which cannot use vulkan-deps at the moment.

Bug: dawn:1365
Change-Id: Icbd0d3503b4af9d89b23f89c87f18fde814062f6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86582
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-13 19:14:46 +00:00
Loko Kung c083d65a0c Adds device-side cache key generation.
- Note that the device-side cache key will be prepended to object cache keys to prevent incompatible adapter/device cache clashes.
- Adds a new template file to auto=generate these cache serializers based on arguments.

Bug: dawn:549
Change-Id: I24b9d11eb38c579acfcc173a5dced9e1b649cf2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86081
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-12 23:50:56 +00:00
Loko Kung 23d09c6114 Add compute pipeline cache key generation for Vulkan.
- Adds dependency to vulkan-tools for pNext chain helpers.
- Adds extra caching to vulkan shaders to keep the spirv in the in-memory cache as well.
- Adds pNext chain serializer infra for Vulkan.

Change-Id: Ibe73183fbff15f7310eaaeae92fbd622be1ac096
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85022
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-09 00:10:08 +00:00
Corentin Wallez b28d6c8e1c Remove lintcpp from presubmits since it fails on all Dawn files
Also fixes some other lint issues.

Bug: dawn:1339
Change-Id: I19a212218db3249191deedc671fc6e36991ecad8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86061
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-04-07 11:36:06 +00:00
Ryan Harrison e87ac76f7d Merge remote-tracking branch 'tint/main' into HEAD
Integrates Tint repo into Dawn

KIs:
- Building docs for Tint is turned off, because it fails due to lack
  of annotations in Dawn source files.
- Dawn CQ needs to be updated to run Tint specific tests
- Significant post-merge cleanup needed

R=bclayton,cwallez
BUG=dawn:1339

Change-Id: I6c9714a0030934edd6c51f3cac4684dcd59d1ea3
2022-04-06 15:37:27 -04:00
Loko Kung 09100b79d0 Try to use the vulkan-headers from vulkan-deps instead of third_party/khronos.
Change-Id: Ic4af5ec86e4ea2ec404a6e32e49068fc5993d55a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-01 05:22:55 +00:00
Loko Kung 2391382b14 Implements a cache key serializer and tests.
- Introduces necessary infra to support cache key serialization templating and extensibility.
- Tests cover basic use cases of the infra.

Bug: dawn:549
Change-Id: Idc0bbcb07a3037e9c59841bb3ad7d1040d7b401f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83121
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-17 00:27:26 +00:00
Ryan Harrison b3e6d37055 tint->dawn: Shuffle tint repo layout
BUG=tint:1418

Change-Id: Iee47f1846be63bbd829067b3d818d2603647d4e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80481
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
2022-02-21 17:56:32 +00:00
Stephen White a52abab38c Nuke SPIRV-Cross.
Change-Id: I1fc58d50ba3999e3a9b6f4e30a0799be301893de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79481
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-11 00:45:51 +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
Ben Clayton 35940f9b83 gn: Trim target prefixes from src/dawn targets
Removes stuttering.

Bug: dawn:1275
Change-Id: Ie32929e0b0ca579d7eef13a43fd2d1c648140276
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79101
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 17:15:16 +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