Commit Graph

8318 Commits

Author SHA1 Message Date
Ben Clayton a36fa42dd7 tint/cmd: Use correct preprocessor guard for libspriv.hpp
This header is used by TINT_BUILD_SPV_READER not TINT_BUILD_SPV_WRITER

Change-Id: Ia42e4f2bf2ad37f426d2bf14e962abed9de147a9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122520
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-09 23:46:59 +00:00
Ben Clayton 574b4b1996 tint: Fix constant::Splat conversion of struct types
Conversion can happen for structure materialization (modf, frexp).
If both structure members are the same type and value, then a constant::Splat will be constructed, which needs to handle conversion.

Bug: chromium:1417515
Change-Id: Iadd14ce00b8d5c22226c601ec5af9a84e6c0c5cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122900
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-03-09 23:22:27 +00:00
Stephen White cc2e9eca1a Vulkan: skip a test that's failing with newer VVL.
Bug: dawn:1696
Change-Id: Ie14e3d124342228edef17a122f380e2bdfaf1e57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123502
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Auto-Submit: Stephen White <senorblanco@chromium.org>
Reviewed-by: dan sinclair <dsinclair@google.com>
2023-03-09 22:59:38 +00:00
Ben Clayton 7972a10aa8 tint: Add missing include
Should fix dawn -> chromium roll

Change-Id: If4bf1ed6795dc55c4c5a45e8ba8fa2eb0da7270a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123521
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@google.com>
2023-03-09 21:33:13 +00:00
Ben Clayton cc3f851ad8 tint/transform: Polyfill f32 conversion to i32 or u32
And vectors of those types.

Fixed: tint:1866
Change-Id: Ic0b5061232c5eb5a67d43dde1cd9599c580f4388
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123201
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
2023-03-09 21:26:12 +00:00
Ben Clayton f1f56b2d3c tint/writer/glsl: Set default precision to highp
WGSL states that `f32` is a IEEE-754 binary32. mediump precision guarantees are much smaller than highp, and using mediump can break code generated by tint.

Change-Id: I8a129c4c8ac078c785e0d5d7d21f19ed6b3620b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123400
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2023-03-09 19:58:23 +00:00
Ben Clayton 4fea9d0fbb tint: Implement Switch() without recursion
This removes the number of function calls made in non-optimized builds.

Reduces the optimized, all-features-enabled 'tint' executable size by
about 1%.

This change removes the bloom filter optimizations which provided
substantial performance gains with the old recursive implementation,
however this still appears to be ~1% faster than the optimized version.

Change-Id: Ic2bb82e9182459e37907f9e0d0b4771bde218f9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123440
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
2023-03-09 18:24:19 +00:00
Ben Clayton 23946b3606 tint: Move Switch() to own header
castable.h is bigger than it needs to be, and pretty much every tint .cc file includes castable.h
Reduce the amount of code that .cc files that don't use Switch() need to compile.

Change-Id: Ibb4e8b0bc7104ad33a7f2f39587c7d9e749fee97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123401
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-03-09 16:50:19 +00:00
dan sinclair 9543f74739 Move sem::BuiltinType to builtin::Function.
This CL moves `sem::BuiltinType` to `builtin::Function`. This makes it
available for use in the IR. The `Function` name better maps to the
usage in that it contains the builtin functions.

Bug: tint:1834
Change-Id: Ic1a26525d7845d79eb6239bdeb2b73e05f586c24
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122606
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-03-09 01:20:16 +00:00
dan sinclair 03ee23ea9e [ir] Convert materialized nodes to constants
This CL updates the IR builder to convert materialized call expressions
directly into the resulting constant values.

Bug: tint:1718
Change-Id: I184478996afdd11b00ca946775eab6801b777f3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122605
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-03-08 23:22:27 +00:00
Loko Kung af4ca3891f Update maxFragmentCombinedOutputResources on the different backends.
- Adds an e2e test to test writing to outputs when at the limit.

Bug: dawn:1665
Change-Id: I2b2b9c2d700be0e454dc945ed8e3e1fe6b191974
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122801
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-08 22:38:40 +00:00
Ben Clayton 2657b923c9 tint/writer/glsl: Fix vector `select`
mix of ivec is not core until later GLSL versions.
Just polyfill in the writer with ternary ops.

Change-Id: Ia0c35bf95842e03ef8447019f3264d01c11fd384
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123240
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
2023-03-08 22:29:38 +00:00
Ben Clayton da353b4b39 tint: Flip evaluation order of assignment statements
Evaluate the LHS before the RHS.

Fixed: tint:1867
Change-Id: Ib63903ed4b1425007197a6da37f3bf54a495d88a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123120
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-08 21:48:45 +00:00
dan sinclair 43c5efa7e8 [ir] Add error helper to ir builder.
This CL adds a `add_error` to the IR builder.

Bug: tint:1718
Change-Id: Ifd7a2f6e015d423dbe23405816dba00f237a6c8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122602
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-03-08 21:22:47 +00:00
dan sinclair 724a70f7a1 [ir] Add user functions, value constructors and value converters
This CL adds user function calls, value constructors and value
converters into the IR.

Bug: tint:1718
Change-Id: Iab59aa7d01b9d7831299d785f6e45e9fba12f7b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122600
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-08 21:19:13 +00:00
Ben Clayton 51be3420b8 tint/writer/glsl: Fix emission of lowest i32 value
GLSL has the same behavior as MSL, in that -2147483648 is parsed as
a unary minus on '2147483648'. 2147483648 overflows an i32, so this
actually gets treated as -0.

Change-Id: Ibebd8b78a8840f18c438ed1d3d24dee486a65816
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123202
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-08 21:13:22 +00:00
Ben Clayton ce2578bc99 tint/transform: Refactor BuiltinPolyfill transform
Move the bulk of the logic into the State class.
Reduces deep indentation, and likely improves performance by reducing the number of variable that require lambda capture.

Change-Id: I85c87298157f34645d0ae064439bb640f7af7c80
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123200
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-03-08 19:40:09 +00:00
Antonio Maiorano 22895dbe40 Add end2end tests for compute flow control
This replicates a subset of the flow control CTS tests. The purpose of
this is to provide relatively easy-to-repro cases to demonstrate flow
control bugs on Intel Graphics UHD 630 GPUs.

Bug: tint:1868
Change-Id: I34d692230b44d8a0a917dc773cc748bbf288d55a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2023-03-08 18:23:51 +00:00
dan sinclair eebbdef81a Split `BindingPoint` out of MultiplanarExternalTexture.
This CL moves the `using` statement for `BindingPoint` out to its own
file in `src/tint/writer/binding_point.h`. Usages of
`tint::transform::BindingPoint` have been updated to
`tint::writer::BindingPoint`.

Bug: tint:1855
Change-Id: Ife7d92807e0a65b93f21158d73a60d5068fc5da9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123000
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-03-08 02:48:42 +00:00
Ben Clayton 068eb3ebda tint: Fix HLSL texture queries and re-add textureNumLayers()
... overloads for texture cube arrays

FXC is telling porkies, when it says "The array element count
of GetDimensions on TextureCubeArray objects is unavailable
on ps_5_1".

The actual issue, as identified by Teodor Tanasoaia at Mozilla,
is that the argument needs to be unsigned.

In fact, *all* the texture queries should have used an unsigned
scalar or vector for the output value. This has been broken
forever!

This reverts commit bd9f6e6684.

Change-Id: I3e217bec17c6fd203cff618b143ebef3d8a61927
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122980
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-03-08 02:48:34 +00:00
Loko Kung 4f98dd4706 Add maxFragmentCombinedOutputResources and validation for it.
- Suppresses maxStorageTexturesPerShaderStage CTS test because it needs
  to be modified to adhere to the new limit as well.

Bug: dawn:1665
Change-Id: I66c62bd94b613059633888210ec7e7b42dc3a1dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122461
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-08 02:45:50 +00:00
dan sinclair 0917fbb147 Reland "Add writer to emit the AST."
This reverts commit 5e56551551.

Change-Id: I2c3da583090ebef87cc71a743746d741345847c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122782
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-03-07 18:28:38 +00:00
dan sinclair 2fe7f19026 Use `absl::from_chars` instead of `strtod`
This CL switches Tint to use `absl::from_chars` instead of `strtod` in
order to have locale independent parsing of floats.

Bug: tint:1686
Change-Id: Icb3d9a40928a1cb154b32629f7e39173d80e4563
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122780
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-03-07 18:20:23 +00:00
dan sinclair 64196ad60a Add array length options header to `tint.h`.
The `array_length_from_uniform_options.h` is being included directly by
Dawn. This CL moves the include to the `tint.h` file and has the dawn
usage include that instead.

Change-Id: Iaa77d76bc62fe5038f5b6b93d51478ceed85ac9e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122781
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-03-07 16:51:01 +00:00
Austin Eng 142bddf7da Fix #ifdefs for spvtools
Change-Id: I76d8d983e44e04be4abfbb25678cab8d926fbd6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122840
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-03-07 09:27:45 +00:00
Austin Eng f244bffdd5 Fix build of tint_cmd_helper
spvtools_headers are not available without tint_build_spv_writer

Change-Id: If4539715b0e685c9b54bf24719a905fb0265a402
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122820
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-03-07 02:41:45 +00:00
Zhaoming Jiang c2657b21d5 Dawn: Promote DisallowUnsafeAPIs as instance toggle
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>
2023-03-07 02:03:54 +00:00
Jiawei Shao e5ca66806f Vulkan: Use VK_QUEUE_FAMILY_IGNORED on buffer barriers
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>
2023-03-07 00:43:08 +00:00
Austin Eng aaae3ffada Vulkan: make mappableBuffersForEagerTransition ref buffers
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>
2023-03-06 22:09:26 +00:00
Ben Clayton 8525ff29da tint/transform/robustness: Implement predicated mode
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>
2023-03-06 21:05:01 +00:00
Dan Sinclair 5e56551551 Revert "Add writer to emit the AST."
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>
2023-03-06 20:30:23 +00:00
dan sinclair 5ab2928f6a Convert `strtoll` to use `std::from_chars`.
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>
2023-03-06 20:21:52 +00:00
Le Hoang Quyen 8ab7dbe424 DawnNative: Defer callbacks' triggerings to APITick().
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>
2023-03-06 19:03:26 +00:00
dan sinclair a753ad47a4 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>
2023-03-06 17:48:33 +00:00
Ben Clayton 63d0fabeb1 tint: Fix HLSL emission for out-of-order storage / uniform buffers
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>
2023-03-06 15:43:16 +00:00
Ben Clayton fd387a37c3 tint: Fix WGSL emission of const_assert
Fixed: tint:1858
Change-Id: I5cd2fc4d7dc0a9a0bd48330366a99dd726e42659
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122661
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-03-06 14:03:08 +00:00
Ben Clayton bd9f6e6684 tint: Remove textureNumLayers() overloads for texture cube arrays
These are not supported in HLSL shader model 5.1

See: https://github.com/gpuweb/gpuweb/issues/3913
Change-Id: Ic33666ff910f04e3f561cbc40c9db14c5de59284
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122524
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-03-04 00:55:16 +00:00
Ben Clayton 3a431d71be tint/intrinsics.def: Fix textureStore overload
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>
2023-03-04 00:43:21 +00:00
Ben Clayton 472815d3c1 tint: Fix build on windows + cmake
Change-Id: Id24e6c27a00700123e1677585ff7759c0bbcfe07
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122523
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-03-04 00:15:24 +00:00
Ben Clayton 67e1de42c2 tint/transform: Reduce verbosity of TINT_PRINT_PROGRAM_FOR_EACH_TRANSFORM
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>
2023-03-03 18:38:38 +00:00
Marshall Greenblatt 1fb13a7fd4 win: assert non-empty $windows_sdk_version
BUG=chromium:1420723
Change-Id: I90c248bb7ad89b6def9782af41e5ec04a99adea7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122440
Commit-Queue: Marshall Greenblatt <marshall@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-03 15:21:47 +00:00
Ben Clayton a5193704f6 dawn/native: Initialize tint
Bug: tint:1853
Change-Id: Id6242163f0670a62ed94ac01dcd575b403145b4e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122383
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-03 14:23:39 +00:00
Ben Clayton f7910f5b95 tint.h: Remove 'libspirv.hpp' include
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>
2023-03-03 14:20:53 +00:00
Ben Clayton b902e56ae7 dawn/test: Display an error message if toggles aren't recognised
Instead of cryptically crashing in release builds.

