Chromium tracks the devices which live on the wire so it can
automatically call tick on devices that have pending work. This used
to be done by querying an (id, generation) pair and checking if it
resolves to a non-null device.
This CL adds a new way to query directly using the device, since a
refactor in Chrome will change creation such that the id and generation
is not known when a new device is requested.
Also fixes a bug for device callbacks where the required callback
userdata wasn't fully populated for devices created with
requestAdapter. Update a test to check for this as well.
Bug: chromium:1315260
Change-Id: I7468edc3e77bade191e1e9f3eaadebbf4441d88a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89520
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Show the original source of non-uniformity when producing errors from
the uniformity analysis.
Bug: tint:880
Change-Id: Id386ae8fa5ff1b1443d54c0b5ef12ab76b3b3f13
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89723
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
When producing an error from the uniformity analysis, add notes to
show the underlying reason for the uniformity requirement.
For function calls that are required-to-be-uniform, show the innermost
builtin call that has the requirement.
For function parameters that are required-to-be-uniform, recurse into
that function to show where its requirement comes from.
Add some new tests to specifically test the error messages.
Bug: tint:880
Change-Id: Ib166fdeceaffb156a3afc50ebc5a4ad0860dc002
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89722
Reviewed-by: Ben Clayton <bclayton@google.com>
Move the control flow graphs to `FunctionInfo` so that they are not
destroyed when we finish processing the function.
This will make it easier to produce more detailed diagnostics for
uniformity issues, which will be coming in subsequent CLs.
There is no functional change in this CL.
Bug: tint:880
Change-Id: I1322fb54b16bd1c660799a62435fbdcd7fb39cb2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89822
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This implements the uniformity analysis as currently described in the
WGSL specification. Uniformity issues are presented as warnings, and
will be switched to errors in a future release.
A follow-up patch will improve the error messages, which currently
just show the point at which a uniformity was detected.
In a future release, once we have obtained initial feedback from
users, uniformity issues will become errors.
Bug: tint:880
Change-Id: I7d0b3080932c786c5d50b55720fec6d19f00d356
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88368
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Baker <alanbaker@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Bug: dawn:1410
Change-Id: I0ad4873474614bcd62638583bf905ff2742eaae2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89821
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
There is currently a race condition in the metal backend with the
updating of `mCompletedSerial`. It is currently possible for the
`addCompletedHandler` to set to one value and then have the
`CheckAndUpdateCompletedSerial` call immediately set it back to
a lower value. This can then cause hangs as the serial never
correctly updates again.
This was happening on `dawn.node` when running a large number of
CTS test cases all at the same time.
Change-Id: I28fc58ab2b3737ca8039559718e539ce819e88bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89780
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Otherwise, calling `Sem().Get()` on an empty loop continuing block
will return nullptr, which causes issues when inspecting the semantic
information of ast::BlockStatement nodes generically.
Change-Id: Ib3665b750c96eda02355fa879cf6300b8d69293a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89721
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
The scope stack has potential uses other than mapping from symbols.
Change-Id: I1eaedb9a9c913a7b2cda41bb99a986c552a66110
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89720
Reviewed-by: Ben Clayton <bclayton@google.com>
This is done via a new extension, which in the future could also be
used by shader authors as an escape hatch while we are still refining
the analysis.
The transform is run by the sanitizers for all of the non-WGSL
backends.
Bug: tint:880
Change-Id: Ibe90d7437d34c741a91eda65dff6d21d8469b9c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88464
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This CL adds the `-Wsuggest-override` and
`-Wsuggest-destructor-override` warnings and fixes up the identified
issues.
Change-Id: I0ec1303a822abc258ce34d3bf1900e37ade6a8dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89561
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
The incremental build can become stale for unknown reasons,
breaking presubmits. Disable it for now.
Bug: dawn:1395
Change-Id: I83a71da0006ee3184b8df2996d8e53b6efbcc20a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89640
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Unsuffixed float literals are currently treated as f32,
but will shortly become AbstractFloat. To keep tests behaving
identically to how they are currently, change all float literals
to explicitly use the f32 '_f' suffix.
Bug: tint:1504
Change-Id: I2a00725ee1b34a6efbe15ac4ba438c00c4416dd8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89402
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Any unhandled error or device loss in the tests that are not expected
should cause a test failure. Mocks other than StrictMock will not cause
a failure and instead just write to stdout (or not write at all).
Fixed: dawn:1412
Change-Id: I2dd108da8fa6ba2cd7967790de4d7fa4b9f821ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89600
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Use this for expressing negative i32s.
Replacing `i32(-123)` with `-123_i` is more readable as the former looks
like it should be generating a WGSL cast, which it does not.
Bug: tint:1504
Change-Id: Iead3885b903e1f707b8a7e6b9090d65930df118e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89401
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Enfore that the Expr(bool) overloads are only used if the argument type
is explicitly a bool.
Fix a test bug where this was happening.
Change-Id: I5d7520be4859a700265d62b322416a90f278b2d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89400
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Generate different tokens for:
• 'f' suffixed float literals
• unsuffixed integer literals
'f' and unsuffixed are currently both treated as f32 by the resolver,
but this is the first step to supporting abstract floats.
Bug: tint:1504
Change-Id: Id3b1fe420b6eb8901f88d6a5de06ef4f54aa3edf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89031
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This patch adds the support of dot4I8Packed and dot4U8Packed in
semantics under the extension "chromium_experimental_dp4a".
Bug: tint:1497
Test: tint_unittests
Change-Id: I659172fcb8953ba13b49664c6c9ad75724ff5957
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88962
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This avoids Tint validation errors between transforms caused by unused
entry-points having conflict with the remapped bindings.
Fixed: dawn:1363
Change-Id: If7d22d09905816bfe777ab22211af21513f98698
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89441
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
- Unexpected device lost should result in an error.
Fixes: dawn:1412
Change-Id: I6fe0b1ccc3e4b51cc85b9a058f8eac65c7622d89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89500
Auto-Submit: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This CL adds missing constructors and destructors. Others are moved
from the header file to implementation files.
Bug: dawn:1405
Change-Id: I06657d4a4faa437ca5a95a0067a8f9f9bbc89d12
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89181
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
• Declare all the unary ops in the intrinsics.def file.
• Reimplement the bulk of Resolver::UnaryOp() with the IntrinsicTable.
This will simplify maintenance of the operators, and will greatly
simplify the [AbstractInt -> i32|u32] [AbstractFloat -> f32|f16] logic.
Bug: tint:1504
Change-Id: Ifc646d086fc93cfbe3f3f861b8c447178664c1f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89028
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Removes check for Unsafe API toggle for multiplane external textures.
This is no longer needed now that the the implementation is functional.
Bug: dawn:1409
Bug: chromium:1323647
Change-Id: Iaf1c1b6bd053b68e306df61759ee9d81777f9b87
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89460
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
This CL adds some missing constructors and destructors. Others are moved
from the header file to implementation files.
Bug: dawn:1405
Change-Id: I17e98f6da48518112bafb0876679cc3989ba2548
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89160
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
• Declare all the binary ops in the intrinsics.def file.
• Reimplement Resolver::BinaryOpType() with the IntrinsicTable.
This will simplify maintenance of the operators, and will greatly
simplify the [AbstractInt -> i32|u32] [AbstractFloat -> f32|f16] logic.
Bug: tint:1504
Change-Id: Ie028602e05b59916c3f2168c92f200f10e402b96
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89027
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL moves the constructors and desctructors for the native
unittest mocks into separate cpp files.
Bug: dawn:1405
Change-Id: I20dccaa8114f3d7f8b61da1c1495648cb7328148
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89121
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Adapt the builtin parsing and resolving to also support operators.
Will be used to generate intrinsic table entries for operators.
This will simplify maintenance of the operators, and will greatly
simplify the [AbstractInt -> i32|u32] [AbstractFloat -> f32|f16] logic.
Bug: tint:1504
Change-Id: Id75735ea24e501877418812185796f3fba88a521
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89026
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>