Applies a heuristic to disambiguate less-than / greater-than from template argument lists.
This function is not currently used by the parser.
Bug: tint:1810
Change-Id: Ibd72dbae53b3159282177bf79c00ad0808b123a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117208
Kokoro: Ben Clayton <bclayton@chromium.org>
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>
The HLSL/MSL includes in data_builder.h appear unused, but gn was
flagging them as problematic when attempting to build with the
corresponding tint_build flags disabled.
module_clone_test.cc is dependent on the WGSL reader and writer, but
was not gated on the corresponding tint_build flags in BUILD.gn.
tint_unittests_transform and tint_unittests_glsl_writer were both
dependent on the WGSL reader/writer, so added it as an explicit
dependency.
Bug: dawn:286
Change-Id: I20906414e8173065eef9403c9e9c05286afeaee9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117580
Auto-Submit: Brandon Jones <bajones@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
The type/ folder had a hold over include of program_builder. The builder
isn't actually used in the types so this CL removes the include and adds
the relevant includes to fix building.
Change-Id: I787b398fe149f483d007bb623ab3ed42850875c5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117581
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Could be split when matching template argument lists.
Bug: tint:1810
Change-Id: I34421d2a27a8b2294fa0201793e7340c0f172df7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117209
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Automatically generate the diagnostic severity enum and its parsing
logic using intrinsics.def.
Bug: tint:1809
Change-Id: Ia7cc59202b389eeea49fd582f5821d271978f233
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117561
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
This cl pulls the text/ files out of the all source list and into a
libtint_text_src source set.
Change-Id: I7f7e5d764e0590b07ee21a7e4510dbd5c2decce4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117620
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL moves the SamplerKind enum out of ast/sampler and into
type/sampler_kind. This breaks the dependency on ast from type.
Change-Id: Icaf82dd1cca5782bf66993441c7b478332bb76a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117607
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL moves the texel_format code from ast to type to remove the
dependency on ast from type.
Change-Id: Ie075b2315360dc782284a7b4b55a817a9de31d78
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117606
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL moves the ast/access files into type/access to resolve the type
dependency on ast
Change-Id: Ic0973c5ad162166736abb07cf9bbed7efa91695b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117605
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This CL moves the transforms out of the `libtint_core_all_src` and into
a `libtint_transform_src` build target.
Change-Id: I44ac4d4a3da9f66b4b7f9e821ecced87d8b227f0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117243
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL moves the ast/address_space to type/address_space. This breaks
the type dependency on ast for AddressSpace.
Change-Id: Icb48e7423e18904865ec735024eb3b9864c947c2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117604
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This cl pulls TextureDimension out of ast/texture and into
type/texture_dimension removing a type dependency on ast.
Change-Id: Icf06ec32ee9051286f169ae9538c48416f513039
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117603
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL splits the code in `reader/` and `writer/` out of the
`libtint_core_all_src` target and into individual `libtint_reader_src`
and `libtint_writer_src` targets. The various readers and writers are
updated to have the specific target as dependencies.
The `deps` are moved to being private from `public_deps`. The places
where dependencies were missing are updated.
Change-Id: I4e30113cdc6b1e1941efa34ce6579f8f501201ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117242
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Adds a toggle to workaround another issue where Metal fails to set
the depth/stencil attachment correctly for a combined depth stencil
format if just one of the attachments is used. The workaround forces
both attachments to be set, giving the unused one LoadOp::Load and
StoreOp::Store so its contents are preserved.
Bug: dawn:1389
Change-Id: Iacbefcc57b33bf11ca8fcacb03506301646fe59d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117175
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This CL fix FeatureState for some experimental features to prepare for
refactoring adapter creation with adapter toggles. This CL also fix the
related unittests.
Bug: dawn:1495
Change-Id: Ibf043ed74c0bfc79c64986f2f96135d92adf3930
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116841
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Zhaoming Jiang <zhaoming.jiang@intel.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
If tint_build_spv_reader = false is set in a Chrome's build_overrides
then the tint_unittests_spv_reader_src begins failing with a bunch of
missing spvtools identifiers.
Most uses of spv_reader_src include it as a conditional dependency only
when tint_build_spv_reader is true, Chrome's `all` target always builds
it. This causes problems when critical includes are excluded due to the
tint_build_spv_reader setting. The solution is to not make use of the
TINT_BUILD_SPV_READER define at all in this subdirectory and instead
assume that the entire directory will be included or excluded as needed
at a higher level.
Additionally, one switch statement in tint_common_fuzzer needed to have
the scope of it's TINT_BUILD_SPV_READER exclusion reduced so that it
wouldn't trigger warnings that not all enum values were covered.
Bug: dawn:286
Change-Id: I53518e2fda497fe976721b5f087e2e21a170f5dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117244
Reviewed-by: dan sinclair <dsinclair@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Browsers won't be exposing the ability to pass SPIR-V shaders, and the
ability to consume and validate them is adding a non-trivial amount to
the browser binary size on platforms like Android. To avoid that
overhead, this change puts those features behind a flag so that browser
usage can easily omit them.
Bug: dawn:286
Change-Id: Idf70683f2c4ccf479b723c00ba6914e27e4f765f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117241
Commit-Queue: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Add the last usage serial in Buffer, it is used for optimizing
MapAsync(), so the callback of MapAsync() is called when the last usage
serial is done instead of using the current pending serial when
the MapAsync() is called.
Bug: b/265151060
Change-Id: Ibc95d4e41d41896f0a49b0fd1068912b46ea14e1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116693
Commit-Queue: Peng Huang <penghuang@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This CL updates a few shader expectations with the relevant issue
number.
Change-Id: I8c38857a51276f4cc3206ee8617f3edda747a301
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117480
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This reverts commit 1966ea9727.
Reason for revert: dawn:1619 has been fixed.
Original change's description:
> DISABLE WireBufferMappingReadTests.DestroyInsideMapReadCallback
>
> It is failing under ASAN but should be fixed after at the same time as
> issue dawn:1619 that makes mapping callbacks called only at the end of
> the BufferBase method.
>
> Bug: dawn:1619, dawn:1621
> Change-Id: Idfdb6e36432a47eaef63b46e041f1404a2562f40
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116284
> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Austin Eng <enga@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:1619
Fixed: dawn:1621
Change-Id: Ib700147543c12b35005b718b50ed1b19245cf0ff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117440
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This CL removes StagingBuffer to start to unify implementation
code paths for WriteTexture/Buffer and CopyBufferToTexture/Buffer.
This will help implementing a buffer-to-stencil copy workaround.
Bug: dawn:1389
Change-Id: Ieb23b8d871f14544ef01445a495dc1077274c9f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117167
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
WebGPU clears [pending_map] before resolving or rejecting promises,
which means that the callback for .then or .catch is allowed to unmap,
remap, or do anything with the buffer assuming previous mapping
operations are entirely done the buffer.
Mimic this in Dawn by finishing all operations related to mapping
before calling callbacks they might trigger.
bug: dawn:1619
Change-Id: I9e5b82789a68f28a496a54c31bf9fe0ffde23ccf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116220
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
Reviewed-by: Austin Eng <enga@chromium.org>
Polyfill this for the SPIR-V, HLSL and GLSL backends by replacing bgra8unorm with rgba8unorm, and swizzling.
Bug: tint:1804
Change-Id: I36638202840d7313001dff6c5b60dcb948988c34
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117204
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Stencil to buffer copies don't capture contents
written in a rendering stage. Copying through an
intermediate texture fixes this problem on Metal Intel.
Add test for the code path that found the issue:
Nonzero-mip stencil copy, discard, then read
Bug: dawn:1389
Change-Id: I63d982df6bace4b5053d3c643b8abda1682490d1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116851
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Currently Queue::SubmitImpl() may cause two queue submissions, one is
because of Tick() call which will submit pending commands if there are.
The other one is after converting frontend commands to backend command
buffer. Queue::SubmitImpl() will submit converted commands. However
usually queue submissions are expensive, so merge those two queue
submissions into one by not calling Tick() before converting frontend
commands, so pending commands and recorded commands can be submitted
together. After that, we call Tick() to resolve callbacks and perform
bookkeeping operations (deallocating memory for passed operations,
etc).
Bug: b/265151060
Change-Id: Ia171771bcc1061dc599a58aa6d213a645696fb75
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116929
Auto-Submit: Peng Huang <penghuang@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>