Change-Id: I22d222c6d6550010c3484e1f18397cef22602b92
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122384
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-03 11:21:52 +00:00
shrekshao ffe4c6fbaa Add label info for storage binding aliasing error msg
Bug: dawn:1642, dawn:840
Change-Id: Ice1661539b40d605a93e805acf7609fd3315606d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122460
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2023-03-03 01:19:26 +00:00
Loko Kung 861dfd89e8 Removes duplicated maxBufferSize in limit macros.
- 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>
2023-03-02 21:51:03 +00:00
dan sinclair 6cc183c85a Generic template and forward in stringstream.
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>
2023-03-02 21:28:45 +00:00
Ben Clayton 03de0e83ae Move tint::transform::Robustness to a santizier transform
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>
2023-03-02 20:48:48 +00:00
Ben Clayton d7ee9c1510 tint/sem: Add Declaration() override for IndexAccessorExpression
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>
2023-03-02 18:29:38 +00:00
Ben Clayton 1edc272904 tint/transform: Implement CreateASTTypeFor() for pointers
Change-Id: I83b0bb28194be559e6e60caca6f2dc1871e65743
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122340
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
2023-03-02 17:47:24 +00:00
Ben Clayton 57be2ff2eb tint: Change CloneContext::Replace() to replace the map entry
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>
2023-03-02 17:45:21 +00:00
Ben Clayton 26157557e8 tint/transform/utils: Add HoistToDeclBefore::Replace()
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>
2023-03-02 17:37:53 +00:00
Ben Clayton c0c8abc569 tint/resolver: Add missing ResolvedIdentifier case for 'let'
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>
2023-03-02 17:36:37 +00:00
Ben Clayton 3cde73cb1a tint/transform/utils: Correctly scope for-loop init
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>
2023-03-02 17:18:27 +00:00
Loko Kung d81aca7106 Make ConsumedError require handling the returned bool.
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>
2023-03-02 01:24:03 +00:00
Loko Kung e11208e9ce Handle/log errors when initializing pipeline caches in Vulkan.
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>
2023-03-02 00:27:50 +00:00
Loko Kung 02e456c9fb Bubble up errors from EnsureSubresourceContentInitialized.
Bug: dawn:1336
Change-Id: I1fd189bd6e3689df6f10351e8ba19fee569bda23
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122023
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-03-01 21:53:31 +00:00
shrekshao 84532462f6 Validate writable storage texture bindings don't alias
Followup of storage buffer bindings aliasing validation.

Bug: dawn:1642
Change-Id: I84bf33895320053630ed80d3503ff53d1eaa83b9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121420
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2023-03-01 21:04:28 +00:00
Yuly Novikov bda18d2b8d Skip MaxBufferBindingSize on Metal AMD
Fails on MacBook Pro 2019

Bug: dawn:1683
Change-Id: I335df3ae7e7cd9432d937a3b7d117f77b6143fa4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122200
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
2023-03-01 20:21:44 +00:00
Takahiro 9754bc42f4 Make properties required
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>
2023-03-01 13:34:59 +00:00
Corentin Wallez 383b5b3f8d Remove some dead code in TextureVk.
Found via the code coverage reports.

Bug: None
Change-Id: I3cd5911a627932cfde1bafd8353eef28993bbd42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122120
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2023-03-01 03:39:58 +00:00
James Price d623182c33 tint/PromoteInitializers: Do not hoist abstracts
Hoisting them would cause premature materialization. This will only
happen in cases where we do not actually need to hoist (e.g. assigning
to a phony), so we can safely skip these.

Fixed: tint:1852
Change-Id: Ifcbe3e13496daa0a6aaceb58540e60cb037885ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122104
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-03-01 00:20:49 +00:00
dan sinclair dee884c925 Convert most remaining usages to utils::StringStream.
This CL converts most of the remaining Tint usages (leaving out the
fuzzer code and some float_to_string code).

Bug: tint:1686
Change-Id: I4d5cef176c15479250861903870ec5bec0f95b5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122002
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-28 22:22:58 +00:00
James Price 7c21fe5d92 tint/uniformity: Fix struct member partial pointers
This assertion was mistakenly changed to only allow index accessors
when the ast::AccessorExpression base class was added.

Bug: chromium:1420257
Change-Id: Ic2b695dd7605c8852ab6d822602dca5d28ecf2d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122103
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-28 21:04:41 +00:00
James Price b7c2aed189 tint: Skip short-circuited array init const eval
Otherwise we will dereference the nullptr constant::Value constructor
arguments.

Bug: chromium:1420256
Change-Id: I5cace9c7c4bab7815f319793fdd88be294cd0ceb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122101
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-28 19:28:50 +00:00
Loko Kung f93f7ae8b1 Bubble up potential errors during buffer.unmap().
Bug: dawn:1336
Change-Id: I715904874311349b4e996665dccc9d2d31959717
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122022
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2023-02-28 19:02:00 +00:00
Loko Kung c2683a9459 Fix AllowedErrorTests by returning error via move.
Bug: dawn:1336
Change-Id: I966a2385e2a7e8a81ef97cd116b85a8036312e31
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122027
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-28 19:01:40 +00:00
dan sinclair 0723a3c7f8 Convert WGSL reader to utils::StringStream.
This CL updates the WGSL reader to use utils::StringStream internally.

Bug: tint:1686
Change-Id: I203c764bbb86e99da323fde2be2af555f158b7bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122001
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-28 18:47:20 +00:00
dan sinclair 0c184c2856 Convert SPIR-V reader to utils::StringStream.
This CL updates the SPIR-V reader to use utils::StringStream internally.

Bug: tint:1686
Change-Id: I619c2aa56b85e6c24b933ffa2a1a409d63846f5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122000
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-28 17:36:43 +00:00
dan sinclair b23cda4bc2 Convert the resolver over to utils::StringStream.
This CL updates the resolver to use utils::StringStream instead of
std::stringstream.

Bug: tint:1686
Change-Id: Ib15a9ae3228757bbddcf787fa9130ca19bc9eab7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121980
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-28 17:31:54 +00:00
Austin Eng e143338f65 Add limit tier for larger workgroup sizes
Up to 1024 threads in the X and Y dimensions. This is supported on all
Mac, all Windows, and most Vulkan devices.

Bug: dawn:685
Change-Id: I067a492bdfc32d6a186d6875e545238babca8784
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122003
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-28 17:10:04 +00:00
dan sinclair b2ba57b15d Convert TextGenerator over to utils::StringStream.
This CL updates the TextGenerator base class to use utils::StringStream.

Bug: tint:1686
Change-Id: Ie36f55cf32e63773c4bee2cf89cdef19ab1fba28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121960
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-28 15:14:09 +00:00
dan sinclair 88fea2a9c3 Convert the WGSL generator to utils::StringStream.
This CL updates the WGSL generator to use utils::StringStream
internally.

Bug: tint:1686
Change-Id: I7387a583f9cba3c6a955f5be376adc141e3ee394
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121941
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-28 15:06:19 +00:00
dan sinclair ec24bb2f0c Convert SPIR-V Writer over to utils::StringStream.
This CL updates the spir-v writer to use utils::StringStream.

Bug: tint:1686
Change-Id: I0b1367991de9ecb9fe02bdd0d1827aeba633f2fb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121940
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-28 14:58:36 +00:00
dan sinclair 52fa68b1a7 Convert MSL generator over to utils::StringStream.
This CL converts the MSL generator to use utils::StringStream
internally.

Bug: tint:1686
Change-Id: I4225ebb87fd5281a3527bf2a9067651b60b114a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121920
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-28 14:54:51 +00:00
dan sinclair 2b9d5b338a Convert HLSL generator over to utils::StringStream.
This CL converts the HLSL generator to use utils::StringStream instead
of std::stringstream.

Bug: tint:1686
Change-Id: I69d4deec9b65bbcba6afe319cc1266879cd7c373
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121900
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-28 14:49:25 +00:00
dan sinclair dba03d30fb Convert GLSL Generator over to utils::StringStream.
This CL switches the GLSL Generator to use utils::StringStream. The line
writer is converted internally as well, although it converts to
`std::ostream` for now. This caused a couple of the MSL, HLSL and GLSL
tests to generate slightly fewer decimal points in a couple tests.

Bug: tint:1686
Change-Id: I9ec8c1a5ef49679fc1c9a9aece86ab3390e103fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121880
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-28 14:41:45 +00:00
dan sinclair a4637ad8a3 Convert IR over to `utils::StringStream`.
This Cl updates the IR to use the `utils::StringStream` instead of
`std::stringstream`.

Bug: tint:1686
Change-Id: Iee9063db554bc75e7a730a8629d7f3403ff1a190
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121860
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-28 13:09:06 +00:00
dan sinclair 7ca41fffb7 Add a utils/string_stream class.
This CL adds `utils::StringStream`. This is a wrapper over
std::stringstream which forces the locale to always be `classic`. The
logic to format floats and doubles as expected is moved from
`float_to_string` and handled in the StreamStream. This will make all of
our float emission the same.

Bug: tint:1686
Change-Id: If51868f577580d3ea6ab94d3910393e239fd55e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121800
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-28 13:05:21 +00:00
Loko Kung 53893a3d77 Adds error promoting to device loss when disallowed error occurs in a scope.
- Defaults consume error calls to only allow validation and device loss
  errors.
- Allows OOM errors on Buffers, QuerySets, and Textures only.
- Adds initial suite of unit tests (and any necessary updates to mock
  framework).

Bug: dawn:1336
Change-Id: I82112ea6c147e894280e605bf8ae0ce00488c9f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119800
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-28 04:34:32 +00:00
James Price 7680bc0a89 dawn/test: Test padding byte preservation
The Dawn E2E tests for memory layout now check that padding bytes are
preserved, instead of skipping them.

Bug: tint:1571
Change-Id: I02edbe140e7025937a3188106da5e43ff03ad078
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121602
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-27 22:31:35 +00:00
Stephen White 25e1f12228 OpenGL: add support for GL_ANGLE_base_vertex_base_instance.
Change-Id: Ib327cb2e66bd5f02cce9c5321207483e16b40a40
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121500
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2023-02-27 21:43:57 +00:00
James Price ae3e9adc1b dawn/node: Fix array buffer view conversion
A Napi::TypedArray may have a non-zero offset on its underlying
ArrayBuffer backing buffer. Also use the length of the typed array,
not the backing buffer.

Change-Id: Icaa310ef8f87393b4d7582ba0a0afb2b87318664
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121820
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-27 21:21:02 +00:00
Austin Eng 148e7fab1c Raise maxStorageTexturesPerShaderStage to 8
The higher tier for this limit is available on all D3D12, all Metal,
and most Vulkan devices.

Bug: dawn:685
Change-Id: Ic2a39ad7908ea178e7aac48b7bb54b262d7039cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121543
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2023-02-27 20:22:51 +00:00
James Price 4d3af66bbd tint/msl: Preserve trailing vec3 padding
In order to preserve padding properly for MSL, we need to use its
packed_vec type for all vec3 types in storage buffers, not just struct
members. This commit includes a complete rewrite of the PackedVec3
transform to achieve this. The key details are:

* An internal `__packed_vec3<>` type was added, which corresponds to a
  `type::Vector` with an additional flag to indicate that it will be
  emitted as packed vector.

* The `PackedVec3` transform replaces all vec3 types used in
  host-shareable address spaces with the internal `__packed_vec3`
  type. This includes vec3 types that appear as the store type of a
  pointer.

* When used as an array element, these `__packed_vec3` types are
  wrapped in a struct that contains a single `__packed_vec3`
  member. This allows us to add an `@align()` attribute that ensures
  that `array<vec3<T>>` still has the correct array element stride.

* When the `vec3<T>` appears as a struct member in the input program,
  we apply the `@align()` to that member to ensure that we do not
  change its offset.

* Matrix types with three rows that are used in memory are replaced
  with an array of columns, where each column uses a `__packed_vec3`
  inside an aligned wrapper structure as above.

* Accesses to host-shareable memory that involve any of these types
  invoke a "pack" or "unpack" helper function to convert them to the
  equivalent type that uses `__packed_vec3` or a regular `vec3` as
  required.

* The `chromium_internal_relaxed_uniform_layout` extension is used to
  avoid issues where modifying a type in the uniform address space
  triggers stricter layout validation rules.

Bug: tint:1571
Fixed: tint:1837
Change-Id: Idaf2da2f5bcb2be00c85ec657edfb614186476bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121200
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-27 20:21:03 +00:00
Stephen White 55183e6c3a OpenGL: only load extension procs if extension supported.
Only load extension entry points if the extension is supported.

From the eglGetProcAddress manpage:

"A non-NULL return value does not guarantee that an extension function
is actually supported at runtime. The client must also make a
corresponding query, such as glGetString(GL_EXTENSIONS) for OpenGL and
OpenGL ES extensions [...] to determine if a function is supported by
EGL or a specific client API context."

This required moving extension initialization from OpenGLFunctions
into OpenGLFunctionsBase.

Change-Id: Ib4e8360ba455818701990b4476689b651d097ca8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121760
Commit-Queue: Stephen White <senorblanco@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-27 19:31:08 +00:00
Antonio Maiorano 43ffb09247 tint: validate max number of case selectors in a switch statement
Bug: tint:1209
Change-Id: Id91901125e7caf9b8b0e297305c26587edaa44d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121741
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-27 19:04:23 +00:00
Antonio Maiorano 1bb5be9789 tint: improve error message about function paramter limit
Bug: tint:1209
Change-Id: I0d3b188069e91488a482f529c962bfa054ad6d36
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121740
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-27 19:04:23 +00:00
Antonio Maiorano 6b304e9ffd tint: validate max nesting depth of composite types
Also increased stack size for windows + debug GN builds of
tint_unittests to 4 MB, which matches what we do in the CMake build.
Required, otherwise some of my new tests stack overflow.

Bug: tint:1209
Change-Id: I3b98000a989aa8b42b20cc4e2219c91887e52451
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121360
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-27 19:04:23 +00:00
James Price 0b3400c56e tint: Add chromium_internal_relaxed_uniform_layout
This will be used by the PackedVec3 transform to avoid triggering
stricter layout validation rules for the uniform address space when
mutating types.

