Instead of using an `if` node that has a list of `else` statements,
make each `if` statement have a single optional `else` statement,
which may itself be an `if` statement (or just a block statement).
This better matches the WGSL grammar (now that we have removed
`elseif`), and simplifies various pieces of code that handle these
statements.
Change-Id: Ie4272f1422224490ac598a03aa8b4dd00ba03010
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: James Price <jrprice@google.com>
Implement an expectation parser, data structures and writer.
Bug: dawn:1342
Change-Id: I53587a9b55346ccf1543e15c9cec5ff68c6849ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87641
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
- Factors out device creation code to helper.
- Updates callbacks and test infra to support different devices and use mock callbacks.
- Updates some tests that were using outdated device lost callbacks and multiple devices.
Change-Id: I4210280420b8dadbc6355d27995ccf0cd864108c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87480
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This workaround replaces the toggle that forbids creating mipmapped
R8Unorm and RG8Unorm textures on Metal. Instead it adds a Metal render
pass workaround that renders to a temporary texture under certain
conditions, then copies back to the correct mip level.
The texture lazy-clearing code is also changed to use the helper that
does workarounds for Metal render passes.
A test is added that triggers the issue with a small amount of code, but
more extensive coverage is left to the CTS. For example texture_zero
tests caught multiple issues during the creation of this CL.
Bug: dawn:1071
Change-Id: I7ef1151524e71e5a9a8e8f5205d9b554bee438b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87864
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
These suffixes existed because the GN build errored when there were two files sets with the same name (ast + sem).
This is no longer required as the GN build splits these into two separate targets.
Change-Id: Ib451da33a5f4aa5c867cb99419dd252766dc3daa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88308
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Operand is just a tagged union of uint32_t, float and std::string.
Use std::variant for this.
Reduces memory size, and removes the need to always construct an empty string when the operand is float or int.
Bug: tint:1383
Change-Id: I02fc10137d6fab410ea25a8d6c6e279b882b2287
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88302
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This PR cleans up some of the documentation post Dawn+Tint merge.
The README is better combined, the building document is moved up
a level as it covers both Tint and Dawn. The various duplicate files
are removed.
Bug: dawn:1339
Change-Id: I829fbc32529a304fbc55eac3fda86d52c1a6952e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88340
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
ScopeStack is not needed here - the resolver already provides variable scoping with the sem::Variables.
Re-purpose scope_stack_ for a stack of Scope, which now holds the type constructor -> SPIR-V ID map.
This map needs to be per-scope, to fix issues like crbug.com/tint/1520
Fixed: tint:1520
Change-Id: Ifa7749338abf63652a1369e76cf5400be1c37298
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88301
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Chromium requires macOS 10.11 so we no longer need to special case this
in Dawn for Metal support anymore.
Bug: None
Change-Id: Ib5dee5464a3ec27abdd0f5c62e51caa42171fadb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88303
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Also mark all the skips for time out the same way for easier grepping.
Change-Id: Ie071df30431bded7838205c3a18483a5233687c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88341
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
These methods produce `let` declarations.
With creation-time expressions, we'll need to add `const` declarations.
Note that module-scope `let` declarations have been removed in the spec (for `const`). ProgramBuilder::GlobalConst() has not been renamed, although it still currently produces 'let' declarations.
Bug: tint:1504
Change-Id: I34f6d62236f0572163fc9c2d8fddfe4503817422
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88305
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Concatenating strings to use for cache keys is horribly inefficent and very error prone.
Add a UnorderedKeyWrapper helper to allow types to be used as a unordered_map and unordered_set key. Use this for the type_constructor_to_id_ map.
Produces SPIR-V with some duplicate SPIR-V instructions for constructors removed.
Change-Id: Ib072d485ca28bb07f03e979c133cdce1f69ee482
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88300
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Go tooling does not work properly when modifying go files in subdirectories from the root of the IDE.
Consolidate the two go modules in the source tree.
We'll eventually want to move `src/dawn/node/tools` to `tools/src`.
Allows us to type `go test ./...` at the root, and test all go code in
the entire repo.
Bug: dawn:1342
Change-Id: Ie3dd2c89a769cd25c2b68884970ef0f2ba8c7560
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86532
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The UniformConstant storage class was renamed to Handle in the WGSL
spec. This CL updates Tint internals to match.
Bug: tint:1138
Change-Id: I93ec581575955ab6830eb8aea44f74dbc28e9ef5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88280
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Roll chromium/src/build c7876b5 .. 87b04ad
Roll chromium/src/buildtools e1471b2 .. f0d740e
Roll chromium/src/tools/clang df9b14e .. 3c4a622
Required to roll ANGLE as it now uses new Clang flags.
Change-Id: I55caa9892ff65ebc4852b2d49df88908ee1ca3e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88221
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
- Use a while loop to pop the list instead of iterating it and deleting at the same time.
- Adds regression tests to verify that the fix works.
Bug: chromium:1318792
Change-Id: I84fb494c64b07d3e1bd2b5b3af7cb9f82eee28b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88043
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
This change ensures that when errors are raised from WebGPU, including
lost context errors, they can include any associated D3D12 validation
layer messages in the message text if backend validation is enabled.
This will allow these messages to be surfaced in places like when
running CTS tests on browser build infrastructure.
Also makes a minor adjustment to how HRESULT codes are reported so that
they're easier to read.
Bug: dawn:1396
Change-Id: Ib5c039157c57e6926bc82941a68be03e33e9084c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88044
Commit-Queue: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
ES requires GL_EXT_texture_format_BGRA8888 or GL_APPLE_texture_format_BGRA8888 to create BGRA8 internalFormat textures, and GL_EXT_read_format_bgra to read from them. Desktop GL can swizzle back and forth from RGBA8, so keep using RGBA8 if the extension is unavailable.
Intel's implementation of GL_EXT_texture_format_BGRA8888 on ES is broken, and won't create GL_BGRA8_EXT or GL_BGRA internalFormat textures, so disable the test there and modify another test to not use BGRA textures.
Change-Id: Ia81d9ff20e2849b00379f8e01fb5d2ecfa34bd53
Bug: dawn:596, dawn:1393
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86744
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
In follow-up commits these workarounds will be used in more than just
the CommandBuffer but also for lazy-texture clearing. In this CL the
helpers are just moved and changed to take `encodeInside` as a
std::function.
Bug: dawn:1071
Change-Id: Ib3b90826c89e12edca41223b3c8b5a4cfc6fed04
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87863
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
It is failing for a single format when trying to copy to a buffer
because the depth-specific format for depth23unorm-stencil8 buffer is
depth24plus which is not copyable.
Bug: dawn:1388
Change-Id: I034145bf55d42403ded23b1b9acf974d85770d42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87701
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
In this patch, `i` suffix for SInt literal is added, making `-234i`
valid. Meanwhile, validation of UInt literal must not be negative is
add, making `-42u` invalid with proper error message.
Bugs: tint:1514, tint:1515
Change-Id: Idd0e9ae5649a62e7d348c29f95c2570049653bd8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88140
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
In this CL the enable directive is implemented.
1. Add AST node for enable directive, assign a ExtensionKind (enum) for
each supported extension.
2. Use an unorder_set in ast::Module to record all required extensions'
kind.
3. Provide inspector methods for getting names of used extension, and
getting all used enable directives' extension names and location.
4. For different writer, the extension nodes are handled in different
ways. MSL and HLSL writers will just ignore the extension nodes, while
SPIRV and GLSL writers will emit corresponding code.
5. Implement unittests and end2end test for enable directive and
inspector, using a reserved extension name `InternalExtensionForTesting`.
Bug: tint:1472
Change-Id: I40cb4061554deb477bc2005d7e38c9718385f825
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86623
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
- Removed to allow for easier development changes to caching interface as it is implemented for pipeline caching without having to keep supporting this incomplete feature.
Bug: dawn:549, dawn:1341
Change-Id: Id27deca45ac5607a4a6a7a016b19e3d60693ed72
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87610
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This PR adds the validator_is_storable test into the CMakeList file
correctly and removes the helper files. The resolver helper is used
instead and a test helper to return the validator added into the
resolver.
Change-Id: I5b18bcc6373e3b39807af05cf5c058fab61ed4ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88041
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
If the URL ends in a slash, this would fail to match the gitcookies file
Change-Id: I987ec637b2f6db172d4173938960060321722bfe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87920
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Update expectations and ts_sources
501cb36438..e23ca12d57
- e23ca1 Remove old builtin combined function file. (#1220)
- 15883e src/webgpu/util/texture/texel_data: Use `,` for member delimiters (#1215)
- 719dff Add a test with a Unicode character which would normalize (#1194)
- deeb73 Remove uniqueId and plan_autogen from WGSL tests. (#1219)
- 47cb99 Add a quiet option to the test runner. (#1190)
- 115652 Rename generic WGSL shader_io test case. (#1199)
- 74dc27 shader/execution: Reduce `atan2` cases (#1198)
Created with './tools/run cts roll'
Change-Id: Id6d29fce42e9c647338795074a13e6a5a6034787
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87980
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This macro does not exist in this scope.
This was added in https://dawn-review.googlesource.com/c/dawn/+/87600, but was previously a comment.
Should fix dawn -> chromium roll
Bug: dawn:1339
Change-Id: I8457e1ae14b0c199f32f9c1a8b7487b6a8c8120c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87921
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
- Since we were recording everything, the sparse representation caused uninitialized data to be recorded in the cache key causing cache key inequality at times.
Bug: dawn:549
Change-Id: I7dc3ea34a7dd91addc7b5ca52c79b3354733966b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87609
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>