Reduces the extent to which programs with unparsable expressions are
generated by limiting the recursion depth allowed for wrapping unary
operators. Also updates some nested namespaces to use more modern C++.
Change-Id: I4637c20c9c72c6b315c04c9322d069f0e35859b3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85580
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Alastair Donaldson <afdx@google.com>
Auto-Submit: Alastair Donaldson <afdx@google.com>
With this change, the backend sanitizers always run the
MultiplanarExternalTexture transform. If the new option is enabled, it
auto-generates bindings for this transform.
This change also enables this auto-generation for the Tint commandline
application, as well as for the fuzzers.
Bug: chromium:1310623
Change-Id: I3c661c4753dc67c0212051d09024cbeda3939f8c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85542
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
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>
Bug: dawn:549
Change-Id: I75ab6eb0273ddcb2dc571d5c91d35422793fdffc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85745
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Textures as function parameters should not have the "uniform"
qualifier. Fixed by handling StorageClass::kUniformConstant the
same as StorageClass::kUniform, and removing the unconditional
"uniform" qualifier output. (Global texture variables have
StorageClass::kUniformConstant set, while function parameters don't.)
Change-Id: I9d380550ac4554917527ff330171a76a90a290e8
Bug: tint:1492
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85820
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
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>
SwiftShader now uses an independent build of SPIRV-Tools dependencies,
like in other environments.
Bug: b/158002593
Change-Id: I2149b99fc4b4f615c77c589ae9e5eb880f37feb6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85660
Auto-Submit: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
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>
Provides a type to represent the CTS query strings.
100% test coverage.
Bug: dawn:1342
Change-Id: I3769b094ba64221a7b79dd38f76daf0125ee9e28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85221
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Counts the size of expressions in the AST to avoid applying unary
wrapping to expressions that have already gotten large.
Change-Id: I0868d6f2bb3c6aaf99efdfb9574327d0af420456
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/84900
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Alastair Donaldson <afdx@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Alastair Donaldson <afdx@google.com>