Bug: tint:1571
Change-Id: Ib15737fbe3cab4a8fbe453bcaf96ef2acc595921
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121601
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-27 18:39:20 +00:00
James Price 806135658d tint: Pass constant::Values to ArrayOrStructCtor
This will allow the WGSL interpreter to use it (as the interpreter
does not have semantic nodes for its runtime results).

Change-Id: Icf81852d099b34cbb48c098bc116b4f08a3a7c61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121545
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: James Price <jrprice@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
2023-02-27 17:13:32 +00:00
David Neto c5ec169b89 classify template args: add cases used to debug Treesitter scanner
Change-Id: Ie27b217d68a2bae7d86b99d4268be11a7f47279f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121540
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-27 16:26:31 +00:00
James Price 6176c85be8 tint: Preserve padding in matrices with three rows
The PreservePadding transform now decomposes writes to matrices with
three rows into separate column vector writes, to avoid modifying
padding between columns.

Bug: tint:1571
Change-Id: If575f79bb87f52810783fd3338e2f3ce3228ab2e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121600
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-27 16:06:54 +00:00
James Price fe19fee3ea tint/const-eval: Fix runtime semantics for (x % 0)
The result of integer mod is defined to be zero when the RHS is zero
and for (MOST_NEGATIVE / -1). Floating point is expected to be
implementation defined, so also return zero in this case.

Change-Id: Ic25250d637ccb93ba62a5fc0bcebe670d5cd4e3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121544
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
2023-02-27 16:02:02 +00:00
Takahiro 35df626efa Refcount check in Buffer map async in Wire
If buffer is released and the external refcount reaches 0 while
buffer map state is pending map in Wire, the map async callback
is fired with destroyed-before-callback status from the buffer
destructor.

It is possible to call another MapAsync in the callback. At that
time the pointer is still valid because the internal refcount is
not 0 yet.

The behavior of MapAsync should be undefined if external refcount
is 0. This commit adds an assert to check whether external
refcount is 0 in Buffer::MapAsync() in Wire. Ending up with
assertion error may be reasonable.

This commit also adds protected GetRefcount() method to
ObjectBase to allow derived classes to check the refcount.

bug: dawn:1624
Change-Id: I95411a7be2093ba7bb2bb45b466f17f1ebac0ca9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119961
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2023-02-27 15:14:13 +00:00
Corentin Wallez f615770780 Dawn: Improve a couple error messages.
Bug: dawn:563
Change-Id: I49ad645d1b8a02efe029c391c3c70894de42cf9d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121542
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2023-02-27 15:10:21 +00:00
Zhaoming Jiang 04529be9b7 Dawn/Tint: Polyfill reflect vec2<f32> for D3D12 FXC on Intel
This CL add a toggle-controlled Tint polyfill for reflect on vec2<f32>,
and enable this toggle by default on D3D12 Intel device when using FXC.
This CL works around issue tint:1798.

Bug: tint:1798
Change-Id: If2f4de836eaf5e7374bc2c1ae3fbe06b91a5bbd5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121160
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2023-02-27 02:59:50 +00:00
Austin Eng 2ea4aac080 Support higher limits for maxDynamicUniform/StorageBuffers
The higher tier currently supports all D3D12 devices, all Metal,
and most Vulkan devices.

Bug: dawn:685
Change-Id: I5bcb778b92a073c9c1af943acee193073c0741ff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121101
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-25 02:10:21 +00:00
Antonio Maiorano 8ef7311413 tint: validate max number of members in a struct
Bug: tint:1209
Change-Id: I248c1864d3b38d41eda56bc41d7f19fb5fdd1955
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121220
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2023-02-24 21:37:44 +00:00
Ben Clayton 8cd5c611fc tint/reader/wgsl: Remove element_count_expression()
It wasn't actually called, as array is parsed like any other templated type.

Fixed: tint:1850
Change-Id: I2f1c8b8990cf7f3a5f8b09316e4dc539dbe6535a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121520
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-02-24 21:02:40 +00:00
Antonio Maiorano dec0c62997 tint: optimize SymbolTable::New
Avoid linearly searching for prefix_i. This becomes very slow when
adding the same prefix many times. Instead, cache each prefix and the
last index that was assigned, and start searching from there.

Note that this locally speeds up MaxLimitTests.MaxBufferBindingSize on
GL backends from about 10 minutes to a few seconds. This test creates a
very large struct, and Tint's GLES backend runs the PadStructs
transform, which produces a struct with 16384 members. Creating these
members triggers the behaviour described above when creating names for
each member.

Also replaced std::unordered_maps with utils::Hashmap.

Change-Id: I86678a049ac229ce617d500971e9c077ff5c10a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121440
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-24 20:59:08 +00:00
James Price 66d487395d tint: Use PI/2 as the input value for sin tests
This makes the output value consistent between different platforms.

Change-Id: I4f94da4deac6998c4b809b03ed3b8f58d32bb1b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121501
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-24 18:57:39 +00:00
Ben Clayton 1a1b5278d5 tint/transform: Inline HLSL uniform / storage buffers
Change the DecomposeMemoryAccess to behave more like the DirectVariableAccess transform, in that it'll inline the access of buffer variable into the load / store helper functions, instead of passing the array down.

This avoids large array copies observed with FXC, which can have *severe* performance costs.

Fixed: tint:1819
Change-Id: I52eb3f908813f72ab9da446743e24a2637158309
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121460
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-24 17:16:55 +00:00
Ben Clayton 7052cb57ff Revert "Add test setting the locale."
This reverts commit 9cdc3343ff.

Reason for revert: For some reason, Windows kokoro bots are now taking objection to this test.

Original change's description:
> Add test setting the locale.
>
> This CL adds a test which sets the locale to one which uses `1,00`
> instead of `1.00`. This ensures the float emission will get the right
> format.
>
> Bug: tint:1686
> Change-Id: Ib87235c7beac351b7dcbf37534df07135da377e5
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120881
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>

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

Change-Id: I2ace266871958a2d467855d55079aae467195ce0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: tint:1686
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121462
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-24 17:03:59 +00:00
Austin Eng 9ec746e3b9 Disable async pipeline compilation on Mac AMD with backend validation
Instead, compile pipelines synchronously.

When backend validation is on with Mac AMD, the driver crashes during
pipeline compilation. This seems to only occur when partition alloc
is enabled.

Bug: dawn:1200
Change-Id: I520087eeae9c356990962d0c4a96eba017735af1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121400
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-24 16:26:00 +00:00
Yan,Shaobo e958db0490 Add ExternalTexture::Refresh() and ExternalTexture::Expire()
ExternalTexture has active, expired and destroyed states.

Only active state external texture is valid to submit.

Expired state external texture can be refresh to active but
destroyed external texture cannot be refresh.

Bug: chromium:1412338
Change-Id: Ic7f12d274d27b644f19ec3ef8b46c110610afa2b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120982
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2023-02-24 02:09:38 +00:00
Jiawei Shao dd0332ec91 D3D12: Add workaround for DstAlpha blend factor issue on Intel GPUs
On Intel Gen9 and Gen9.5 GPUs there is a D3D12 driver bug about
using DstAlpha as the source blend factors in both color and alpha
blending.

Although we cannot add workaround for all such cases, we have
confirmed that when the blend operation is 'add', and the
destination blend factors are ‘zero', we can workaround this driver
bug by replacing 'add' to 'minus'. We cannot add workaround when
destination blend factor is another value.

This patch adds such workaround on the affected platforms.

Bug: dawn:1579
Test: dawn_end2end_tests
Change-Id: If7c82b9d559b876e42fb36e2f539f9ff2f71ea91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120981
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-24 01:34:56 +00:00
Li Hao fa5cda877f Add workaround to blit depth to depth in D3D12 T2T
Workaround for T2T depth copy failed with non-zero array layers for
d32s8 format on Intel D3D driver 31.0.101.4091.

Bug: dawn:1083

Change-Id: I9368f81ded765c5af4f132eb7f1032e695e16875
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121161
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-24 01:17:58 +00:00
dan sinclair 65a45fdf41 Handle errors in SPIRV-Reader tests.
This CL updates some EXPECT to ASSERT in the spirv-reader tests to
work around segvs when tests fail.

Bug: tint:1686
Change-Id: Icfd5a83cc71709fd351c3d5a39a9a0173056a0f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121340
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-23 21:51:15 +00:00
Ben Clayton 107aa81c89 tint: Improve error for assignment to immutable variable
Fixed: tint:1835
Change-Id: I48d1380fd6d9d5fdaae4a210e3c8695e26894905
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121320
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-23 20:50:36 +00:00
dan sinclair 9cdc3343ff Add test setting the locale.
This CL adds a test which sets the locale to one which uses `1,00`
instead of `1.00`. This ensures the float emission will get the right
format.

Bug: tint:1686
Change-Id: Ib87235c7beac351b7dcbf37534df07135da377e5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120881
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-23 19:49:07 +00:00
dan sinclair 077d97a387 Add `SuggestAlternatives` to attributes.
This CL adds an `attribute` enum into intrinsics.def and updates the
WGSL parser to use the enum parser and SuggestAlternatives.

Bug: tint:1831
Change-Id: I33b3e6bbf092282d9b1f86a1080e69940f55ff68
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121280
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-23 19:08:57 +00:00
Antonio Maiorano 9386f73446 tint: Fix compilation error with latest MSVC 17.5.0
Not sure if MSVC is wrong here, but it now fails to compile this file
because it looks for `builtin::AddressSpace::kPrivate` within the inner
`builtin` namespace, rather than in `tint::builtin`.

Change-Id: I10f9e1bd58e6ba548d40823f03802320865f069d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121221
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2023-02-23 18:35:49 +00:00
dan sinclair 869bcabf88 Make attribute grammar generic.
This Cl updates the parser to use a generic attribute grammar.

Bug: tint:1845
Change-Id: Icd600a2d87f03972f60d89b27fe0eef7be7667d5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121100
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-23 18:34:08 +00:00
jchen10 39b7330b5b Fix UV coord for TextureLoad
UV plane's coord should be half of that of Y plane for NV12.

Bug: chromium:1415832
Change-Id: Icee851e61eca1f7da291285100f8edcce482b511
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119860
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Jie A Chen <jie.a.chen@intel.com>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-23 13:03:52 +00:00
Antonio Maiorano 9776edf161 tint: Improve error message for array element stride in uniform storage
Bug: tint:1806
Change-Id: I673c41ce64c1cd2eb75ac93bf1ff9c51dab1c1d0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121042
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: dan sinclair <dsinclair@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-22 23:53:07 +00:00
shrekshao 182a7e89a6 Validate writable storage buffer bindings don't alias
Validate as the bind group lazy aspect at each dispatch/draw
call.

Use nested loops to iterate through each bind group and binding
to find if any aliasing exists, which has time complexity of
O(N^2) and can be further optimized to use O(NlogN) algorithm.

Bug: dawn:1642
Change-Id: I8c43128cdeea75352c194752fb22258b6a73430e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118440
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-22 23:20:50 +00:00
dan sinclair 187e0d5fe7 Add `requires` directive
This Cl adds the requires directive into Tint. Using the directive is
currently always an error as there is no valid value which can be used.

Bug: tint:1843
Change-Id: Idf77ba4e95ff0c1e177d02d1ba9598edc89a9812
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120740
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-22 20:57:28 +00:00
Loko Kung f35f1ff98c Refactors native mock classes to be more like the Null device.
- Plumbs all descriptors through so that the objects act much more like
  a real implementation.
- Lots of changes to DestroyObjectTests.cpp to update usages and test
  through the APIs when applicable.
- Put in defaults for the mock device and make it as easy to use as
  possible.

Change-Id: I85b243a18ec1872aff0172549aec0f599967ea0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119821
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2023-02-22 20:38:37 +00:00
Ben Clayton 54a104e28f tint: Update constructor / conversion terminology
Rename:
* "type initializer" -> "value constructor"
* "type conversion" -> "value conversion"

Fixed: tint:1848
Change-Id: I3e86a4e944971cea970f0d137641517c36cb807d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121060
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-22 20:04:40 +00:00
Corentin Wallez b4d2bbb24f Make Texture/QuerySet destroy always valid.
This follows the recent semantic from the WebGPU spec and fixes a couple
failing CTS tests.

Bug: None
Change-Id: I9197ea3fda6c15bd9302f8d60e70ee00f1d37708
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120980
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-22 18:12:57 +00:00
Austin Eng f16b9bbd6e Guard D3D12_FEATURE_D3D12_OPTIONS13 behind SDK version check
Bug: dawn:1216
Change-Id: I29054d51a5c4a24ce85619a22062973572eb1c61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120983
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-22 17:27:04 +00:00
Ben Clayton afc53fa942 tint/resolver: Bring back enum suggestions
The dependency graph no longer errors if a symbol cannot be resolved, instead the ResolvedIdentifier now has an unresolved variant.
This is required as the second resolve phase only has the full context of the identifier usage, to provide the hints.

Also: Split Slice out of the utils/vector.h, so it can be used as a lightweight view over static data.

