This CL adds support for `break-if` to Tint.
Bug: tint:1633, tint:1451
Change-Id: I30dfd62a3e09255624ff76ebe0cdd3a3c7cf9c5f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106420
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: dan sinclair <dsinclair@google.com>
An expression like `b--b` needs the `--` split into two symbols in
order to parse correctly. This change was done previously, adding
a test case to show the generated output.
Bug: tint:988
Change-Id: Id389224e33b7702a90e4c157b02031fb605c1b14
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106580
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Added support for reporting when pointer parameters point to non-uniform
values. Also add support for binary expressions results that may be
non-uniform.
Bug: chromium:1374534
Change-Id: Ia51557e3a984c69a39f2878c964bf07085599809
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106560
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This CL fixes up a clusterfuzz issue where the address of a
numeric was take in a case selector leading to a nullptr.
Bug: chromium:1376865
Change-Id: I3b78a17e1c47263e18d2d272ff28c2cc8be79a0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106540
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
The `default` case selector has been implemented in Tint. This CL
updates the deprecation notice with that fact along with some more
information on replacements.
Bug: tint:1644
Change-Id: I883b4465d11d9696d46523d11e66c9a2dc2777ac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106460
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL catches up the internals (along with a few error messages) to
say `initializer` instead of `constructor.
Bug: tint:1600
Change-Id: I8e56572c310d77da1130380bdd32b334f27c8e46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106462
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This CL adds tests to verify the new parser handles the mixing of && and
|| correctly.
Bug: tint:1599
Change-Id: I1a73d041a00118ed649522ae07fc1489021c4b41
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106461
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Rules for shift left of concrete values are now split between signed and
unsigned. Shifting unsigned values no longer fails with "sign change"
errors. Furthermore, shifting unsigned values must only shift out 0s.
See https://github.com/gpuweb/gpuweb/pull/3539.
Bug: tint:1701
Bug: tint:1717
Change-Id: Iba2799f4b02cdc77cc58a6c7c104aaa408f0f0f9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106381
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
googletest doesn't print test parameters properly when they are a tuple
of variants.
Change-Id: I070697bb0118282dd4841df23c936e0171934628
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106380
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This CL updates the WGSL parser to parse `default` as a case selector
value.
Bug: tint:1633
Change-Id: I57661d25924e36bec5c03f96399c557fb7bbf760
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106382
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
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>
This change adds more tests to exercise the code of the workaround for
array texture corruption issue. Because texture memory layout and tile
alignment vary accordingly if array textures have mipmaps, and/or
different dimensions, etc.
It also does some slight changes in the workaround itself for array
textures with non-32-or-16-bit-wise formats.
Bug: dawn: 949, dawn: 1507
Change-Id: I22e87830ba59f2a2814e6786aa9a1a55a15c95cb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105241
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This patch sets the deprecated member colorAttachment.clearColor to
NAN in CHelloTriangle.cpp to eliminate a warning when running the
demo.
Bug: dawn:1269
Change-Id: I274198d1cafbc2dc15dcf6e59d26b58a62134c5a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106400
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This CL moves switch case statements to store Expression instead
of an IntLiteralExpression. The SEM is updated to store the
materialized constant instead of accessing the expression value
directly.
Bug: tint:1633
Change-Id: Id79dabb806be1049f775299732bc1c7b1bf0c05f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106300
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This change required removing the `&&` splitting for `a & b && c` which never valid WGSL (right now).
Fixed: tint:1658
Change-Id: Ideb9f1aa9cf9b9b1054a6fc65860106dc072a9dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105820
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
In WGSL, we can shift left abstracts by >= 64, as long as the result is
representable in the data type we choose for it. When shifting 0, we can
shift by any positive u32 value (result is always 0), but in C++, it's
UB to shift by more than the bit width of the data type, so we need to
handle this. This bug was caught by ClusterFuzz.
Bug: chromium:1372963
Change-Id: I638ca190b93538908ca6472f3735627ea8531c5a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106266
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
The SwitchStatement has an IsDefault method which checks if the
condition is nullptr. The method is never called, and default
cases are tracked in the CaseStatement class, so it's questionable
what IsDefault even means here.
Change-Id: I96e97fbbf4823df3e92d2440fa6a9541a5ba337f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106280
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
The reason for slow compile times is because the very large variants of
builder::Value<T>s combined with the many std::visits over these
variants result in many combinatorial instantiations of the visit
callbacks.
To address this, I added a polymorphic base class ValueBase to Value<T>,
and replaced most of the std::visit-based compile time code with runtime
virtual calls. For the two heaviest users of std::visit over the large
variants, compiles times dropped more than half (clang-10, debug):
const_eval_binary_op_test.cc: 19.079s to 7.736s
const_eval_unary_op_test.cc: 10.021s to 4.789s
Bug: tint:1711
Change-Id: Iba05e6ae1004ef0814250e2a8ea50aa2b26b85f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105782
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This CL updates the @location attribute to use expressions instead of
integers.
Bug: tint:1633
Change-Id: If4dfca6d39e5134bb173209414ad8d2528c8095d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106121
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL updates the @id attribute to use expressions instead of
integers.
Bug: tint:1633
Change-Id: I3db9ab39f10a7f50f8d1e418ec508d4e709a24ff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106120
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Standardize how we refer to @size, @align and @offset.
Change-Id: I14d462a7e96e35e6c3d6dc5a11cc09f9a95eca15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106200
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This is cruft left over from file name collisions between ast / sem,
which has been resolved by splitting the build targets.
Change-Id: I0d65ffe97fed7095b37cc91a506dd05a20cda76a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106222
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Passing now on our infra, starting in MacOS 10.13.
Chromium has also dropped support for 10.12.
Bug: dawn:39
Change-Id: Ied22c00ffdcfa7c2ae4f122af8721defc2bbc5aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106020
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Variables can be declared in more than just BlockStatement.
For example, for-loops can declare a variable.
Change this to be a map instead of a vector. This helps with lookups.
Change-Id: Ic9429425af70e9535c21cc0875b875f145724266
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104040
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL add a `Backend::IsDXCAvailable` method that check not only the
DXC binary is available but also its version is no older than a given
minimum version, and use this function to replace all previous
`PlatformFunctions::IsDXCAvailable` to ensure that we always check the
DXC version. By giving the minimum version 1.4, this CL also forbid
using DXC older than 1.4.
Issue: tint:1719
Change-Id: I6ab0a3791ac734c4e8b13570c55194573f111e61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105900
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL updates the @group and @binding attributes to use
expressions instead of integers.
Bug: tint:1633
Change-Id: I91068874c104d5b84390f1617cb96265dda6e1e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105801
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>