The `fallthrough` statement is being removed from WGSL. This CL adds
a deprecation warning into the current implementation to prepare folks
for the upcoming removal.
Bug: tint:1644
Change-Id: I599984b6a30b39312c4b794a9ecd70f0f626c759
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98841
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>
This CL moves the GLFWUtils.cpp into a dawn/glfw/utils.cpp and
GLFWUtils.h into include/webgpu/webgpu_glfw.h. A build target
(`webgpu_glfw` alias to `dawn_glfw`) is added in order to allow
using that target in downstream projects without having to re-implement.
Change-Id: I93e85d5af3f486b3c754f2f854aafbda51901d6d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98700
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
libfuzzer contains preprocessor magic that makes doxygen choke.
Define `TESTING_LIBFUZZER_LIBFUZZER_EXPORTS_H_` so that doxygen skips over this header. We don't want to generate documentation for this non-tint code anyway.
Fixed: tint:1647
Change-Id: I084a6c3db0ffe492a62a1f9dcb0c30b68cebb9e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99040
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This is part of a workaround in the Chromium build infrastructure for
the fact that on Mac, the linker tends to strip LLVMFuzzer*
implementation because of how they are loaded/used.
All of the rest of the machinary is already setup and working, just
need to actually include the header. Dawn and other fuzzers use this
same fix.
BUG=chromium:1319605
Change-Id: Ifced8e0b29a48cdf64cd82002c90eb3c765b01c0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98880
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Adds the generated CTS test list to the existing gn/webgpu-cts group
so that Chromium tests properly include the generated file.
Also updates some existing BUILD.gn file paths to be consistent with
Chromium styling: relative paths without the leading ./ for files
under the current directory and directories before and separate from
individual files.
Bug: dawn:1479
Change-Id: Icce70e7fcee874b6b33c21230c8a4429a1f7ab6c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98801
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Switches the WebGPU CTS test runner JavaScript code to use the defined
message protocol instead of the ad-hoc solution we were using before.
Bug: chromium:1340602
Change-Id: Ieaf26b5b2409f69d7859d3db4ce7757780de6712
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98684
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@google.com>
This CL changes the MSL emission for struct initializers to emit the
struct name first.
`const a = {.f=float3(1)}` becomes `const a = Normals{.f=float3(1)}`.
This fixes an issues where the initialization happens inside an array
which the downstream compiler rejected without the explicit struct
naming.
Bug: tint:1641
Change-Id: I948b9ca94f4b89eac6d5bbbaa615b3d71d50c737
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98760
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This eagerly transitions external textures to be ready for export
on every submit. With this support, we can save the current submit
of export.
Bug: chromium:1258986
Change-Id: I92c2019ff486afc24adc190a1f7b2f85f416cd52
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97642
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
If a call to atan2 with args of type AFloat and AInt is made, Resolver
would correctly select the atan2(AFloat, AFloat) overload, but if the
input args were of type (AFloat, AInt), it would attempt to constant
evaluate without first converting the AInt arg to AFloat. The same would
occur for a binary operation, say AFloat + AInt. Before constant
evaluating, the Resolver now converts AInt to AFloat if necessary.
Bug: chromium:1350147
Change-Id: I85390c5d7af7e706115278ece34b2b18b8574f9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98543
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This will be needed by an upcoming CL that fixes call statements to
builtins that return a constant value. Without this transform, the
constant value reaches the backend, where we don't currently deal with
abstract numbers. Note that the other backends (HLSL, MSL, GLSL) already
use this transform.
Bug: chromium:1350147
Change-Id: Icc1f1416a07db228f8e3f39851a9ac079c48319f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98740
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This Cl spits the `expect_variable_ident_decl` apart to only accept
the `variable_ident_decl` grammar element. A
`expect_ident_or_variable_ident_decl` is added for the ident optional
version and a helper used by those two methods.
This makes it a lot clearer at the caller side how the calls relate
to the grammar.
Bug: tint:1633
Change-Id: I50aa4852926ff217129fe728e434255ed008da61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98661
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This is needed for a follow-up change to apply implicit conversions for
AFloat to AInt.
Bug: chromium:1350147
Change-Id: Id903322d01b7aa420452c3e0fc1fa4e1c480c794
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98683
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
ShouldMaterializeArgument must check that the deepest element is not
abstract numeric to support matrices.
This CL also enables the "no materialize" tests for binary ops, as
constant evaluation of binary addition was recently landed, and that's
what the test uses. The fix in this CL is also necessary for this test
to pass the matrix addition case (it would fail because it erroneously
materialized).
Bug: tint:1581
Change-Id: Id55341c05604c1ac560127826fc415eb38792503
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98682
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This patch enables Toggle::ApplyClearBigIntegerColorValueWithDraw on
Metal backends using Intel GPUs to workaround an issue about clearing
int32 and uint32 formats with big integer values that cannot be represented
by float.
Bug: dawn:1109, dawn:1463
Test: dawn_end2end_tests
Change-Id: Idb77f57ea5909ad67fa2a79956634bacfc2a2e15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98480
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
On the D3D12 platforms that don't support programmable sample positions,
the source box specifying a portion of the depth texture must all be 0,
or an error and a device lost will occur. This patch adds a workaround
for this issue by alignning the offset of internal staging buffer to 512
when calling Queue.WriteTexture() with depth stencil textures
Bug: dawn:727
Test: dawn_end2end_tests
Change-Id: I6bc5843d62d0aec3964ee5b544a06c0b2657031a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98601
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch implements the use of big integer values (>2^24 or <-2^24) as
the clear values of a render pass with an internal draw call as D3D12 API
only supports using float numbers as clear values.
Bug: dawn:537
Test: dawn_end2end_tests
Change-Id: Id0a7835d611f598fb77950915f69919f804a8702
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98104
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
If the return value of a builtin is a constant value, it may be an
abstract number, and our backends currently do not deal with abstract
numbers. As these builtins have no side-effects, and the return value is
unused, we can just drop the call altogether.
This is needed for the follow-up CL that fixes calls to builtins with
abstract args of different type.
Bug: chromium:1350147
Change-Id: Iebd853372fdb9242fe0f28706944eabe9df03459
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98542
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL syncs some more grammar changes into Tint. The `break if`
statement is stubbed out to be completed later.
Bug: tint:1633
Change-Id: I9223278288383698f9cdecc1ae854720cc55dd2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98660
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
- Run format on the current expectations file to make it up to date.
- It's a lot easier to read the failures when they are grouped by the bug.
Change-Id: I333a0b237ccd405d204e47809eb7ab723824fddd
No-Try: True
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98241
Auto-Submit: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
There seems to have been a race between changes and
SwitchStatement::body is no longer an std::vector but a utils::Vector.
Bug: tint:1110
Change-Id: I84d19049ecd54b1eba3f826e6c8c7d07ad3746ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98641
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This CL adds the `dawn_headers` into the `webgpu_dawn` library in order
to find the generated `dawn/webgpu.h` and `dawn/webgpu_cpp.h` header
files during the build.
An alias is added for `dawncpp` called `webgpu_cpp` so it can be used to
link instead of referencing dawn directly
Change-Id: I93fa97534e1e6e7aea349e5d7efb08807f6a0d61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98580
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>