Fixed: tint:1842
Change-Id: I31fa7697790be24c35b7e4fab5ca903c8a7afbba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121020
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-22 17:15:53 +00:00
Ben Clayton b549b3051e tint: Validate @must_use on functions and builtins
Fixed: tint:1844
Change-Id: I812dd338925c1dccaa3029a46e10a0ea34a8ed54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120960
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-22 16:18:22 +00:00
Ben Clayton d84903201d tools: Add @must_use support to intrinsics.def
Emits the new OverloadFlag::kMustUse flag on the annotated overloads.
Nothing consumes this, yet.

Bug: tint:1844
Change-Id: I4eb0943a23eaf5de98cd63444a686cffe62fb36e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120920
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-22 13:52:21 +00:00
dan sinclair ce10962d82 Add parsing and emission of the `must_use` attribute.
This CL adds parsing of the `@must_use` attribute into the WGSL parser. The WGSL
generator is also updated to emit the attribute.

Bug: tint:1844
Change-Id: If8821c9ac534b866cbe042128a00a582a245c3de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120821
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-02-22 13:36:01 +00:00
Ben Clayton 5662f79b24 tint/ast: Remove unnecessary ast:: prefixes
These uses are already in the ast namespace, so do not need the extra qualification.

Change-Id: I5e66048c9485c55b72e61ffa5b85b17ba1c780d0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120761
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-22 00:08:55 +00:00
Austin Eng 4a88a3287e D3D12: derive T2T workaround from TextureCopyBetweenDimensionsSupported
Query D3D12_FEATURE_DATA_D3D12_OPTIONS13 to determine whether the device
supports copies between textures of different dimensions. If it does
not, or if D3D12_FEATURE_D3D12_OPTIONS13 is not supported, force enable
toggle
D3D12UseTempBufferInTextureToTextureCopyBetweenDifferentDimensions.

Fixed: dawn:1216
Change-Id: I976e7fad291126f8dcee31ce6b681314d38e69e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120882
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Austin Eng <enga@chromium.org>
2023-02-21 23:14:46 +00:00
Shrek Shao 053fca884a Run SubstituteOverride transform before Robustness
Fixed: dawn:1673
Change-Id: I57f3daf16c417713a850894d1c6fcbc31ef03da1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120822
Commit-Queue: Shrek Shao <shrekshao@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-02-21 23:12:33 +00:00
James Price 239b4298b3 tint/HoistToDeclBefore: Use explicit types
Hoisting a constant array with an abstract type may change its
materialized type when using type inference, so use explicit typing
instead.

Fixed: tint:1847
Change-Id: I890826945bac7a2b7d8a0b84967f9d3c9ba439b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120901
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-21 23:10:17 +00:00
Ben Clayton 60d3738102 tint: Fix ICE in ast::TemplatedIdentifier ctor
Invalid programs could attempt to construct an ast::TemplatedIdentifier with no template arguments.
In this situation an ast::Identifier should be constructed instead.

Bug: chromium:1417465
Change-Id: Id1516cd83679947b5346c69ce5453d72f4f93b49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120841
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-21 22:01:48 +00:00
dan sinclair 2f689a7efe Remove deprecated inspector fields.
This CL removes two deprecated fields from the inspector. The deprecated
alias to sem::SamplerTexturePair remains as it will require creating a
structure on the inspector side to replicate.

Change-Id: I6001fbd475260079dd49d50f8e8619241bb0b468
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120880
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-21 21:54:48 +00:00
Ben Clayton fdef033210 tint/resolver: Fix ICE in ResolvedIdentifier::String()
That resolve to parameters.

Bug: chromium:1417513
Change-Id: Id7722524acbd9a9a26543cb73f48c8823dd51356
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120840
Kokoro: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-21 21:07:35 +00:00
Ben Clayton f0b4dbb82d tint: Resolve @interpolate() args as expressions
This CL makes the builtin argument resolve as a shadowable enumerator
expression.

Bug: tint:1841
Bug: tint:1845
Change-Id: I5000ea91771fabb460c80c164bc7708fbbb0288c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120722
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-21 21:05:28 +00:00
Ben Clayton 650426b187 Run ./tools/format
Change-Id: Icf1925cd3c862c4e29ba41f7d8470991ba4017f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120721
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-21 21:05:28 +00:00
dan sinclair a79c6603b2 Add `@must_use` AST node.
This CL adds the `@must_use` ast node and hooks it into the
program_builder.

Bug: tint:1844
Change-Id: I2ffe99bbf29ec287446788253aa8cf63cc4da50b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120820
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-21 18:49:40 +00:00
dan sinclair b92ff39724 Remove `static_assert` deprecation.
The `static_assert` builtin has been replaced with `const_assert`. This
CL removes the deprecation.

Bug: tint:1807
Change-Id: Ibcdc75e167bf6c1a6f74c295d9dcac7fff884d3a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120580
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-21 18:44:16 +00:00
Ben Clayton 4d3ff9711e tint: Resolve @builtin() args as expressions
This CL makes the builtin argument resolve as a shadowable enumerator
expression.

Bug: tint:1841
Bug: tint:1845
Change-Id: I2aaa2c63025752f25c113cf2fb38f4d91c2c16c2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120680
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-21 17:33:54 +00:00
dan sinclair 21571709a2 Remove the `type` keyword.
`type` has been deprecated in favour of `alias`. This CL removes the
deprecation warning and moves `type` to a reserved word.

Bug: tint:1812
Change-Id: I05246b9887a0890ae8343a0a132bd6f93353d5ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120540
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-21 16:55:07 +00:00
Ben Clayton 2d6f90771b tint/reader/spirv: Remove stdout spam
Change-Id: I8e38535d32f3e82800740894d5d47256fa926b23
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120720
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-21 01:59:33 +00:00
dan sinclair 993a658af2 Move InterpolationSampling and InterpolationType to builtin.
This CL moves the ast::InterpolateSampling and ast::InterpolationType to
builtin::

Change-Id: Iad9365ff629cbb7b3b03de6a4cd9355a21ce287e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120442
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-20 08:37:45 +00:00
Jiawei Shao e4f947637a D3D12: Replace dst-alpha with one for formats without alpha
This patch replaces D3D12_BLEND_DEST_ALPHA with D3D12_BLEND_ONE
when the color target formats have no alpha-channel.

Using D3D12_BLEND_ONE is an optimization over
D3D12_BLEND_DEST_ALPHA as it means the GPU hardware doesn't
need to get destination pixel at all. As D3D SPED requires the
default value for missing components in an element format is
"0" for any component except A, which gets "1", using
D3D12_BLEND_DEST_ALPHA takes same effect with
D3D12_BLEND_ONE when the color target formats have no alpha
channel.

In addition, replacing D3D12_BLEND_DEST_ALPHA with
D3D12_BLEND_ONE also serves as a workaround against an Intel
driver issue about alpha blending.

Bug: dawn:1579
Change-Id: If79e4c8007b68dd35e142ba9cf8a4921e611890a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120120
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-02-20 03:10:32 +00:00
dan sinclair b5af23d588 Move diagnostic severity and rule to builtin.
This CL moves DiagnosticSeverity and DiagnosticRule into the builtin::
hierarchy.

Change-Id: I3884046f042d130fa44556f63163f0040381e69c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120440
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-19 17:34:44 +00:00
dan sinclair ef30aa400c Move type/builtin to builtin.
This CL moves type::Builtin to builtin::Builtin.

Change-Id: I8b058dfcac38f782e07393b69e38534175f67524
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120403
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-19 04:28:04 +00:00
dan sinclair ba082fdb48 Move TexelFormat to builtin
This CL moves ast::TexelFormat to builtin::TexelFormat.

Change-Id: Ifb39cc58babdd7e7aa89c19af5336a9498b082ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120402
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-19 04:14:19 +00:00
dan sinclair 2a65163c6d Move type::AddressSpace to builtin/
This CL moves the AddressSpace enum from type:: to builtin::

Change-Id: Ie8d533be4dd42b34eef164b64e2c9e0843de5c3d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120401
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-19 04:03:55 +00:00
dan sinclair b6cc4cbf89 Move type/access to builtin.
This CL moves the type::Access builtin to the builtin:: tree.

Change-Id: I3276d364f7b597671612a23c8823f0afd1914d81
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120363
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-19 04:01:29 +00:00
Ben Clayton 79781f26d1 tint: Unkeyword 'var' template args
Change the address space and access mode in ast::Var from enums
to Expressions. Have the resolver resolve these, like we do for
other template arguments.

As the AST nodes now have identifier expressions, the tint-internal
'in' and 'out' address spaces have been prefixed with underscores to
prevent input code from using this.

Change-Id: Ie8abf371ee6a7031613709b83b575d2723418fcf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120405
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-18 17:13:18 +00:00
Ben Clayton 1b90f93742 tint: Remove type::AddressSpace::kNone
Just use kUndefined.

Change-Id: I26eada75a31b26f83e132a9a15c8ff64f7821676
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120404
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-02-18 12:37:34 +00:00
Ben Clayton 643f2aad43 tint/reader/wgsl: Remove type keywords
Fixes: tint:1810
Change-Id: Iff296a3923947801b9559fd0f5354b72f4b171d2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120081
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-18 08:36:01 +00:00
David Neto a1bda83c42 spirv-reader: don't hoist opaque objects
Fixed: tint:1839
Change-Id: I9738c390ab78e8dceb25572ea7cac6bdc0661304
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120460
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-18 07:05:58 +00:00
Corentin Wallez 839324a331 Make "rg11b10ufloat-renderable" also allow resolving.
Fixed: dawn:1663
Change-Id: I9b856b8a1d280b0de1cc41fc512aaa1235d6d992
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120441
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2023-02-18 05:17:59 +00:00
Austin Eng a0e96b5831 Rolling 8 dependencies
Roll build/ 8cbb95464..1103ef535 (35 commits)

8cbb95464b..1103ef535c

$ git log 8cbb95464..1103ef535 --date=short --no-merges --format='%ad %ae %s'
2023-02-17 brucedawson New toolchain for Windows 11 10.0.22621.755 SDK
2023-02-16 danakj Use the latest Rust roll in 2e5c4436101c72e571732e77604be0bc8f38ee4c
2023-02-16 rohpavone [fuchsia] Show update_images.py errors
2023-02-16 rohpavone [fuchsia] Download images to tempfiles and then extract.
2023-02-16 wnwen Android: Fix build_utils.MergeZips for duplicates
2023-02-15 bpastene Manually roll chromite to pick up Tast data dependency changes
2023-02-15 agrieve Android: Add flag to ignore violations in private_code_test
2023-02-15 vollick [ios] ensure that we filter out duplicate files due to glob expansion
2023-02-14 svenzheng Enable field trial config for lacros tests
2023-02-14 hypan Fix file closing issue in AVD.
2023-02-14 hans Roll clang+rust llvmorg-16-init-17653-g39da55e8-3 : llvmorg-17-init-2082-g6d4a674a-1 / [skipping Rust]
2023-02-14 vollick [ios] Only add tracked files to filelists and add automation
2023-02-14 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230213.3.1 to 11.20230214.1.1
2023-02-14 vollick Initialize MockInputApi's verbosity
2023-02-13 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230213.2.1 to 11.20230213.3.1
2023-02-13 waffles Updater: add symlinks to GoogleSoftwareUpdate.bundle.
2023-02-13 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230213.1.1 to 11.20230213.2.1
2023-02-13 dinfuehr sanitizers: Add TSAN suppression for V8 global safepoints
2023-02-13 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230212.3.1 to 11.20230213.1.1
2023-02-12 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230212.2.1 to 11.20230212.3.1
2023-02-12 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230212.1.1 to 11.20230212.2.1
2023-02-12 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230211.3.1 to 11.20230212.1.1
2023-02-12 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230211.2.1 to 11.20230211.3.1
2023-02-11 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230211.0.1 to 11.20230211.2.1
2023-02-11 uioptt24 Remove `import pipes` to suppress warnings
2023-02-11 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230210.2.1 to 11.20230211.0.1
2023-02-10 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230210.1.1 to 11.20230210.2.1
2023-02-10 agrieve Android: Build androidx.core.os.BuildCompat from source
2023-02-10 aohui.wan Fix "gn gen" failure from unused "_module_target_name"
2023-02-10 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230210.0.1 to 11.20230210.1.1
2023-02-10 agrieve Add test preventing internal code in libmonochrome.so
2023-02-10 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230209.3.1 to 11.20230210.0.1
2023-02-10 chromium-internal-autoroll Roll Fuchsia Internal Images from 11.20230209.2.1 to 11.20230209.3.1
2023-02-09 wnwen Reland "Android: Update play core library"
2023-02-09 mheikal Add global flag to disable unused resource stripping

Roll buildtools/ 70e9f44cb..2ff42d200 (7 commits)

70e9f44cbc..2ff42d2008

