This CL add Instance and Adapter toggle stage, and promote
DisallowUnsafeAPIs as an instance toggle, and can be required using
DawnTogglesDescriptor chained in instance descriptor when creating
instance. The instance's toggles state will get inherited to adapters
and devices it create. Related tests are implemented and updated.
Toggles inheritance can be overriden if not forced, so requiring
DisallowUnsafeAPIs when creating device is still available and working
like before.
Note that currently we don't have toggle of adapter stage, and can not
require toggles when creating adapter, until follow up CLs implement it.
Currently the toggles state of a adapter is simply inherited from
instance.
Bug: dawn:1495
Change-Id: I6bf7aa0f950a99451afcc2cab5322c924b7d9520
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122021
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch uses VK_QUEUE_FAMILY_IGNORED on buffer barriers to align
with what we are doing on image barriers.
Bug: dawn:1688
Change-Id: Icabae22270fc9c92a69ce18e0a63db49de9d7481
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122444
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
There are some scenarios where buffers can be used in pending
commands that are not retained by a command buffer.
They must be retained in the set of mappable buffers for eager
transition to prevent a use-after-free violation.
Fixed: chromium:1421170
Change-Id: I452d80b2513a7726a003d44e2a7850292d798bb1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122580
Auto-Submit: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
This change overhauls the Robustness transform to support three modes,
per address space:
* ignore - Disable robustness checks for the address space
* clamp - Clamp indices / texture args to ensure they're in
bounds. This was the old behavior, and continues to
be the default.
* predicate - Condition all indexing / textureLoad / textureStore /
atomic* operations on the bounds check. If any
dependent value is out of bounds, then the operation
is skipped.
This change also fixes multiple expression evaluation of the texture
builtin 'level' argument.
Change-Id: I2e300ddff2c8d3183a9701f06985ce1b262baf2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122343
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This reverts commit a753ad47a4.
Reason for revert: This seems to be breaking `gn check` when the option is not enabled. Not sure why the preprocessor guard isn't working. Will fix and reland later.
Original change's description:
> Add writer to emit the AST.
>
> This CL adds a new `SyntaxTree` writer and a `dump-syntax-tree` option
> to the `tint` program which emits a copy of the AST to the terminal.
>
> Change-Id: I83f6cd7aad3413b0a823728e8aac0d551421b33a
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122540
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>
TBR=dsinclair@chromium.org,bclayton@google.com,noreply+kokoro@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Icaac76f8daba6034658cf05e15f15676ce2bf155
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122760
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This CL updates the lexer to use `std::from_chars` which is locale
independent over `strtoll` which honours locale.
Bug: tint:1686
Change-Id: Ic773038fffaa9e2042dec9d94e310c73d05180b8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122603
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Currently in the middle of some functions, we execute callbacks
immediately such as inside Buffer::APIMapAsync(), Device::HandleError()
or Queue::Submit().
Firstly, this has risks. The functions might be in a middle of modifying
internal states. By triggering callbacks, users might call API
functions again which could further modify the internal states
unexpectedly or access the states in an inconsistent way.
Secondly, upcoming thread safe API which locks the public functions with
a mutex might encounter deadlock. Because callbacks might cause
re-entrances which would unexpectedly lock the public function again.
This CL attempts to limit number of functions that are allowed to
trigger callbacks. Other functions that want to trigger callbacks will
instead enqueue a request to execute callbacks in the next
Device::APITick() call.
Currently the functions that will be allowed to trigger callbacks are:
- Device::WillDropLastExternalRef()
- Device::APITick()
- Device::APISetLoggingCallback()
- Device::APISetUncapturedErrorCallback()
- Device::APISetDeviceLostCallback()
Bug: dawn:1672
Change-Id: Iabca00f1b6f8f69eb5e966ffaa43dda5ae20fa8b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120940
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
It appears that FXC and DXC do some validation post dead-code-elimination.
These tests have been updated so that the return value is assigned to a storage buffer, ensuring that all validation is performed.
Many DXC tests are affected by https://github.com/microsoft/DirectXShaderCompiler/issues/5082, which have been SKIP'ed.
Fixed: tint:1859
Change-Id: I0001a9a9821846cd0855c3d8ce2bec79ab8e64ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122662
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
This CL adds a new `SyntaxTree` writer and a `dump-syntax-tree` option
to the `tint` program which emits a copy of the AST to the terminal.
Change-Id: I83f6cd7aad3413b0a823728e8aac0d551421b33a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122540
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Recent changes to DecomposeMemoryAccess meant we lost the dependency information between the user of a module-scope variable of the storage / uniform address space and the variable.
Add dependency information to ast::InternalAttribute so this can be tracked.
This change also means that symbol renaming after the DecomposeMemoryAccess should work.
Fixed: tint:1860
Change-Id: Icfa2925f95c2ac50702522df514cd11bde727546
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122660
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Also now works on windows (assuming bash is the main terminal) - still better than a TODO
Change-Id: I817143bb1c0dc95346dcf2c23f115c35a55349e5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122522
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
The texture_storage_3d overload should allow for unsigned coordinates.
Change-Id: I6278571fb9dc7bba644a4ba88cce6b8bd7c790bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122521
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Print the input program, and the output of each run transform.
Significantly reduces stdout spam, and also shows you transform input - which is what you really want.
Issue: tint:1853
Change-Id: Iaea0dc16de63daffcf0b0c715af14d194b700468
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122480
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This does not belong in the public header - the spirv writer public header does not depend on it.
Change-Id: Id1b2107c3a2003632e1868c2d6a337ddbb0c8b48
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122382
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Regenerated:
- expectations.txt
- ts_sources.txt
- test_list.txt
- cache_list.txt
- resource_files.txt
- webtest .html files
6e39b5d2f2..0557875f39
- 055787 Update external_texture,expire test case (#2283)
- dcfa5b Removes OOM errors in error scope tests since we can't cause OOM. (#2331)
- 534e6b Rename to GPUShaderModule.getCompilationInfo() (#2291)
- 9d8e1a Depend on github.com/gpuweb/types instead of npm @webgpu/types (#2332)
- 4505a1 Updates BGL sampleType when using multisampling for validation errors. (#2329)
- 716bd3 Prompt for reload only if this is the full CTS (#2318)
- 267cb4 Test minStorageBufferOffsetAlignment and minUniformBufferOffsetAlignment
- 6b70b1 Refactor limit_utils.ts so we can test more limits
- 1713e6 OperationError -> GPUPipelineError
- bf1b1e Fix WGSL warning for maxStorageTexturesPerShaderStage.spec.ts
- 07c420 Validate maxColorAttachments and maxColorAttachmentsBytesPerSample
- 5bd2ce Refactor limit_utils.ts so we can test more limits
- 6b9071 Test maxInterStageShaderComponents and maxInterStageShaderVariables
- 539f8f Test maxDynamic(Uniform|Storage)BuffersPerPipelineLayout
- 762133 Convert more OperationError to GPUPipelineError. (#2314)
Created with './tools/run cts roll'
Change-Id: Ic8c9d2ad9391bbb2fa0bed667f2e4167bf45c86b
Cq-Include-Trybots: luci.chromium.try:dawn-try-win10-x86-rel,linux-dawn-rel,mac-dawn-rel,win-dawn-rel
Include-Ci-Only-Tests: true
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122420
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
- Note the duplication (in LIMITS_MAX_BUFFER_SIZE and LIMITS_OTHER)
caused tiering to be overridden.
- Also updated binding size test to align buffer sizes properly since
the test was failing locally for me.
Fixes: dawn:1683
Change-Id: I8d05f863ea9bf4dc8e620b7803bedb913af9f67b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122260
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This CL updates the templates in the StringStream to match more types.
All of the internal `operator<<` methods have been converted over to
StringStream. The precision was increased in order to better match the
precision needed to read back as a double.
Bug: tint:1686
Change-Id: Iaa15cf247f174967dd1014647ba5a74804997c22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122080
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
There's no good reason for this to be public.
Move it into the writers, and expose a 'disable_robustness' option to
turn it off. This can be expanded to hold more fine-grain control in the
future.
Change-Id: I6ea6e54a27b2ae0fbcba5fdf45539063045cc15a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122203
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Convenience overload to return ast::IndexAccessorExpression instead of ast::Expression
Change-Id: Ib239fd6d5742425a629fc76e1b564a3c7781ca2a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122342
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
instead of silently being a no-op on second call.
This allows for repeated updates of a node's mapping, which is useful
for immediate-mode style cloning.
Change-Id: I6bd2851cbe67d3886d37cefc3ef9de488d4b0878
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122300
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Handles statement replacement of for-loop initializer and continuing
statements.
Change-Id: I83ddf6fbd9b19f5022f7b02d7aebcbd95ab4c1f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122302
Kokoro: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Prevents an ICE.
I had this trigger, but I'm now struggling to find a reproduction.
Only used to print a diagnostic when things go wrong.
Change-Id: Iab78c3bcaaf1afb2f556247f8a419f93a727ec96
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122341
Kokoro: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
When using HoistToDeclBefore on a for-loop initializer, the inserted
statement would be scoped outside the for-loop. This was incorrect.
Change-Id: I764d07068e907cc203145ac8d6f0110b1b73e667
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122301
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This change makes it harder to misuse ConsumedError which can cause
device loss. When it is a known error, instead use HandleError to
bypass the "unlikely" if clause.
Bug: dawn:1336
Change-Id: I3052db343fe4080b257f1c2f9535f743a0e78526
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120384
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Note that we can just log these errors and avoid bubbling them up since
cache creation failure should not be fatal in Vulkan.
Bug: dawn:1336
Change-Id: Ie49d433f9b991508859f4969f2d4bf3b7c9e66d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122024
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Most suppressions where ok, but some needed to be expanded to cover all
configurations. Which this CL does.
Bug: chromium:1417269
Change-Id: Iad223e5cff31f8691c9131bec763f281df46bded
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122041
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
It was renamed to wgpu::TextureSampleType in the spec but the enum is
still used in some parts of dawn::native. Tag the enum as internal for
now until we can change Format.h and friends to no longer require the
enum.
Bug: dawn:1682
Change-Id: I673353ff290495777ed1618810daa011b450dff5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122122
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
This commit makes depthWriteEnabled and depthCompare required and
makes depthClearValue conditionally required for the spec change
in WebGPU V1.
https://github.com/gpuweb/gpuweb/pull/3849
depthClearValue is required if depthLoadOp is clear and the
attachment has a depth aspect. To simulate it, this commit lets
NAN represent unspecified depthClearValue and lets the default
value of depthClearValue be NAN.
Bug: dawn:1669
Change-Id: I469338e909b1d3c345bc2642ee47daee858909ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120620
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>