This CL is based off of https://dawn-review.googlesource.com/c/dawn/+/113561
and adds the updates into `libtint_syntax_parser_src` to allow the
resolver to build correctly when the headers are added.
Change-Id: I5d14a88111ea1bf87bb2155d066b95378163e451
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117588
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
A bad assert was causing devices that only supported Vulkan 1.0, such as
the Nexus 5X, to crash when querying information about adapter
properties and features. This change removes the need for the ASSERT.
(Note that this does not guarantee WebGPU support on Vulkan 1.0 devices.
For example, the Nexus 5X does not have the fragmentStoresAndAtomics
feature, which is required for WebGPU.)
Bug: dawn:286
Change-Id: I7f884290f29ae7e9607933f6186feac2ce8af540
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117840
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This CL moves the ast files into a libtint_ast_src source set. Similar
to sem, the headers are duplicated into the libtint_syntax_tree_src due
to the dependencies with program_builder.
This makes the sem and ast source sets be setup the same.
Change-Id: If51fac6fab6763c4dcf729061de6ef983a94063a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117587
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
So the next MapAsync() call, doesn't need to record pipeline barrier
command into the pending command buffer, submit it, and wait for it
completion.
Bug: b/265152896
Change-Id: Ied7cbca24a7b1bc81c0a6402179452599aabfe9b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116920
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
The fuzzer produced a shader with this format and hit an UNREACHABLE
in Dawn.
Bug: dawn:1641, chromium:1410048
Change-Id: Ia5ba66a18fc718f7e6dd803f4229ecb12b02753e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117531
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL removes `libtint_core_src` and folds the dependencies into
`libtint`. Uses have been updated to require the specific libraries they
depend on.
Change-Id: I91118cc9db376c53597a8e588db654b3a4105386
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117586
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL renames the source set to make it clear it does not include all
files in tint.
Change-Id: Ib37603ca8d46e2920d3f3c6d79a59a292493c3fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117585
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This cl moves a couple more files up to `base_src` and splits tint.cc
out to a separate `initializer` source set.
Change-Id: I65347ac182f3434a57cc49f0eeb1024f6adb52b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117584
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This CL extracts the inspector from libtint_core_all_src and into a
libtint_inspector_src.
Change-Id: I0b138cc2e47526b8575b6f31cc3e15fc8bd92545
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117583
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL moves the constant and type headers out of the
`libtint_core_all_src` target. In order to do so a `libtint_base_src`
target is created with the bits of core_all that are required to build
constant/ and type/ along with all the util/ files.
Change-Id: Idb016f51e9dcaa84b6d7a14e4e5f62d4a46a4161
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117582
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This will be used for suggesting alternative diagnostic rule names in
the Resolver.
Bug: tint:1809
Change-Id: Icc9af02937326f6f774fbaf2aeaa9314c88fdea6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117565
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Switch the default severity for all uniformity violations to errors.
We now have an opt-out mechanism for deriviative operations (via
diagnostic filters), and a `workgroupUniformLoad()` builtin for
compute shaders.
Bug: tint:1809
Change-Id: I666c706d6195ca0d24ead14c4709e7f646bfcc64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117741
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
When used with the SPIR-V reader, this will insert a module-scope
diagnostic directive to suppress uniformity violations for derivative
operations.
Bug: tint:1809
Change-Id: I2305265231ccffad49461d194669ba598484e8e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117740
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Add additional `RequiredToBeUniform` nodes for each severity
level. When processing a call to a derivative builtin, look up the
severity from the semantic info for that AST node, and add an edge to
the corresponding `RequiredToBeUniform` node.
Propagate the severities to the callsite and parameter tags for a
function that contains a builtin.
Traverse that graph from each `RequiredToBeUniform` node to look for
violations at each severity level, starting with the most severe. Only
stop the analysis if an error is found, otherwise report the violation
and keep going.
Bug: tint:1809
Change-Id: I4ac838e85da3f4fb3d63f4892dce7f12b096f74b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117602
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Each sem::Node has a map which stores the diagnostic modifications
applied to that node. The sem::Info class provides a query to get the
diagnostic severity for a given AST node, by walking up the semantic
tree to find the tightest diagnostic severity modification. The
default severity is used if it was not overridden.
This allows components outside of the Resolver/Validator to determine
the diagnostic severity while walking the AST, which is required for
the uniformity analysis.
Bug: tint:1809
Change-Id: I4caf99d7412fb22fb1183b2c8cfde349da2fefd3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117601
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Future patches will expand the places where they can be used.
Bug: tint:1809
Change-Id: I74d87ce5164119ae1351380041f9ef4b1091d854
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117571
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Push a new diagnostic filter scope at the start of resolving a
function and process function attributes immediately.
Bug: tint:1809
Change-Id: I8a7f4a29e4b7556d0721ed28c49d795c166fea00
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117568
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
The Resolver parses the diagnostic rule and sets the updated severity
in a ScopeStack, which is stored in the Validator.
Automatically generate the diagnostic rule enum and its parsing logic
using intrinsics.def.
Add a "chromium_unreachable_code" diagnostic rule to test this.
Bug: tint:1809
Change-Id: Ia94db4321b8019f01d31a84da0fda25dfdf72f5c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117566
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Drop the `(opening|closing template argument list)` bit. It makes for messy diagnostics.
Change-Id: I92d29ece8a012362dd16da297089aab908571415
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117213
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
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>