$ git log 70e9f44cb..2ff42d200 --date=short --no-merges --format='%ad %ae %s'
2023-02-16 chromium-autoroll Roll libc++ from 3e929b8e5992 to 6f4617b9efc3 (2 revisions)
2023-02-15 chromium-autoroll Roll libc++ from 7492f13b0b54 to 3e929b8e5992 (10 revisions)
2023-02-14 chromium-autoroll Roll libc++ from 276c835f3710 to 7492f13b0b54 (4 revisions)
2023-02-13 chromium-autoroll Roll libc++ from fb27d308b0e0 to 276c835f3710 (20 revisions)
2023-02-11 chromium-autoroll Roll libc++ from 7f648d9b44c2 to fb27d308b0e0 (4 revisions)
2023-02-10 chromium-autoroll Roll libc++ from 035440c70772 to 7f648d9b44c2 (1 revision)
2023-02-10 uioptt24 update python shebang in ash/ , base/ , buildtools/

Roll buildtools/third_party/libc++/trunk/ 035440c70..c1341b9a1 (49 commits)

035440c707..c1341b9a1a

$ git log 035440c70..c1341b9a1 --date=short --no-merges --format='%ad %ae %s'
2023-01-21 koraq [lib++][format] Uses the new exception test macros.
2023-02-11 koraq [libc++] Fixes a flaky test.
2023-02-15 koraq [libc++][CI] Switches to clang-format-16.
2023-02-15 koraq [libc++] Improve the format ignorelist generation.
2023-02-02 nikolasklauser [libc++][NFC] Rename _LIBCPP_NO_EXCEPTIONS to _LIBCPP_HAS_NO_EXCEPTIONS
2023-01-21 koraq [libc++][test] Adds more generic test macros.
2023-01-14 nikolasklauser [libc++] Granularize <atomic>
2023-01-08 nikolasklauser [libc++] Granularize <bit> includes
2023-02-15 ldionne.2 [libc++] Add regression test for std::hash implementation in ABI v1
2023-02-13 joeloser [libc++] LWG 3857: allow `string_view` conversion when only traits vary
2023-02-07 koraq [libc++][CI] Starts using Clang 17.
2023-02-14 nikolasklauser [libc++][NFC] Replace _LIBCPP_STD_VER > x with _LIBCPP_STD_VER >= x
2023-02-15 fsb4000 [libc++] `<algorithm>`: `ranges::minmax` should dereference iterators only once
2023-02-14 ldionne.2 [runtimes] Rename newconfig.py to config.py -- it's not new anymore
2023-01-24 hui.xie0621 [libc++][NFC] update Range Status for the completion of C++20 ranges
2023-02-14 koraq [libc++][doc] Sets the proper plenary date.
2023-02-02 koraq [libc++][format] Fixes test failures.
2022-03-20 koraq [libc++][chrono] Add hh_mm_ss formatter.
2023-02-12 koraq [libc++][doc] Adds Issaquah papers and issues.
2023-02-09 arthur.j.odwyer [libc++] Counter<T>'s assignment operator shouldn't ++gConstructed
2023-01-20 nikolasklauser [libc++] Enforce formatting for already formatted and new files and ignore the formatting of tests
2023-02-13 avogelsgesang [libc++][NFC] Remove duplicated line from `Cxx20Issues.csv`
2023-02-13 koraq [libc++][doc] Updates format status page.
2023-02-03 ldionne.2 [libc++] Reorganize exception_guard
2023-02-13 hans Revert "[libc++] Remove _LIBCPP_CONSTEVAL"
2023-02-10 ldionne.2 [libc++] Fix bug in allocate_shared_for_overwrite
2023-02-07 ldionne.2 [libc++] Implement P2136R3 std::invoke_r
2022-12-26 nikolasklauser [libc++] Granularize <type_traits> includes in <algorithm>
2022-08-04 avogelsgesang [libc++][spaceship] Implement `lexicographical_compare_three_way`
2023-02-12 avogelsgesang [libc++][NFC] Fix formatting in ranges status page
2023-02-11 hui.xie0621 [libcxx][ranges] mark new join view tests unsupported without experimental flag
2023-02-05 hui.xie0621 [libc++] fix `shared_ptr`'s incorrect constraints
2023-02-10 nikolasklauser [libc++] Enable radability-identifier-naming for local variables and fix any problems
2023-02-11 ldionne.2 [libc++][NFC] Reorganize the std::pair constructor tests to be more consistently named
2023-02-11 ldionne.2 [libc++][NFC] Change some std::pair tests from .compile.fail.cpp to .verify.cpp
2023-02-11 nikolasklauser [libc++] Remove _LIBCPP_CONSTEVAL
2023-02-11 ldionne.2 [libc++][NFC] Fix leftover #endif comments
2023-02-11 ldionne.2 [libc++][NFC] Use using instead of typedef in pair.h
2023-02-11 ldionne.2 [libc++][NFC] Always define __non_trivially_copyable_base in pair.h
2023-02-11 ldionne.2 [libc++][NFC] Use std:: instead of _VSTD:: in pair.h
2023-02-11 ldionne.2 [libc++][NFC] Use >= 23 instead of > 20 in pair.h
2023-02-11 ldionne.2 [libc++][NFC] Use std:: instead of _VSTD:: in construct_at.h
2023-02-04 hui.xie0621 [libc++][ranges] move all range iterators back in class
2023-01-28 hui.xie0621 [libcxx][ranges] revert join_view::iterator and sentinel to be in-class
2023-02-10 ldionne.2 [libc++] Remove unused std::function test
2023-02-10 ldionne.2 [libc++] Simplify non_default_alloc
2023-02-10 varconst [libc++] In tests, use `abort` to terminate upon an error.
2023-02-09 ldionne.2 [libc++][NFC] Reorganize hash.h
2023-02-09 ldionne.2 [libc++] Guard the fix to CityHash behind ABI v2

Roll buildtools/third_party/libc++abi/trunk/ b74d77161..f7460fc60 (4 commits)

b74d771611..f7460fc60a

$ git log b74d77161..f7460fc60 --date=short --no-merges --format='%ad %ae %s'
2023-02-16 nemanja.i.ibm [libunwind][PowerPC] Fix saving/restoring VSX registers on LE systems
2023-02-15 xingxue [libc++abi][AIX] Skip non-C++ EH aware frames when retrieving exception object
2023-02-14 ldionne.2 [runtimes] Remove duplicate imports of libcxx.test.config
2023-02-14 ldionne.2 [runtimes] Rename newconfig.py to config.py -- it's not new anymore

Roll testing/ d5ea1bf4b..166db27fd (82 commits)

d5ea1bf4b6..166db27fd0

$ git log d5ea1bf4b..166db27fd --date=short --no-merges --format='%ad %ae %s'
2023-02-17 bookholt Command buffer fuzzer
2023-02-17 chikamune Update FindRegistrationImprovements in fieldtrial_testing_config
2023-02-17 chikamune Add service-worker-only feature param to fieldtrial_testing_config.json
2023-02-17 zhiyuans [Test Reduction in Clank] Move android_browsertests to CI only on android-nougat-x86-rel.
2023-02-17 haowoo Turn off xr_browser and context_browser tests when running w/o field trial config.
2023-02-17 khalidpeer [ZPS] Update field trial testing config for ZPS + Journeys integration.
2023-02-17 chrome-weblayer-builder [lacros skew tests] Refresh skew tests for M112
2023-02-17 jiesheng Add iOS build target
2023-02-16 crisrael [Eche] Enable EcheLauncherListView for dogfooders and new experiment arm
2023-02-16 manukh [omnibox][post-ac] Clean stripped URL optimizations.
2023-02-16 manukh [omnibox][post-ac] Clean `kAutocompleteStabilityAsyncProvidersFirst`.
2023-02-16 battre Roll Flatbuffers to version a56f9ec50e908362e20254fcef28e62a2f148d91
2023-02-16 jonfan Increase shard timeout of chrome_all_tast_tests on chromeos-kevin-chrome.
2023-02-16 manukh [omnibox][post-ac] Clean `kAutocompleteStabilityDontCopyDoneProviders`.
2023-02-16 bpastene Move linux-headless-shell-rel's tests to bionic
2023-02-16 manukh [omnibox][drive][doc] Clean ASO (Apps Search Overlay).
2023-02-16 chrome-weblayer-builder [lacros skew tests] Refresh skew tests for M112
2023-02-16 shuyng Revert "[RDSD] Launch subdomain settings on ToT"
2023-02-16 pasko Remove @FlakyTest from docs
2023-02-16 jleconte [WebRTC] Use run_blink_web_tests instead of run_wpt_tests.
2023-02-16 dgn Reland "[fyfre] Enable the ForYouFre feature in fieldtrial_testing_config"
2023-02-16 esalma [PolicyLogs] Enabling PolicyLogsPageAndroid flag in Test Config
2023-02-16 jonahr Test dual-GPU path for high-performance WebGL contexts on Mac/Metal.
2023-02-16 jleconte Update tryserver.webrtc.json ownership.
2023-02-16 fleimgruber Enable AutofillImprovedLabelForInference by default.
2023-02-16 jleconte [WebRTC] Add a new 'webrtc_linux_chromium' bot.
2023-02-16 chrome-weblayer-builder [lacros skew tests] Refresh skew tests for M112
2023-02-16 yyanagisawa Add fieldtrial_testing_config for the start service worker case.
2023-02-16 zhiyuans [Test Reduction in Clank] Move content_shell_test_apk to CI only on android-12-x64-rel.
2023-02-16 chrome-weblayer-builder [lacros skew tests] Refresh skew tests for M110
2023-02-15 manukh [journey] Update fieldtrial_testing_config.json for hiding visits.
2023-02-15 sunxiaodi add Android Pixel6 PGO to Pinpoint
2023-02-15 chrome-weblayer-builder [lacros skew tests] Refresh skew tests for M112
2023-02-15 mdjones Add field trial entry for shopping list on iOS
2023-02-15 ynovikov Remove experimental GPU ChromeOS bots.
2023-02-15 schwering Revert "[Autofill] Enable AutofillParseAsync by default"
2023-02-15 yuezhanggg Add field trial config for ChromeCartDomBasedHeuristics
2023-02-15 hans Run ClangToT Windows tests on Win 10
2023-02-15 jleconte [WebRTC] Disable baremetal tests requiring a webcam on Mac.
2023-02-15 jleconte [WebRTC] Align the tests between Chromium and Chromium FYI bots.
2023-02-15 schwering [Autofill] Enable AutofillParseAsync by default
2023-02-15 chrome-weblayer-builder [lacros skew tests] Refresh skew tests for M112 M111 M111 M109
2023-02-15 zhiyuans [M Deprecation] android-asan builder.
2023-02-15 svenzheng Add linux-lacros-archive-rel builder
2023-02-15 chrome-weblayer-builder [lacros skew tests] Refresh skew tests for M112
2023-02-14 nickdiego properly disable KeyboardLock tests in unsupported platforms
2023-02-14 adamta [iOS] Stop feed top section coordinator and make fieldtrial compact
2023-02-14 hypan Green chrome_public_unit_test_apk on android 12l, 13
2023-02-14 svenzheng Add a service account to OWNER for chromium.coverage.json
2023-02-14 manukh [omnibox][shortcut] Update fieldtrial_testing_config.json.
2023-02-14 khaslett Cleanup configs referencing EnableOverlayPrioritization feature
2023-02-14 jw.jung Remove flag chromeos-sharing-hub
2023-02-14 peilinwang [Cleanup] Remove kNotifyJavaSpuriouslyToMeasurePerf config
2023-02-14 huangs Revert "[fyfre] Enable the ForYouFre feature in fieldtrial_testing_config"
2023-02-14 skylab-test-cros-roller [skylab_tests] Update skylab tests cros img version
2023-02-14 dgn [fyfre] Enable the ForYouFre feature in fieldtrial_testing_config
2023-02-14 snehanagpaul [URLFiltering] Field Trial Testing Config for Url Filtering
2023-02-14 droger [signin] Enable InteractiveGetAuthTokenCheckActivity in trial config
2023-02-14 lazzzis Add fieldtrial entry for message stacking animation
2023-02-14 zhiyuancai [MerchantTrust] Post-launch cleanup
2023-02-13 manukh [omnibox][memories][post-ac] Update fieldtrial_testing_config.json.
2023-02-13 nicolasmacbeth [Field Trial][Blue dot] Adding Blue Dot DB experiment to config
2023-02-13 elainechien [RenderText] Add feature flag to remove fontlink fallbacks.
2023-02-13 rmhasan Move the add_emulator_args function to the common.py module
2023-02-13 zbikowski Switch Webview CTS archive revision to 3pp-built
2023-02-13 treib Add fieldtrial_testing_config entry for SyncEnableHistoryDataType
2023-02-12 rmhasan Remove redundant emulator arguments being added in the finch smoke tests
2023-02-11 xiaolingbao Use mixin to customize updater builders/testers.
2023-02-10 hypan Green android_browsertests, content_browsertests on android 12l, 13
2023-02-10 michaelfsun Add Floss to field trial config
2023-02-10 ryansturm Add field trial for PrewarmLookalikeCheck
2023-02-10 jeffyoon Win10 coverage tests to run on Win10
2023-02-10 rmhasan Finch: Crop away the bottom navigation bar from screenshots
2023-02-10 ryansturm Adding field trial testing for SearchPrefetchOnlyAllowDefaultMatchPreloading
2023-02-10 agrieve Add test preventing internal code in libmonochrome.so
2023-02-10 yueshe shard ios_chrome_web_eg2tests_module in 2 for ios_eg2_tests
2023-02-10 skylab-test-cros-roller [skylab_tests] Update skylab tests cros img version
2023-02-10 rayankans [WebEngine] Add instrumentation and junit tests to CQ
2023-02-10 curranmax Enable PrefetchUseContentRefactor by default on desktop.
2023-02-10 manukh [omnibox][domain] Update fieldtrial_testing_config.json.
2023-02-09 christianxu [iOS] Add Suggestions truncation fieldtrial config
2023-02-09 haowoo Increase shards for android field trial tests as they are timing out.

