Bug: dawn:549
Change-Id: I0c0607984193ddcc2add05594517638e5370484d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85863
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
- 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>
This CL adds explicit to various single argument constructors. The
explicit is removed from zero argument constructors. None of these
changes required call sites to change.
Bug: dawn:1339
Change-Id: I7dfcf1b393e7dd379e29cd9bc613cb0626a9a967
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86365
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>
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>
This is a small rework to try to make the template better handle
functions that aren't associated with an object, when during an
unrelated patch I got confused that APICreateInstance didn't appear in
dawn::native.
Change-Id: If5a2aa3f9e348d1847e48fec4e90e5966ddd489d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86530
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>
Add a new muxWriter and use this for stdout writing to ensure
that stdout printing does not tear.
Bug: dawn:1123
Change-Id: Iec1ba16e5524c11bfc00ba38b3e4de3c06627fb1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85366
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL adds the two missing copyright headers to files under src/dawn
and enables the lint flag by default.
Bug: dawn:1339
Change-Id: I3c3ec47b7f93dabadd0934fb93042f695e7e96fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86360
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Queue labels can be set by the defaultQueue.label member of the device
descriptor or the setQueue method.
Device labels can be set label member of the device
descriptor or the setQueue method.
D3D12 and VK backend label support included.
Bug: dawn:1323
Change-Id: Ic44f1fac268c20d5338220eaf959d949a5f66536
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85843
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
About comparisons of different datatypes
Bug: dawn:1123
Change-Id: Iefdb8195041b824f63344a0b367fd5bebbe3ca85
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86308
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Wrap `napi.h` with a Dawn header that defines `NAPI_DISABLE_CPP_EXCEPTIONS`, and then includes the napi.h header.
Required now that CMake correctly disables exceptions with `-fno-exceptions`.
Change-Id: If31b28d331f2071a0119339c60cc3ab8ab801a98
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86301
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
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>
This CL adds the node-addon-api prefix to the napi.h includes. This
required updating the cmake files to have the dawn_third_party_dir as
part of their includes.
Bug: dawn:1339
Change-Id: I56d9f04462d040f6ed236fcef3c4cd85a9144d7f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86241
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL updates the one instance of an empty if body in Dawn to
remove the if. This allows enabling the empty_if_body lint check.
Change-Id: I5c05db828e8033b4f3155a34c3a6723bfd3181d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86082
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Fixed Kokoro failures when building Tint with all readers and writers
disabled.
Change-Id: I9bd041339236488dd563bbe687da883035f2a4b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86181
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This CL removes some trailing ;'s which aren't needed to enables the
readability/braces warning.
Bug: dawn:1339
Change-Id: I776267b4282b1345e6b4258d1aff3d7de9fecb8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86210
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This CL changes the single `sprintf` to an `snprintf` which allows the
runtime/printf lint check to be enabled.
Change-Id: Ieed654a8d5f23250e4bc8ee07001489a060f8dc5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86084
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This CL fixes up a few include issues in the dawn folder allowing the
build/include lint rule to be enabled.
Bug: dawn:1339
Change-Id: I585c0b6a7e9c1f8bff466ea8c3765e2a1486e79c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86240
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
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>
This is obviously a non-optimal solution, but works in all cases
except compressed textures.
Change-Id: I3fd5fd89ef4978a18917b068632f25f75527c594
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84160
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@google.com>
- 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>
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>
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>
Also changes enums to use the concept of "limit class" from the WebGPU
specification.
Fixed: dawn:1242
Change-Id: I328ce98c2eaaf3f4b7ff1c253ee5f3db5a2980f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84762
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This is the result of running clang-format over all of the files.
Change-Id: I196f0e628583f9d87d350d11d762ea9e98987a01
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86080
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Computation of the default depends on the aspect, but the aspect
may be invalid. Make the default computation robust such that it
picks some valid aspect if a valid one is not provided. This will
make computing the default OK, but still fail validation of the
aspect later.
Bug: chromium:1314049
Change-Id: I2dcfe7962c7e30ac627605b6d0f1c269b3a6af6e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86020
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This is both a security/ACL best practice, but also to make the Gerrit UI
better suggest owners for CLs.
Bug: dawn:1339
Change-Id: Ia79b88d919707147d2726a7e4f3ff9080cd275b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86067
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
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>
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
This adds a test, and a toggle disable_resource_suballocation.
This enables testing the behavior discovered in the bug without
creating enormous resources.
Bug: chromium:1313172
Change-Id: I779aad50c051e5022a9c85ebfbf33c18173a748f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85861
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Heaps were destroyed immediately instead of deferring destruction
until after all work using the buffer was complete. This is only
a problem on D3D12. Vulkan allocations already have deferred
deletion, and Metal allocations are managed by the driver.
Bug: chromium:1313172
Change-Id: I0ef43709949c9e86c40e766f7f2029b14c8a2e97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85840
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This reverts commit 0126761de8.
Reason for revert:
Causing Dawn->Chromium roll to fail
BUG=dawn:1346
Original change's description:
> Enable Queue, Device labels to be set.
>
> Queue labels can be set by the defaultQueue.label member of the device
> descriptor or the setQueue method.
>
> Device labels can be set label member of the device
> descriptor or the setQueue method.
>
> D3D12 and VK backend label support included.
>
> Change-Id: Id12dd6e1fc8f1519c55e4efb35e1ead67c085e46
> Bug: dawn:1323
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85540
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Brandon Jones <bajones@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:1323
Change-Id: I62e4b508d2c55fd89f2f4c5cbe5d04d22681aeef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85700
Reviewed-by: Brandon Jones <bajones@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Change-Id: Ia80b1bed84aa7d16421d432d5da861e55175b335
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85841
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Fixed: chromium:1312780
Change-Id: I29f13a2df3ef1db6961a5760a6c1bb05ab3fa89b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85680
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
This removes a little bit of noise from the reflection of shader
metadata in Dawn. Tests are added to make sure that Tint does the
correct validation (it does).
Bug: None
Change-Id: I334e7c23b723cf5b5985c9914cc9f8d79a7c0568
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85502
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
A list of errors, `infringingLimits`, is added to EntryPointMetadata.
During shader reflection, instead of directly bubbling limit errors up,
they are stored in this list and check only later during pipeline
creation.
Several ShaderModule tests are reworked to create a pipeline to check
for the validation of these limits. For the IO variable limits the tests
needed to be reworked to check for strings in the error messages because
since IO structs have to match between VS and FS, if one failed the
other failed too. (so it's no possible to target the validation of one
of these in particular)
Bug: dawn:986
Change-Id: I689e16454488d4a3c746ece53828555ed72ed561
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85501
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
These are implemented by wrapping the integer types in transparent
ClampedInteger<> and EnforceRangeInteger<> structures.
Some parts of the core needed to be updated after this, either to
disambiguate conversions, or because of bugs (u32 vs u64).
To make the CTS tests checking for this pass, the errors returned when
conversion FromJS failed needed to be updated to TypeError and not just
the generic Napi::Error.
Bug: dawn:1123
Change-Id: Ife1d0baa7687e43d735a1814ec41883c49ae74a6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85640
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Queue labels can be set by the defaultQueue.label member of the device
descriptor or the setQueue method.
Device labels can be set label member of the device
descriptor or the setQueue method.
D3D12 and VK backend label support included.
Change-Id: Id12dd6e1fc8f1519c55e4efb35e1ead67c085e46
Bug: dawn:1323
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85540
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
When we do B2T or T2B copy from/to a buffer with paddings,
D3D12 may wrongly calculate the required buffer size.
For example, if copySize = {1, 1, 2}, offset = 0, bytesPerRow =
256, and rowsPerImage = 2 (there is 1-row padding for every image),
and we are copying a non-compressed format like rgba8unorm,
the required minimum buffer size should be:
offset + bytesPerRow * rowsPerImage * (copySize.depthOrArrayLayers - 1)
+ bytesPerRow * (copySize.height - 1) + bytesPerBlock * copySize.width.
It is 0 + 256 * 2 * (2 - 1) + 256 * (1 - 1) + 4 * 1 = 516.
The required minimum buffer on D3D12 (including WARP) size is:
offset + bytesPerRow * rowsPerImage * (copySize.depthOrArrayLayers - 1)
+ bytesPerRow * (rowsPerImage - 1) + bytesPerBlock * copySize.width.
Or offset + bytesPerRow * rowsPerImage * copySize.depthOrArrayLayers
+ bytesPerBlock * copySize.width - bytesPerRow.
It is 0 + 256 * 2 * (2 - 1) + 256 * (2 - 1) + 4 * 1 = 772.
It looks like D3D12 requires unnecessary buffer storage for
rowsPerImagePadding in the last image. It does respect
bytesPerRowPadding in the last row and doesn't require storage for
that part, though.
You can verify the buffer size requirement on D3D12 backend with the
new tests via --enable-backend-validation. The validation layer
says that D3D12 requires 772 bytes but we only provide a 516-bytes
buffer, and leads to E_INVALIDARG (Error code 0x80070057) when run
mD3d12CommandList->Close() in CommandRecordingContext::ExecuteCommandList
and causes device lost.
Bug: dawn:1278, dawn:1288, dawn:1289
Change-Id: Icfb792dec60ff7444cb20b3c283709cdb165f80a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85341
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This allows adding as an error context the name of the entry point, and
dedents the code a little bit.
Bug: dawn:563
Change-Id: I1ea9760fc1aca506826ca7ef5a65d40f8370136d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85500
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
The semantic of popErrorScope was changed from raising an exception on
validation errors to instead reject the promise.
Bug: dawn:1123
Bug: dawn:1324
Change-Id: I34322d8293e112eb2d1bfea784e2b2d6be33b604
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85506
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This remove some interfaces like OffscreenCanvas from the global scope
because dawn.node is not capable to usefully create them. The CTS
uses the absence of these interfaces to skip tests when needed.
Bug: dawn:1123
Change-Id: I6d57600ba6b41be58c541d1f8091e7e88781f04f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85364
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Previously a new promise was created and new promises were never
resolved on creation, only on loss/destruction of the device. This made
the following code wait forever:
device.destroy();
await device.lost();
Bug: dawn:1123
Change-Id: I1e31cf9ccd466672eed4cad464c38cb9f8b3d724
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85362
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This is done by moving the set up of these attributes to the place where
the wrapper objects are created, by doing:
jsObject.DefineProperty("foo", impl->getOnceFoo());
Three alternatives that weren't chosen are:
- Caching a weak reference to the member's Napi::Value on the wrapper
struct, and recreate it only as needed. This is good because it
doesn't risk using the value after it is GCed, but it can result in
multiple calls to the getters, which could be unexpected (for example
for GPUDevice.lost in a follow-up CL).
- Caching a persistent reference to the member's Napi::Value on the
wrapper struct. This calls the getter once and doesn't risk using the
value after it is GCed. However if Javascript does something like
`myGPUDevice.limits.device = myGPUDevice`, a cycle is created that
the GC doesn't have visibility into, and that can't be collected.
(the origin of the edge of the reference graph that persistent
references make is unknown to the GC).
- Caching the member on a hidden variable of the JS object. I didn't
find a way to do this. The closest would have been to do
jsObject[Symbol(...)] = cachedValue but even symbols can be retrieved
with Object.getOwnPropertySymbols.
Bug: dawn:1123
Fixed: dawn:1144
Change-Id: I1bc82dd9d10be95bf2bdca73bdfb843bc556d2df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85361
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Bug: dawn:549
Change-Id: Ie6b3ceb610b362adfed96a0982d7541002660809
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84920
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This patch sets depthWriteEnabled to its default value (false) in the
helper function DawnTest::ExpectAttachmentDepthStencilTestData() as all
the tests can pass with depthWriteEnabled == false on the Linux Intel
bots now.
Note that previously using depthWriteEnabled == false and writing into
FragDepth will cause Linux Intel Mesa driver crash on Mesa 19.0.2.
BUG=dawn:821
TEST=dawn_end2end_tests
Change-Id: I22cc0dcdb8521fd8eae436d99a7c06167af89b09
Change-Id: Id0dd1c31099c6aafad175bde038ba9662b02a160
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85322
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Bug: dawn:549
Change-Id: I5d6306f33b7ad2247ee75a0c5387a2bc6fac0497
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83901
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Spec issue: https://github.com/gpuweb/gpuweb/issues/2715
Spec PR: https://github.com/gpuweb/gpuweb/pull/2716
This is invalid in the Metal API because MTLTextureType2DArray is
imcompatible with MTLTextureType2DMultisample, even if the layer
count is 1.
MTLTextureType2DMultisampleArray is not supported until macOS 10.14
and iOS 14.0.
Further, the view type must match between the API and the shader.
a 2D view array requires texture2d_array in MSL.
It would be inconsistent to allow 1-layer 2D arrays which internally
get translated as (non-array) MTLTextureType2DMultisample. You would
expect to need to use texture2d_ms_array in the shader.
Change-Id: Ib9268c1276d3d31e90d6c61118e27fa2afd0617d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85200
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Disable the scissor test during clear.
Change-Id: Ia6945304c257867ed5cb6a6ae0c2c49998a33ca7
Bug: dawn:1340
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85143
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Addressing issues that showed up after the initial stencil8 CL landed.
D3D12:
- Selecting the `all` aspect of a `stencil8` texture was ASSERTing
Metal:
- Using the `stencil` aspect of a `stencil8` texture was hitting an
UNREACHABLE().
Bug: dawn:666
Change-Id: Ic2931dbb915e109727ca24e3216a661fba84e508
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85021
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Change-Id: Iee67027431d791d6425e0cc502f6b6a23bc160d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85141
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
glBlitFramebuffer() takes min and max coordinates, not min and size.
Bug: dawn:1084
Change-Id: I7b8b53ecd9c5ade20d4d7a909bd134c13a2d960b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85081
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Move texture allocation in an AllocateTexture() local.
Use the GL target to determine the choice of allocation call, not
the Dawn TextureDimension. This leaves TargetForTexture() and
TargetForTextureViewDimension() as the authorities on Dawn -> GL
conversion.
Change-Id: Ia31fbba9a8e71a9ce8dd9c89676dbc51d8848bb5
Bug: dawn:593
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
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>
On D3D12 backend, external texture holds mD3D11on12Resource which caches
D3D11on12Resources and guarding by refptr. The texture will released this ref
until destructor works.
This model leaks the gpu memory if client fails to release all the ref to
the texture.
Instead, external texture also provides a method called "Destroy". It is
called more eagerly and means the external texture is in the end of lifecycle.
So thid CL moves the ref reset of D3D11on12Resource into Destroy(). This prevents
unexpected gpu memory leak caused by client missing ref release call.
Bug: 1308405
Change-Id: I253e1eda192256e4bd1c470e26dcc6af3c234447
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
And reject the device creation promise with an error that looks like an
OperationError to make the CTS happy.
Bug: dawn:1242
Change-Id: I43ec3ebc030cb4178520c9174e164a42b94f6bf8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85060
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Now the message will report the details of both the expected and
incompatible attachment states, helping developers see what the source
of the error was.
Bug: dawn:563
Change-Id: I58eea166cb2da634f0295fb4660c982f96c62a2d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84940
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
External textures are handled purely in the frontend so there is no need
to update the backend BGL to handle them. The TODOs can just be removed.
Bug: dawn:728
Change-Id: I319cf2a79bdc06a1457f3ec5746b07b5d05eef62
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84767
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
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>
Should help make a couple of previously ambiguous error messages clearer
for developers.
Bug: dawn:1259
Change-Id: I09a4598153d3340407c5a318dcf6be6d03efd2bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84780
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Change-Id: I6210b192c0676dacecc0d0b1026905b31e869d72
Bug: dawn:593
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84440
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
To get vulkan-deps roll going
Bug: chromium:1310052
Change-Id: Ia47aa9a486256a9b3c96b90a66cd39bd2ec7c155
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84724
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
The condition was partially wrong, causing lots of spurious warning
messages when the default toggle (not user override) was forced to
another value by the backend.
Change-Id: Ie69e275fa3d4ceaeb7c3379dfdc8d8cbb91cf04a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84601
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
- Prepares for removal of unnecessary bool return, and just call callbacks appropriately. For now always returns true until all users are updated.
- Removes PushErrorScope from handwritten commands now that we no longer need to do anything special.
- Updates tests to reflect the change and make sure to set EXPECTs before calling functions to make tests easier to follow.
Bug: dawn:1324, dawn:526
Change-Id: I90b09c54f9adbf2d6d50ad20dcedf68b5ed0b1fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83942
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Avoid recreating 1x1x1 dummy textures for single-plane external texture
by just caching one and reusing it.
Bug: dawn:1082
Change-Id: Ia1fc3520a1b503d4491a256353277400ba90f344
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80462
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Support for @stride is about to removed from Tint.
Bug: tint:1381
Change-Id: I6e30ed67d61ab82fd50843caf14216274b1e05fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83960
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
- Adds generator infra for absl::StrFormat for bind group structs and types.
- Uses absl::ParsedFormat to avoid multiple parsing for format strings.
Bug: dawn:549
Change-Id: Ida4ca65eb85c4474c492161c8ae34f53bd692a3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81944
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Removes the validation logic that was blocking this copy from being
valid and update tests to ensure that it works properly.
Copy logic worked with this format as-is, so no updates were necessary.
Bug: dawn:1251
Change-Id: Id0ca503ed0f82e79e75f63ad6870389f7f647d22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81024
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
- 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>
Relax validation of last stride of vertex buffer according to the
updated spec.
Bug: dawn:1287
Change-Id: I7a58401933b48c5cb121ba73c592575ada3e7151
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83203
Auto-Submit: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
It is valid for depth/stencil attachment if the attachments are
readonly. It is not valid for color attachments. Make the enum valid,
and update validation.
Caught in CTS roll
https://chromium-review.googlesource.com/c/chromium/src/+/3499286
Bug: dawn:1269
Change-Id: Ib849ed757ccca145f85cadea6f92a1f2a5082d49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82540
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
We need to consider the real usage the texture was allocated as, not
the public API usage.
Fixes VVL violation in canvas_composite_alpha_bgra8_unorm_opaque_copy
CTS ref test.
Bug: chromium:1083478
Change-Id: I4461458f98750c1632b823536ff3846a9b31796b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83041
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch adds a toggle to enable/disable workgroup memory
initialization with OpConstantNull according to the Vulkan extension
VK_KHR_zero_initialize_workgroup_memory. This toggle is by default
enabled when VK_KHR_zero_initialize_workgroup_memory is supported by
the Vulkan driver.
BUG=dawn:1302
TEST=dawn_end2end_tests
Change-Id: Ie04484c2d0944ead082bd22a436b1c52bc7d93bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82400
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
The timestampWrites in render/compute pass descriptor store the
timestamps at the beginning and end of passes, this requires validating
all timestampWrite members in BeginXxxPass and inserting the
timestampWrite cmd as close as possible to the BeginXxxPass and
EndXxxPass. To do that, we first record only the querySets and
queryIndexes that need to be used in BeginXxxPassCmd and EndXxxPassCmd,
then insert timestampWrite cmd after the native BeginXxxPass and before
the native EndXxxPass in backends.
This CL adds timestampWrites in render/compute pass descriptor
including the validation and tests first.
Implement timestampWrites in backends in following CL.
Bug: dawn:1250
Change-Id: I39b50975aa03cc1afe7a736c3b39df284f54d163
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82100
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Bug: dawn:1123
Bug: dawn:1286
Change-Id: I3ffeea82fda381905ee8f02f9f2768c81c7e6d6d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79761
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Fixes vulkan validation layer assertions on Linux in CTS reftests:
canvas_complex_bgra8unorm_copy.https.html
canvas_size_different_with_back_buffer_size.https.html
Bug: chromium:1083478
Change-Id: I36580184d15fe36423e5f759eaf959191c6b571c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82480
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Current implmentation of ValidateCopyTextureForBrowser has a bug
to verify destination texture states.
This CL fix the simple bug and add noop copy in unittest to catch this
issue.
Bug: dawn:1306
Change-Id: I193105ced89db5092873d604c7dbf43d7ea4fba0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82101
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
The Mesa Gallium llvmpipe driver is a software rasterizer that uses LLVM
to do runtime code generation. It seems to put incorrect value for
maxFragmentCombinedOutputResources, like we see on desktop GPUs.
Some relative values are as below.
vkLimits.maxFragmentCombinedOutputResources: 8
kMaxColorAttachments: 8
baseLimits.v1.maxStorageTexturesPerShaderStage: 4
baseLimits.v1.maxStorageBuffersPerShaderStage: 8
This CL will skip the check of this limit on llvmpipe, like we did for
desktop GPUs.
BUG=dawn:1311
Change-Id: I1698f6e26dd62b56f3819980fa2dcc986c9c5ba3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81941
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch fixes a use-after-free issue in Create*PipelineAsyncTasks
that when pipeline->Initialize() returns error, the pipeline object
will be deleted, while we still attempt to call its member function
after it is deleted.
BUG=dawn:1310
TEST=dawn_unittests
Change-Id: I57d5ca98d6c97b14df1d7c3bf2941c9cc87adeff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81800
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch removes the support of multisampling on the below 4
formats as they are not renderable according to the discussions at
https://github.com/gpuweb/gpuweb/issues/2465.
- R8Snorm
- RG8Snorm
- RGBA8Snorm
- RG11B10Ufloat
BUG=chromium:1299154, dawn:1244
TEST=dawn_unittests
Change-Id: I3837f2aee322a71c90772322dc01fae410f03e57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81801
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
CopyTextureForBrowser() will support all uploading paths for WebGPU
CopyExternalImageToTexture(). The validation checks for texture states
should report accurate errors to meet CopyExternalImageToTexture() validate
rules.
Bug: dawn:1306
Change-Id: Ie3b25ec82246d53e6c82968b5dc2f8a253c560c1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81240
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Although the error rate of timestamp tick->ns conversion is very small
(3e-5), some profiling scenarios, such as CPU/GPU timestamp calibration
on Windows, require absolutely accurate timestamps.
Add new toggle to resolve timestamps to ticks for those cases where zero
error is required.
Add an end2end test for GPU timestamp calibration on D3D12 backend.
Disable timestamp period calculation on Device when the
DisableTimestampQueryConversion is enabled.
Bug: dawn:1305
Change-Id: I31ee6b4c1686d5dd2ac29ccb0bd398e650481c26
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81023
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
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>
This patch adds the validations on the format of a resolve target
according to the latest updates in WebGPU SPEC. WebGPU SPEC only
supports the below texture formats being used as the resolve target
of a render pass encoder:
- R8Unorm
- RG8Unorm
- RGBA8Unorm
- RGBA8UnormSrgb
- BGRA8Unorm
- BGRA8UnormSrgb
- R16Float
- RG16Float
- RGBA16Float
- RGB10A2Unorm
BUG=dawn:1244
TEST=dawn_unittests
Change-Id: I16f9c3984f4ffb4641f4f43ecdb3cc76be6a562a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81080
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Renames multiple attachment clear values to match their new names in the
spec, deprecating the old ones.
- GPURenderPassColorAttachment.clearColor -> clearValue
- GPURenderPassDepthStencilAttachment.clearDepth -> depthClearValue
- GPURenderPassDepthStencilAttachment.clearStencil -> stencilClearValue
Additionally, the old names are marked as deprecated with appropriate
warnings if they are used during the deprecation period.
Bug: dawn:1269
Change-Id: I6649184d65578118942c1f51a41f350719665272
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80941
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
The validation of CopyTextureForBrwoser() fails to valid src and dst
texture state. And a bug has been caught by cts
webgpu:api,validation,queue,copyToTexture,CopyExternalImageToTexture:destination_texture,state:*
after changing CopyExternalImageToTexture() to use CopyTextureForBroswer()
to upload CPU resource.
The CL fix this.
Bug: dawn:1306
Change-Id: Ie4cfd174dc9f54f6cf2099226c4e1cc00ed1d446
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80900
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Adds validation to ensure that external texture binding entries match
the bind group layout. This should fix an issue found by the fuzzer.
Bug: dawn:1082
Bug: chromium:1296935
Change-Id: I1cc542ed9105dbe29d775e01e52475a7d6c8d393
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80460
Reviewed-by: Loko Kung <lokokung@google.com>
Auto-Submit: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
1. The left cases will be not checked if the first value is 0 in Check
function.
2. All timestamps are the same value at initialization.
3. Update 83.33 to 83.333 which is closer to the actual period on Intel.
Bug: dawn:1250
Change-Id: I7378cf45453682a3d364b6930072ccc229085f0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80901
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch adds the validation on the texture format when we create
a texture with sample count > 1 according to the latest updates in
WebGPU SPEC.
Below formats can't be used to create a multisampled texture:
- R32Uint, R32Sint, RG32Uint, RG32Sint, RG32Float, RGBA32Uint,
RGBA32Uint, RGBA32Sint, RGBA32Float
- All compressed formats
- RGB9E5UFloat
BUG=dawn:1244
TEST=dawn_unittests
Change-Id: I71743281ce12158be4b1904732934fad95f39cee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80240
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Only SwiftShader would be available on Mac.
Bug: chromium:1297154
Change-Id: I943a39dfdde4215ba0ea880bf08294f37f08ee42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80720
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
The syntax for pipeline-overridable constants has changed in
WGSL. Since this feature is still hidden behind the
disallow-unsafe-APIs flag in Dawn, we removed support for the old
syntax in Tint. This commit rolls Tint forward to get that change, and
updates the WGSL syntax in affected tests at the same time.
Bug: tint:1403
Change-Id: I1d081d9dea0c1de9def5cd123020700df3419f35
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80500
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
- Don't use for..in since some crashes show that NSFastEnumeration
in those loops is doing something wrong.
- Check that the receiver actually supports the selector before
calling it. Crashes indicate an unrecognized selector is being
used.
- Add a ref to MTLCounterSet to be sure it is not somehow freed
between when it is stored, and when we use it as the receiver for
[MTLCounterSet counters].
Bug: dawn:1102
Change-Id: I882045ba09547df62a98a862e6e64c5a7d656e80
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80461
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
When shader-visible heap switch happens, we re-populate all bindgroups
and change the descriptor heaps, which need to reset root descriptor
tables, but for the samplers which are cached in
mBoundRootSamplerTables and not changed, they won't be reset, which make
shaders cannot access the sampler heaps.
Bug: dawn:1255
Change-Id: Icc142206121af9daf8b9352b4c639f7d7ef8f1d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/76780
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
Begins including the expected BindGroupLayout in validation messages
where a BindGroup descriptor does not match the BindGroupLayout. This
is especially helpful in cases where the BindGroupLayout was implicitly
created by the pipeline.
Bug: dawn:1258
Change-Id: Icbf27b4a2ac9b4dc1716feed47e3e63cf99929a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80380
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
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>
Change-Id: Ibced679fa6568f1eb33707f0157d03505e6f8a1c
Bug: dawn:1263
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67540
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Removes an unused tint::Transform::Manager that was accidentally merged
as part of commit "Integrate Multiplanar External Texture Transform".
Bug: dawn:1082
Change-Id: I55b5eec8b17f27df22658a90912dec4d6d583cbb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80100
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Introduces the majority of the logic associated with enabling
multiplanar external textures. Removes most backend logic associated
with external textures in favor of expanding them into their components
in the frontend. Includes a basic e2e test demonstrating multiplanar
YUV-to-RGB conversion.
Bug: dawn:1082
Change-Id: Ib5c042e5639b1a8efe2954680abc346c8c6c76d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78248
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
This patch skips setting the items for dynamic storage buffer lengths
in root signatures when there is no dynamic storage buffer in the
pipeline layout so that we can avoid adding a root constant with
Num32BitValues == 0 in the root signature.
BUG=dawn:1262
Change-Id: I7d698425c94092299aefaf8cb6ef465745c8d194
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79742
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Bug: dawn:545
Change-Id: I7cb48813e0a582a6b7314c6fa726800b146ea6be
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79243
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Promote up some build rules from the root CMakeLists.txt file that are
specific to Dawn.
Bug: dawn:1275
Change-Id: I11e9261ac595f6d71742b20d54dc658a5fa7e996
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79105
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This has already been moved once, but with more consideration, there's far less fuzzer-related stuff to put in the same root directory here.
Bug: dawn:1275
Change-Id: Ic4bb556d9a9f104293cca3316cae84b66a6362b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79104
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Also remove stuttering from the target names by dropping the 'dawn_' prefix.
Bug: dawn:1275
Change-Id: I3263f1236f71bf23795b4b12670ad3535822a537
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79062
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Also remove stuttering from the target names by dropping the 'dawn_' prefix.
Bug: dawn:1275
Change-Id: Iac79f9927010b8e5edeb7e0949092b34431d54dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79061
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Adds a "tag" system so that entries of dawn.json can be conditionally
emitted in different configurations. With a few more dawn.json changes,
this will enable generating the exact upstream header.
Bug: dawn:1080
Change-Id: I3506dadd485e31786578a3a64c3603c964c5354f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62580
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This is a header-only utility so it can be easily included and
used anyhere. Include it in DawnTest.h to automatically pick up
definitions to print test parameters.
Also, work around bot limitations for very-long test names.
Bug: none
Change-Id: I940263ab0a4cc415b06fa04749694f16ff08335c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51841
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This is a reland of b04a92f01b
with the deletion of a duplicate exported function in dawn_wire that
was causing a compilation failure on Windows.
Original change's description:
> Add a per-thread proc table using thread local storage
>
> In situations where both dawn_wire and dawn_native are used on separate
> threads (Chrome with --single-process or --in-process-gpu), it's
> desirable to have a per-thread proc table so that the WebGPU C++ API can
> still be used. This eliminates classes of bugs with manual
> reference/release errors.
>
> This also changes many of the GetProcs functions to return const
> references to the static proc tables known at compile time, instead of a
> copy.
>
> Bug: none
> Change-Id: I8775bb715b312dd9476a1903fbd797d4b1302614
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29240
> Reviewed-by: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
Bug: none
Change-Id: Id90e5372132cd93a2f8631c8185d0e71b01bc1af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29443
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This reverts commit b04a92f01b.
Reason for revert: Build failed on win-archive-dbg; see:
https://chromium-review.googlesource.com/c/chromium/src/+/2450792
Original change's description:
> Add a per-thread proc table using thread local storage
>
> In situations where both dawn_wire and dawn_native are used on separate
> threads (Chrome with --single-process or --in-process-gpu), it's
> desirable to have a per-thread proc table so that the WebGPU C++ API can
> still be used. This eliminates classes of bugs with manual
> reference/release errors.
>
> This also changes many of the GetProcs functions to return const
> references to the static proc tables known at compile time, instead of a
> copy.
>
> Bug: none
> Change-Id: I8775bb715b312dd9476a1903fbd797d4b1302614
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29240
> Reviewed-by: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
TBR=cwallez@chromium.org,senorblanco@chromium.org,enga@chromium.org
Change-Id: I4587b457b7b2dd5d3c7457065bf4e77b95af59d7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29442
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
In situations where both dawn_wire and dawn_native are used on separate
threads (Chrome with --single-process or --in-process-gpu), it's
desirable to have a per-thread proc table so that the WebGPU C++ API can
still be used. This eliminates classes of bugs with manual
reference/release errors.
This also changes many of the GetProcs functions to return const
references to the static proc tables known at compile time, instead of a
copy.
Bug: none
Change-Id: I8775bb715b312dd9476a1903fbd797d4b1302614
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29240
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Convention in CMake land is that libraries default to STATIC or
SHARED based on BUILD_SHARED_LIBS. Do that for Dawn components
that users will link against, but make sure to correctly set
macros used for the export headers.
Bug: None
Change-Id: I6a96cb95706b63c18942424baada11ff81691866
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28503
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Done by:
- Appending an extra newline at the end of src/**/*.{cpp,h,mm,gn}
except src/tests/*
- Running git cl format --full to format the full contents of every
changed file
Bug: none
Change-Id: Id88fc5ed0c5efbbc93b2c6a305c2f98465fe646d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24641
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
It also changes remaining deps for internal targets
from libdawn_proc to dawn_proc.
Bug: chromium:1064305
Change-Id: I36df2b5d7793be9d6c878b6a1f2ec238603a8205
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19289
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
When the libdawn_native target was renamed to dawn_native, the output
library name stayed the same (GN inserts a lib prefix if it isn't
present) but the @rpath annotation changed to be just dawn_native.dylib.
Fix this by adding the lib prefix in the rpath annotation. This requires
changing libdawn_proc to dawn_proc otherwise the rpath annotation would
be liblibdawn_proc.dylib.
Bug: dawn:380
Change-Id: Id8610a6318af3468dcc486ee8d3c035f0273fe0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19200
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Headers only INTERFACE library with generated headers don't work in CMake
because the GENERATED property is local to a directory. Instead we make a
STATIC library with a Dummy cpp file.
INTERFACE libraries can only have INTERFACE sources so the sources get added
to the dependant's list of sources. If these dependents are in another
directory, they don't see the GENERATED property and fail to configure
because the file doesn't exist on disk.
Use this trick for both dawn_headers and dawncpp_headers that are header
only libraries with generated headers.
Bug: dawn:333
Change-Id: Ib0d6dcc5f351a638d1c5360214c0ce14a28fee3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15921
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Adds CMake support for:
- Generating the Dawn headers and C++ wrappers
- libdawn_wire
- libdawn_native with the Metal backend for now
- All the examples.
Bug: dawn:333
Change-Id: I6ffbe090b0bd21d6a805c03a507ad51fda0275ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15720
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
webgpu.h is the "official" header for WebGPU in native and is being
developed in https://github.com/webgpu-native/webgpu-headers
dawn.h and dawncpp.h are changed to become webgpu.h and webgpu_cpp.h
respectively and use the new naming convention. New dawn.h and dawncpp.h
headers are created that just proxy the types, constants and functions
to their WebGPU counterpart.
Almost no naming change is done in Dawn in this commit, which help check
that the proxying headers work correctly. A couple changes were
necessary, in particular for tests of the internal of dawncpp.h, and a
workaround for a standard library bug for std::underlying_type was
removed because it is no longer needed and got in the way.
Finally since some templates were renamed to match the name of the file
they create instead of using the generic "api" name.
BUG=dawn:22
Change-Id: I12ee22d0b02ccb5b8a52ceccabb3e63ce74da007
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12480
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
libdawn_native also requires the dawncpp headers. When we separated
libdawn_cpp from the dawn_headers, libdawn_native lost the cpp headers
and caused a compile failure. This patch separates the dawncpp headers
as a separate target so both libdawncpp and libdawn_native can depend
on them.
Bug: dawn:22
Change-Id: I4172f1654377afac8c4314123ee8b5b81dc7c928
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12300
Reviewed-by: David Turner <digit@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The functionality of the dawn_headers and libdawn targets are split into
the following targets:
- dawn_headers: the new version only exposes the "dawn.h" C API and no
longer includes the C++ API.
- dawncpp: the header and implementation of the C++ API that wraps the
C API. This is unbundled from the rest so the C++ API can be used
with libdawn_proc or other libraries implementing the C API.
- libdawn_proc: A DawnProcTable-backend implementation of the C API.
This is needed because in follow-up commit there will be three libraries
implementing the C API: libdawn_proc that trampolines where we want, and
libdawn_native/wire that don't have trampolines for better perf.
BUG=dawn:22
Change-Id: I5d941f0d98e5a4b633e14d67eb5269f7924f0647
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12160
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This normalizes even more the directory structure of generated files in
Dawn and removes stale autogenerated files that could be included
wrongly using a GN action.
See comment on top of dawn_generator.gni in this commit for more
context.
BUG=dawn:22
Change-Id: I8ec038f949c048431b2b643af4462f98c4ae610b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11361
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Previously dawn_native files were in src/dawn_native/ while generated
files were in dawn_native/. This makes some things complicated when
integrating in other source trees so normalize all generated files to be
in paths that match the main tree.
BUG=dawn:225
Change-Id: I5b3e04d37a16251143578dfb7a31445b229fe4ac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11300
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This merges all the files for main.py together again except
generator_lib.py because there doesn't seeem to be a good way to
separate the pure dawn.json generators and the dawn wire generator.
Also updates the GN templates to make it easier to define new generators
based on generator_lib, and move the Jinja2 template "stdlib" to
generator_lib.py
BUG=dawn:165
Change-Id: I1b5b2ef0a59cb142e214f3af9a58048a88ae949a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7880
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
The public include dirs for Dawn were in the dawn_public config but it
would only be added to targets as a part of public_configs. This meant
that second-level dependencies that ended up needing to include
dawn/dawn.h wouldn't know where to find it.
Fixed this by adding include dirs in all_dependent_configs and renamed
the config to be very explicit that it is for include dirs only.
BUG=chromium:938895
Change-Id: Iad70f3ce1f8a02b96bf341e7dd7d6068ce645af7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5920
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This adds an option to dawn_generator to generate files in a different
directory so the generated stay at the same place. Otherwise compilation
errors occur because of stale versions of the headers on the CQ
builders.
BUG=dawn:61
Change-Id: I71ceb3172b5a4e35911973a03be29d90fa684416
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5304
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>