Roll third_party/catapult/ 37e879a7d..c1e70d412 (17 commits)

https://chromium.googlesource.com/catapult.git/+log/37e879a7d13c..c1e70d412ce0

$ git log 37e879a7d..c1e70d412 --date=short --no-merges --format='%ad %ae %s'
2023-02-16 sunpeng Add metrics for pinpoint job status and run time
2023-02-16 ianstruiksma update wpr and httparchive go binary versions.
2023-02-16 ianstruiksma Update presubmit scripts to python3.
2023-02-14 wenbinzhang [chromeperf] add GET endpoints for perf issue service
2023-02-14 bsheedy Add A23-specific workaround
2023-02-14 ianstruiksma In update wpr binary script, ensure cs version is regular str.
2023-02-14 wenbinzhang [chromeperf] add try jobs for issue_tracker_service folder
2023-02-14 bsheedy Omit useless frames from summary
2023-02-14 sunxiaodi include Android Pixel 6 PGO isolate
2023-02-14 sunxiaodi Surface iteration recommendations for press benchmark on Pinpoint UI
2023-02-14 zhiyuans Make GetCurrentUser also works for Android versions Nougat.
2023-02-09 olivf Fix histograms2csv on Python 3
2023-02-13 bsheedy Update async intent waiting
2023-02-13 wenbinzhang [chromeperf] update folder structure and add unit tests
2023-02-12 johnchen Update a unit test to remove Python dependency
2023-02-09 wenbinzhang [chromeperf] add skeleton for the perf bug manager
2023-02-09 wenbinzhang [catapult] use python3 instead of python to remove stale files in windows trybot

Roll third_party/googletest/ b73f27fd1..7a7231c44 (4 commits)

b73f27fd16..7a7231c442

$ git log b73f27fd1..7a7231c44 --date=short --no-merges --format='%ad %ae %s'
2023-02-16 absl-team Fix link in ReportUninterestingCall message
2023-02-15 absl-team Remove strdup usage
2023-02-14 absl-team Remove some filesystem APIs and tests under !GTEST_HAS_FILE_SYSTEM
2023-02-13 absl-team Avoid reliance on <any> header without RTTI on MSVC

Roll tools/clang/ fff7f04d3..effd9257d (5 commits)

fff7f04d30..effd9257d4

$ git log fff7f04d3..effd9257d --date=short --no-merges --format='%ad %ae %s'
2023-02-17 tkent Update two OWNERS files
2023-02-16 szager Filter for complete class definitions in StackAllocatedChecker
2023-02-16 ahijazi Clang plugin: Add basic check for fields that should be raw_ref<T>
2023-02-14 hans Roll clang+rust llvmorg-16-init-17653-g39da55e8-3 : llvmorg-17-init-2082-g6d4a674a-1 / [skipping Rust]
2023-02-14 ajgo Exclude pointer members in //sandbox/win that do not need raw_ptr<>

Created with:
  roll-dep build buildtools buildtools/third_party/libc++/trunk buildtools/third_party/libc++abi/trunk testing third_party/catapult third_party/googletest tools/clang

Change-Id: Ic0fb8374a412b511a84c7f1c3c25b072ccd30ba0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120360
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-18 00:39:01 +00:00
dan sinclair e4039c76c7 Move the Extension builtin to the builtin/ folder.
This CL moves Extension from ast:: to builtin::

Change-Id: Ica1e6f4f9229341b547011389d47ae3be9830b0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120362
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-17 21:58:59 +00:00
dan sinclair 6392579ee1 Move BuiltinValue to builtin/
This CL moves the BuiltinValue enum to the builtin/ folder.

Change-Id: I9db5128c1bc272e8e8d5181d629e6724ac38322e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120361
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-17 21:56:35 +00:00
Austin Eng 7616dcb060 Add Toggle to use temp buffer in T2T copy with different dimensions
Bug: dawn:1216
Change-Id: I0fb7400af1bfeb5b05fd926c0b175421560f0c78
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120100
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Austin Eng <enga@chromium.org>
2023-02-16 23:36:40 +00:00
Corentin Wallez 5860a14591 Use the correct Validation/InternalError status for CreatePipelineAsync
Bug: chromium:1404422
Change-Id: I88d354688d2a0c39be120919a8ea4b234ce9c9af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119460
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2023-02-16 19:44:05 +00:00
dan sinclair be967e31fc Add JSON output to tint_info.
This CL adds a `--json` output to the `tint_info` command to generate a
JSON file of the WGSL program information.

Change-Id: I8cdd9675954f793fc7142d857f846a18f4a07ffc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120082
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-16 19:22:19 +00:00
Yan,Shaobo 86fbd1a7de Refactor Semaphore Service In Vulkan Backend
Dawn provides external semaphore service in static way by compiling
implementation files based on OS type.

A better way is to select external semaphore in runtime.

This CL adds ServiceImplementation interface and implements it for
different semaphore type. Semaphore service delegate work to
implementation in runtime.

This CL also removes "DAWN_USE_SYNC_FD" macro.

Bug=dawn:1593

Change-Id: Idc3f7b644430aad76198ef66dc5ba13e8cfc5a4d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119321
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2023-02-16 13:49:23 +00:00
Austin Eng 79d971f093 Blocklist D3D12 adapters on ARM CPUs
This platform still has undiagnosed errors. Blocklisting for V1.

Bug: dawn:884
Change-Id: I83c51f48732ace5c3c4b16ee9906af0d8a3cccdb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2023-02-16 00:44:36 +00:00
Yunchao He 81cf894075 Unsuppress e2e test in ColorStateTests
Bug: dawn:1625

Change-Id: I437c37b2a7749d37ee1f922061b4c7038d5e3ec5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119980
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-15 19:25:35 +00:00
Austin Eng 70607cb160 Refine d3d12 blocklist from X86 -> I386
This was wrong.
DAWN_PLATFORM_IS_X86 is defined for both 32-bit and 64-bit
X86 builds.

Bug: dawn:1254
Change-Id: I308ac10749edcf76643539eb2801d019dd5439f9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119900
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-15 17:59:26 +00:00
dan sinclair 95dc1ad060 Remove duplicated AST and SEM headers in BUILD.gn
This CL updates the BUILD.gn script to have a dedicated AST headers
target. This can then be depended on by the AST, SEM and program target.

Change-Id: I0fd3a9eb3bffbf5b7d76eee3d44109ee5c5df431
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119903
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-15 04:37:30 +00:00
dan sinclair 6080471662 Split demangler to separate lib.
This Cl splits the demangler out to a separate library. The includes for
demangler in program and program_builder are removed as they are no
longer necessary.

Change-Id: I0d4a3e8ec537d596a99cdd1fd1000b3efea20714
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119902
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-15 04:35:01 +00:00
dan sinclair 6e8a23097a Cleanup some includes.
Remove some ast/ includes of sem/ files and remove some program_builder
includes from sem/ files. The AST->SEM includes were not needed, the
program_builder include was replaced with more specific AST headers.

Change-Id: I8cf7fdee311a87687a5737853caff0ac082c9ba6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119901
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-15 02:35:32 +00:00
Ben Clayton 727503d205 tint/resolver: Pass std::function by ref
Avoids a copy

Change-Id: Ief4e7985b41c50f102be27a8a3fa9a690166511f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116868
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-14 18:09:17 +00:00
Antonio Maiorano ee665a4240 tint: add precise float mod polyfill and enable it for HLSL
HLSL's % operator results in less precise results than expected.

Bug: tint:1799
Change-Id: I1a9572288a0e536f0fc9c0748a25dcf58551e57b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119760
Kokoro: Kokoro <noreply+kokoro@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2023-02-14 16:12:59 +00:00
Ben Clayton 971318f7a2 tint: Replace all remaining AST types with ast::Type
This CL removes the following AST nodes:
* ast::Array
* ast::Atomic
* ast::Matrix
* ast::MultisampledTexture
* ast::Pointer
* ast::SampledTexture
* ast::Texture
* ast::TypeName
* ast::Vector

ast::Type, which used to be the base class for all AST types, is now a
thin wrapper around ast::IdentifierExpression. All types are now
referred to using their type name.

The resolver now handles type resolution and validation of the types
listed above based on the TemplateIdentifier arguments.

Other changes:
* ProgramBuilder has undergone substantial refactoring.
* ProgramBuilder helpers for type inferencing is now more explicit.
  Instead of passing 'nullptr', a new 'Infer' template argument is
  passed.
* ast::CheckIdentifier() is used for more tests that check identifiers,
  including types.

Bug: tint:1810
Change-Id: I8e739ef49435dc1c20a462f3ec5ba265661a7edb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118723
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-14 13:52:43 +00:00
Ben Clayton 03b09f1099 tint/sem: Add FunctionExpression
Will be generated for expressions that resolve to functions.

Bug: tint:1810
Change-Id: I334729c9499be7b1c4ab229c1845a4d5f06fa107
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119701
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-14 00:33:43 +00:00
Jiawei Shao 7c2fa23a7e Implement the optional feature "bgra8unorm-storage" on D3D12
This patch adds the support of the optional feature "bgra8unorm-storage"
on D3D12 when the platform allows using DXGI_FORMAT_B8G8R8A8_UNORM as
UAVs.

According to D3D12 documents, enabling the flag
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS when creating textures requires
"either the texture format must support unordered access capabilities at
the current feature level. Or, when the format is a typeless format, a
format within the same typeless group must support unordered access
capabilities at the current feature level".

Bug: dawn:1641
Test: dawn_end2end_tests
Change-Id: If16271b5da52423e73ad4f7ba258af83dbf66dd2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119345
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>
2023-02-14 00:29:52 +00:00
Jiawei Shao 01456d97ea Implement the optional feature "bgra8unorm-storage" on Vulkan
This patch implements the optional feature "bgra8unorm-storage" on
Vulkan. As SPIR-V doesn't support 'bgra8' as a valid image format,
we have to create an image view with RGBA8Unorm format on the
BGRA8Unorm texture when we want to use it as a storage texture.

Bug: dawn:1641
Test: dawn_end2end_tests
Change-Id: I4aeea96ae872fe4e6367c535afb6ab896b952453
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118021
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-14 00:27:34 +00:00
Ben Clayton a5b9e96b39 tint/reader/spirv: Work around pointers to null store types.
Bug: tint:1838
Change-Id: I84564a1b9888634808af2a1c7bb1e77c80947216
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119700
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
2023-02-13 21:22:21 +00:00
Austin Eng 151913d29b VideoViewsTests: add test which uses a sampler per plane
This test sees flaky failures.
 - Check the entire checkerboard texture contents to get more
information.
 - Add a test which uses seperate sampling states to see if DX12
driver has difficulty sampling multi-planar formats using a
single sampler.
 - Also, double check support for the NV12 format in case
something in the driver flakily exposes support.

From https://dawn-review.googlesource.com/c/dawn/+/47660

Bug: dawn:733
Change-Id: I766907ff648f1dc35387902a70c3fb65debcaecd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119343
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
2023-02-13 18:35:04 +00:00
Austin Eng 44032e5084 Unblock multi-mip stencil textures on Metal
These textures still have some outstanding issues on both Intel and AMD,
where the wrong subresource can be read from.
Zero-initialization workarounds have been enabled to ensure that even
when the wrong subresource is read, uninitialized data is not read.

Bug: dawn:704, dawn:791, dawn:838
Change-Id: Ib118eff0c5ed5e7812fa70e88ece5317c1af13b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116849
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2023-02-13 18:04:00 +00:00
Austin Eng 20881f39e7 Add basic Adapter blocklist
Adds a basic adapter blocklist and adds two cases to it.

By default, the blocklist is disabled until Chromium can enable it
explicitly - perhaps based on --enable-unsafe-webgpu or some other
flag. It will be switched to default to true in the future.

about://gpu would disable the blocklist so all the adapters are
visible there, but WebGPU would enable it. Trusted users of Dawn
that are aware of potential bugs may also disable it.
One downside is that about://gpu won't surface directly that an
adapter is on the system, but blocklisted for WebGPU. Something
like that can be added in the future, if necessary.

In the future, this should probably be merged with Chromium's
software_rendering_list.json, but that list doesn't support
multi-adapter systems well (for blocklisting just one adapter),
and it doesn't understand all the information we need for the
current blocklist.

Bug: dawn:1254, dawn:1196, tint:1753
Change-Id: I992bcd10dd5d3f5b23319fc4ec699b06bb1117da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119061
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-13 17:10:44 +00:00
Li Hao 9ee3c7afcc Fix timestamp period for timestamp-query-inside-passes on Metal
Still a missing condition to enable timestamp period calculation at
device initialization on Metal.

Refactor GPUTimestampCalibrationTests.cpp to check timestamp query
correctness on both D3D12 and Metal backends.

Bug: dawn:1193
Change-Id: I69feeaea0df309e15c008647d76b11899dcdc727
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119320
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-02-11 09:30:38 +00:00
Jiawei Shao f5cee3fadf Enable the optional feature bgra8unorm-storage on Metal
This patch adds the support of the optional feature "bgra8unorm-storage"
and enable it on  Metal.

Bug: dawn:1641
Test: dawn_end2end_tests
Change-Id: Id58cefd8735f46b8d1807376ebcfada10df2890e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111380
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-02-11 02:53:53 +00:00
Austin Eng 2c8bea1f9e Add a toggle to keep Metal depth stencil textures initialized
To avoid uninitialized reads of depth stencil data, where the Metal
driver incorrectly binds/loads the wrong depth stencil subresource,
always keep all depth stencil subresources initialized. This means
that textures are initialized on creation, and StoreOp::Discard is
never used - Store is used instead.

Texture initialized state is still set as-if the Discard occured, so
Dawn will try to zero-initialize the subresource if it is read from.
In many cases, this will work correctly, and the application will
read back 0, as expected. In some cases, Metal will bind the wrong
subresource, and the previous contents will be read. This is wrong,
but at least it is not uninitialized data.

Bug: dawn:838
Change-Id: I3cc87073d52de60283e3b683bbee7809db803018
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119344
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-11 00:00:12 +00:00
Ben Clayton 1131d31761 tint/ast: Remove ast::StorageTexture
Instead use ast::TypeName.

Also improve the validation and diagnostics around providing template
arguments to types that do not accept them.

Bug: tint:1810
Change-Id: I4241d50ce0425ab721157686889e918993482876
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119284
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-10 19:24:24 +00:00
Ben Clayton c66b5e6922 tint/resolver: Fix null dereference
When performing binary / unary ops with non-value expressions.

Bug: chromium:1414658
Change-Id: I7b92f63890da1d9e20e7a1f692fe1fcd28a6f79d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119481
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
2023-02-10 15:54:54 +00:00
Corentin Wallez e268e5b854 BackendVk: Remove VVL suppressions for a fixed VVL issue.
Fixed: dawn:1627
Change-Id: I7949c0604b1aa5f96f22c9191413485f6226e270
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119480
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2023-02-10 15:54:04 +00:00
Antonio Maiorano ec20758675 tint: polyfill remainder to handle negative operands
Bug: tint:1802
Change-Id: Ie9baa045feda08523e5ca4f5ce94b6db7d4477e5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119100
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-10 15:01:02 +00:00
Ben Clayton a5fec206c9 tint/ast: Remove ast::DepthTexture and ast::DepthMultisampledTexture
Instead use ast::TypeName.

Bug: tint:1810
Change-Id: Id9fe641d193967cb27cea97e9c25b75c5fe2f1a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119122
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-10 02:34:21 +00:00
Zhaoming Jiang 63b777b552 Dawn: Refactor device toggles
This CL refactor the logic adapter creating device toggles set when
creating device and the way device holding its toggles. This CL also
introduce the concept "toggle stage", currently "device stage" only but
in future will add "instance stage" and "adapter stage" for instance and
adapter toggles. No changes on Dawn API.
More details:
1. Introduce `TogglesState` objects that represent the complete toggles
   state of a device (and will used for instance and adapter in future).
2. When creating a device, adapter set up a TogglesState object for it
   in `AdapterBase::CreateDeviceInternal` and
   `Adapter::SetupBackendDeviceToggles`, no other place would change
   the device's toggles state. This change simplify the logic.
3. Introduce the `ToggleStage` enum for every toggle and `TogglesState`
   object. Currently we only have `Device` toggle stage, but in future
   will have `Instance` and `Adapter` for instance and adapter toggles.

Bug: dawn:1495
Change-Id: Ifafac6a6a075b5b9a733159574ae5b6d4f3ebde9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118030
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2023-02-10 01:43:55 +00:00
Ben Clayton 4906b03963 tint/ast: Remove ast::ExternalTexture
Instead use ast::TypeName.

Bug: tint:1810
Change-Id: Ia1ae61b2bffd386f8958c8164e2223df5f8ac91c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119121
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-09 23:59:07 +00:00
Ben Clayton ed3389faee tint/ast: Remove ast::Sampler
Instead use ast::TypeName.

Bug: tint:1810
Change-Id: Ia2641d661cab70d110c975d5f0d0e76628816cb0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119120
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
2023-02-09 23:56:42 +00:00
Ben Clayton 6e0a51521f tint/ast: Remove scalar types from ast::*
Instead use ast::TypeName for all of these.

Bug: tint:1810
Change-Id: Ie51a69bf40648a9da73c0a1de2cd96a93d4eac76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117892
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-09 23:33:24 +00:00
Ben Clayton eb30a0ddee tint/resolver: Fix validation of type constructor without assignment
Tint used to validate that type initializers and conversions were not
used as statements. The WGSL specification has been recently updated to
allow this, but Tint requires more work to correctly handle these as
statements.

For now, restore the validation.

Bug: tint:1836
Bug: chromium:1414489
Change-Id: I9f6aabece26c30b0a0d789ae0dfa10d6f43ee4dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119360
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-09 23:19:42 +00:00
Bruce Dawson 0755fdbc8f Use $windows_sdk_version instead of constant
Dawn was using a hard-coded constant for the Windows SDK version number
but that makes upgrading the Windows SDK to build Chromium impossible.
This change uses the newly created $windows_sdk_version to solve this
problem.

This new variable was added in crrev.com/c/4234366

Bug: tint:1719
Change-Id: I6a9f74f542d3517c046d74178a41e1e4d5887e7f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119340
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-02-09 22:44:31 +00:00
Ben Clayton 031e2f5585 tint/resolver: Resolve builtin enumerators
'address space', 'access' and 'texel_format'

Bug: tint:1810
Change-Id: If471912fcef57f7579d76c8c4edd663d1c0311ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119125
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-09 15:35:27 +00:00
Ben Clayton 0ddddb00cb tint/resolver: Start handling sem::Expression
Change Resolver::Expression() and Resolver::Identifier() to return a
sem::Expression instead of a sem::ValueExpression.

This is required as IdentifierExpressions may resolve to non-values.

Handle expressions that resolve to types, when they are expected to
resolve to a value.

Bug: tint:1810
Change-Id: I1cb069e3e736fc85af7bc395b388abe153b1f65a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118500
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-09 15:35:27 +00:00
Ben Clayton 4e4cada291 tint/transform: Simplify Renamer transform
Take advantage of the fact that all AST nodes now use an
`ast::Identifier` instead of directly using Symbols.

This will be important for ensuring that un-keyworded identifiers will
be preserved.

Bug: tint:1810
Change-Id: If5c3e9f00b4c1c14a6f11bd617bd8b895250fb7e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119285
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-09 15:35:27 +00:00
Ben Clayton f973d514a1 tint: Add ast::CheckIdentifier() test helper
A bunch of template magic to recursively test that an identifier (and
template arguments) matches the given values. Will be heavily used for
AST and parser tests.

Bug: tint:1810
Change-Id: I8d83090352c345f0ce1ac7840e163eea96eac8a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119124
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-09 11:59:47 +00:00
Ben Clayton b75252b7aa tint/ast: Change TypeDecl::name to an ast::Identifier.
The goal here is to have all AST nodes use an identifier instead of
symbols directly. This will greatly simplify the renamer transform,
and gives the symbol a Source location, which is helpful for
diagnostics and tooling.

Change-Id: I8b3e05d05886c6caa16513a5cfb45d30f7a8d720
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119283
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
2023-02-09 10:34:14 +00:00
Ben Clayton 651d9e2558 tint/ast: Change Variable::symbol to Variable::name
Variable::name is an ast::Identifier.

The goal here is to have all AST nodes use an identifier instead of
symbols directly. This will greatly simplify the renamer transform,
and gives the symbol a Source location, which is helpful for
diagnostics and tooling.

Change-Id: I71fe3e8df3d22b12d4a3430c41f236ddf5bc0b9e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119282
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-09 10:34:14 +00:00
Ben Clayton 199440e37c tint/ast: Change StructMember::symbol to StructMember::name
StructMember::name is an ast::Identifier.

The goal here is to have all AST nodes use an identifier instead of
symbols directly. This will greatly simplify the renamer transform,
and gives the symbol a Source location, which is helpful for
diagnostics and tooling.

Change-Id: I1156653a48b02997ec0a9077b174401f65a13457
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119281
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-09 10:34:14 +00:00
Ben Clayton ce31d187ef tint/ast: Change Function::symbol to Function::name
Function::name is an ast::Identifier.

The goal here is to have all AST nodes use an identifier instead of
symbols directly. This will greatly simplify the renamer transform,
and gives the symbol a Source location, which is helpful for
diagnostics and tooling.

Change-Id: I723a9a104668758db2cb32051efa1f6d3c105913
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119280
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-09 10:34:14 +00:00
Ben Clayton 057a733758 tint: Allow IdentifierExpressions to be templated
Required for nested template arguments, like `array<vec2<i32>, 2>`

Bug: tint:1810
Change-Id: Ibf24ec8918ef7698232cb2ea0cb786144d6f0604
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119123
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-08 23:29:28 +00:00
Yunchao He 2d41a015d7 Report error immediately if pass ends twice
The previous code reports error till command encoder finish.

This change also updates webgpu-cts expectations.txt accordingly.

Bug: dawn:1578

Change-Id: I1fe758a02d9cfdb1440e3cabf10aea0bd60b9c59
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116842
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2023-02-08 22:04:10 +00:00
Brendon Tiszka d0b284b00b Add Dawn Wire Server LPM Fuzzer [1/N]
Add scaffolding for structured Dawn wire fuzzer.

This CL contains a basic fuzzer for Dawn wire server
that shows some simple design ideas:

1) A basic protobuf spec that is generated using dawn.json
2) conversion from protobuf message to a dawn wire server
command.

This is not the complete implementation and serves as a
foundation for the fuzzer so that subsequent CLs will be
easier to review.

Bug: chromium:1374747
Change-Id: Ife1642dda13d01d3308bdd5fe56cf85978399fd3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109406
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brendon Tiszka <tiszka@chromium.org>
2023-02-08 20:43:18 +00:00
Ben Clayton cf0e9301b2 tint: Improve the output of DependencyGraph
Add ResolvedIdentifier to hold the resolved AST node, sem::BuiltinType
or type::Builtin.

Reduces duplicate builtin symbol lookups in Resolver.

Bug: tint:1810
Change-Id: Idde2b5f6fa22804b5019adc14c717bebd8342475
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119041
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-02-08 15:18:43 +00:00
Ben Clayton 9e36723497 tint: Rework TypesBuilder::array() to take attribute list
Instead of having the stride be yet another integer argument, make the
stride explicit by adding an attribute list parameter. This is more
consistent with other nodes.

Bug: tint:1810
Change-Id: I916d810f29afd172b878ded48b6701e8b299b13f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119040
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-08 14:17:37 +00:00
Ben Clayton 5b50790d70 tint/reader: Use ProgramBuilder helpers
Eases the migration to unkeywording types.

Bug: tint:1810
Change-Id: If9ccdbf963550774b85b8cd15df8e37c271cde93
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118987
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-08 12:35:19 +00:00
Ben Clayton 35089ee437 tint: Use ProgramBuilder::Bitcast()
Change-Id: I3187027c8d24cfc0a18ed317a6586037346c97a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118986
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-08 01:11:27 +00:00
Loko Kung 831ff0e39d Deprecates clearColor, clearDepth, and clearStencil values.
- Removes remaining usages of the values in Dawn and removes tests.
- Note that the values will be removed from the JSON entirely in
  follow up CL after Chromium side changes.

Change-Id: I30ccb3c412cd97047065ad515f6a5ff4de642420
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117593
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2023-02-07 23:51:11 +00:00
Ben Clayton d775a26d82 tint: Use ProgramBuilder::CallStmt()
Change-Id: I963d1c859b5bbb8d86f67194e7c0963dfc0e5b29
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118985
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-07 21:28:09 +00:00
Ben Clayton 1ebada0dad tint: Use ProgramBuilder::Return()
Change-Id: I2de08d2d9274b0a849e44a5dafbeaf2a731318ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118984
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-07 21:28:09 +00:00
Ben Clayton 6adb65c488 tint: Use ProgramBuilder::Discard()
Change-Id: If71a771a65510ec7daa003f02958002d3fa83e3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118983
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-07 21:28:09 +00:00
Ben Clayton 17aa653fa9 tint: Remove body_attributes param from ProgramBuilder::Func()
This belongs on Block(), not Func().

Also make Func() smarter about the `body` argument, allowing the caller
to pass an ast::BlockStatement*, ast::Statement* or nullptr.

Change-Id: I8ac6c1598b37f2a94615b452c5eb37671b4305fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118982
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-07 21:28:09 +00:00
Ben Clayton 1906857a50 tint: Remove ast::Void
WGSL does not have a void type. Functions that do not return a value
simply omit the return type from the function signature.

Change-Id: Id45adc008dce46115552e7dc401a2e27ae10eeb4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118981
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2023-02-07 21:28:09 +00:00
James Price d9c0f2178d tint/resolver: Make pointer aliasing a hard error
Fixed: tint:1675
Change-Id: I620ac9854395b35acd8d42090f854e37360983db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119001
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-07 19:40:01 +00:00
Ben Clayton 01ac21cc9a tint: Rename ProgramBuilder::Construct() to Call()
Once all ast::Type derived classes are removed, there will be no
distinction between a type initializer / conversion and a function call.

Bug: tint:1810
Change-Id: Ic10fd1a0364a564d24dbe2499af0f1424641596c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118980
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-07 16:14:25 +00:00
Jiawei Shao c272282e97 D3D12: Allocate renderable 2D textures as committed resources on Intel GPUs
This patch adds a workaround on Intel Gen9.5 and Gen11 GPUs to always
allocate renderable 2D textures as committed resources instead of
placed resources to mitigate a driver bug about CreatePlacedResource().

Bug: dawn:1628
Change-Id: I38062115d94933bd58e571c812ff6888e9781df6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100640
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-02-07 15:09:58 +00:00
Ben Clayton ad73301856 tint/type: Rename ShortName to type::Builtin
These will include the builtin language types.

Bug: tint:1810
Change-Id: I695a9ee833e1035eb1d17913d709038ae4c561d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118502
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-02-07 13:35:58 +00:00
Peng Huang fd1e8a44f2 [GL] track buffer usage
With this CL, GL backend and other backends will use the similar way
to track buffer usage, so the GL MapAsync(Write) will not synchronize
GL commands anymore.

Change-Id: I9f8dfeb58faaed09ed62550371a30a680cd607d5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118140
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-02-06 23:29:11 +00:00
James Price fc2083a616 tint: Make CreateScalar and ZeroValue members
This avoids the need to pass the `use_runtime_semantics_` flag at each
callsite.

Change-Id: I2cce3f147226e1295b5dfa0239beeacd519d5bb4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118641
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-06 22:01:48 +00:00
James Price 40ffda4b5e tint/const-eval: Add flag to use runtime semantics
Add a flag to resolver::ConstEval to turn all overflow and range
errors into warnings, and return a valid (usually zero) value instead
of utils::Failure as defined by the WGSL spec for expressions
evaluated at runtime.

Change-Id: Icdce512306aabe717591134a1b4ba2d9c668f29c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118640
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-06 18:52:13 +00:00
Antonio Maiorano b3d5fb19bb Fix dump_shaders for Vulkan backend in CMake build
Change-Id: I6670abe2fbc77418a5923643db0d377d38212288
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118620
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2023-02-06 18:30:09 +00:00
dan sinclair c1799cc75a Add a `tint_info` command.
This CL adds a second command `tint_info`. The `tint_info` command can
be used to dump information about a WGSL program to the console. This
includes things like the inputs and outputs to an entrypoint along
with structure information like offsets and alignments.

Bug: 1825
Change-Id: Ia2fb4be08b39c1a592f78a388d34edf9af8b6a0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118643
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-06 16:28:37 +00:00
Ben Clayton 0b4a2f1f50 tint: Add sem::Expression
A new base class for sem::ValueExpression, which other types of
expression can derive from.

Example: sem::TypeExpression - an expression that resolves to a type.

Bug: tint:1810
Change-Id: I90dfb66b265b67d9fdf0c04eb3dce2442c7e18ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118404
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-02-05 22:59:40 +00:00
Ben Clayton ef1811a18b tint: static_assert that Sem.Get() template arg is needed
Change-Id: I91a73c22bd417fd9f32d45a1c91ffcb8f8d83d82
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118405
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-05 14:33:08 +00:00
Ben Clayton ad3156551c tint/ast: Add AccessorExpression
New base class to IndexAccessorExpression and MemberAccessorExpression.

Simplfies code that operates on both of these.

Change-Id: I02ce2e8180d7c1836f0b4d8e629e707e19e3539e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118403
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-05 12:36:50 +00:00
Ben Clayton 3fb9a3fba1 tint/sem: Rename Expression to ValueExpression
ast::IdentifierExpression may also resolve to a type or core enumerator

Bug: tint:1810
Change-Id: I85e3bea67e1146215079ec47430784f2fb39043d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118402
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-02-04 21:20:26 +00:00
James Price 98dc5a86cc tint/ast: Make DiagnosticControl a plain struct
Introduce DiagnosticDirective, which contains a DiagnosticControl
struct (as does DiagnosticAttribute).

Bug: tint:1809
Change-Id: I204001266ee472d2ee2827614a306acad53f12ba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118060
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-04 12:20:55 +00:00
David Neto 85e13bcd68 spirv-reader: fix emission of INT_MIN literal
Fixed: tint:1818
Change-Id: Ieb19f874d248a3a1c11c96f5ae06c4db14e0c811
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118540
Auto-Submit: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-03 22:00:07 +00:00
Austin Eng 4dffbd3f16 Suppress RegressionDawn1083 with depth32float-stencil8 Mac AMD
Bug: dawn:1651
Change-Id: I2f8977ba5793d90419bd27cb7381fceaa4cb891c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118601
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2023-02-03 21:14:16 +00:00
James Price 132d8c7a7d Add flag to disable derivative_uniformity for SPIR-V ingestion
Add a chained struct for Dawn-specific options for SPIR-V ingestion to
contain this new flag.

Bug: tint:1890
Change-Id: I1332ff20c91f29a84c21550a37f11bc7d9c956ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118421
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-03 19:38:46 +00:00
Zhaoming Jiang 6315289ee8 Dawn: Make Adapter initialize supported feature never error
This CL make vulkan adapter checks essential Vulkan extensions and
features in InitializeImpl rather than InitializeSupportedFeaturesImpl.
This change makes InitializeSupportedFeaturesImpl never result in Error
for all backend, and this CL change the return type of
InitializeSupportedFeaturesImpl from MaybeError to void.

Bug: dawn:1495
Change-Id: If59c5aa5281776226c157451ee5119052d33ac24
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118031
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-02-03 19:13:12 +00:00
Yuly Novikov 76d4892f36 Remove obsolete format of SYNC-HAZARD-WRITE-AFTER-READ messages
Bug: chromium:1412096, dawn:1225
Change-Id: I3734ad139b9e57102cbf8a7ec2bb053c491eb734
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118503
Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-02-03 18:21:49 +00:00
Ben Clayton 2117f80f8b tint: Reduce repetition for ty.type_name()
Rename the type_name() method with  operator().

`ty.type_name("blah")` becomes `ty("blah")`

Change-Id: Ia0b2bc304e7bb208c2e40a469332044b394535d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118401
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-03 14:01:43 +00:00
Ben Clayton 2cdf134b2b tint: Add ast::TemplatedIdentifier
Will be used to replace all type identifiers that take templated arguments.

Bug: tint:1810
Change-Id: I31ad8dc4826375a783143cc33f336d8a4860613c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117893
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-03 13:24:18 +00:00
Ben Clayton 89a717bacf tint: Have ast::TypeName use ast::Identifier
Consistency with the other AST nodes.

Change-Id: I8db3d237c27fea44c80101ed3d24b62832d45c18
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118360
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-03 13:22:17 +00:00
Ben Clayton 12914eedf6 tint: Have ast::DiagnosticControl use ast::Identifier
Instead of ast::IdentifierExpression.
The name is not an expression.

Fixed: tint:1257
Change-Id: I3161d20f584bfedf730b9257233f9dfcb064298a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118344
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
2023-02-02 22:20:32 +00:00
Antonio Maiorano f031ca2d44 tint/hlsl: fix assignment to matrix element
When calling the generated helper, the column and row arguments were
swapped.

Improved the unit tests to actually show this, rather than passing in a
single value for both column and row.

Bug: tint:1824
Bug: tint:1333
Change-Id: I32a92dec5e594dabd9d8d2b08474c0d6f3645520
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118420
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2023-02-02 22:16:42 +00:00
Ben Clayton a4117ca21b tint: Have ast::MemberAccessorExpression use ast::Identifier
Instead of ast::IdentifierExpression
The member is not an expression, but a name.

Fixed: tint:1257
Change-Id: I879ddf09c3e521a18cef85422bb2f8fe78cddf5b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118343
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-02-02 20:44:53 +00:00
Ben Clayton 6cba18b0fc tint: Have ast::IdentifierExpression use ast::Identifier
The additional nesting is somewhat unfortunate for pointer
indirection overhead, but this simplfies logic like
transform::Renamer, which can continue to find all the
identifier nodes in the program.

Bug: tint:1257
Change-Id: I8d51dd80dc4c51ef59238959029b8511f1edf70d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118342
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-02 20:37:19 +00:00
Austin Eng 08027c662e Modernize some internal WGSL syntax
Change-Id: I4706e517608d436fa646537fec9e930ae47d1c40
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118029
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
2023-02-02 20:17:46 +00:00
Corentin Wallez 0761764256 BackendVk: Add suppressions for new formatting of VVL errors
Bug: dawn:1225
Change-Id: Icc15a8bdad48d9cabed96af62e011a531ea7f5c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118400
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-02 17:33:38 +00:00
Ben Clayton 999db74a24 tint: Have ast::CallExpression use ast::Identifier
Instead of ast::IdentifierExpression.
The name is not an expression, as it resolves to a function, builtin or
type.

Bug: tint:1257
Change-Id: I13143f2bbc208e9e2934dad20fe5c9aa59520b68
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118341
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
2023-02-02 15:16:28 +00:00
James Price 6e31bc24b1 tint/parser: Use = for source of assignment
Change-Id: I09ebd529fad775d0ce74fc56e2d7ff161a33f15a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118380
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-02 15:05:21 +00:00
Ben Clayton c87b1fe8c9 tint: Add ast::Identifier
An identifier node that is not an expression.

Will be used by:
* CallExpression
* DiagnosticControl
* IdentifierExpression
* MemberAccessorExpression
* TypeName

Bug: tint:1257
Bug: tint:1810
Change-Id: I1de719d8c570992fed08789c35ca6c4409789520
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118340
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
2023-02-02 15:04:31 +00:00
James Price 92226dbfc3 tint/reader/wgsl: Add source info to loop bodies
Also for continuing blocks.

Change-Id: Ic4a5f30fc0b882f1051c4995bd2b228c5ccc6d17
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118321
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-02 13:01:42 +00:00
James Price f6a48ee351 tint/reader/wgsl: Add source info to compound statements
Change-Id: I251dd3d061a32042368b170ba2a38d16e8b2d9dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118320
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-02 12:40:53 +00:00
James Price 70f968d098 tint: Fix masked ParameterRequiredToBeUniform
Reset the visited state of nodes before traversing to determine a
parameters requirements with respect to the function return value,
otherwise we may not capture a parameter->retval relationship
correctly.

Fixed: tint:1822
Change-Id: I9802a89fe1c8331b2f9dae594ccb045f339396fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118080
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-02 02:28:27 +00:00
James Price 072f83c682 tint/uniformity: filter should not affect result
A derivative_uniformity diagnostic filter should not affect the
uniformity of the return value of a derivative builtin.

Fixed: tint:1815
Change-Id: I58e714978dab747598af5136dc9808a5a658c60e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118001
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-02 00:29:27 +00:00
James Price d9f659670d tint: Handle @diagnostic on block statements
Use expect_compound_statement() in all the places that use
compound_statement in the WGSL grammar.

Handle attributes on statements inside Resolver::StatementScope, so
that the logic can be reused for the various places where block
statements are used. This will also make it easier to reuse this logic
when we allow these attributes on other types of statement in the
future.

Add an `EmitBlockHeader()` helper to the WGSL writer to reuse the
logic for emitting attributes on block statements for all the places
that use them.

Bug: tint:1809
Change-Id: Iac3bb01f5031e6134c1798ddafdad080412c8bef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118000
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-02-01 23:14:10 +00:00
Austin Eng e60a579c19 Add workaround to blit depth to depth
Fixes T2T depth copies on Mac Intel where the destination
subresource is a non-zero mip/layer.

Fixed: dawn:1083
Change-Id: If344b46c3fd436d857906850fc0ac5ccb4b93e1d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117592
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-01 22:49:39 +00:00
Antonio Maiorano eab1f62629 tint/hlsl: for default-only switch, only emit condition if it has side-effects
This fixes edge-cases, like the condition expression being a type-cast,
which DXC apparently sees as a variable re-declaration. Example:

fn foo(x : f32) {
  switch (i32(x)) {
    default {
    }
  }
}

was emitted as HLSL:

void foo(float x) {
  int(x);
  do {
  } while (false);
}

The `int(x)` is seen as a re-declaration of `x` by DXC.

We fix this by only emitted the condition expression if it has
side-effects (which currently means it contains a call expression).

Bug: tint:1820
Change-Id: I7e4320fa09ea2d634c9e324cb0b752b0ee7dcde9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118161
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2023-02-01 15:46:34 +00:00
Antonio Maiorano 635c5d0f04 tint/spir-v backend: emit OpSRem instead of OpSMod for remainder
operation

Bug: tint:1802
Change-Id: I690ef658874ba8d0d9cd8efa2a91324db175650b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118100
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-01-31 19:09:05 +00:00
Austin Eng 3da942086d Expand metal combined ds workaround
This workaround is needed unless the system is MacOS 13.1+
with architecture at least AMD gcn-4.

Bug: dawn:1389
Change-Id: I3a85be150a0c5ca8b0b74e4b097906f278dd3049
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118023
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2023-01-31 18:13:43 +00:00