Commit Graph

6 Commits

Author SHA1 Message Date
James Price 35f0fcaac0 tint/uniformity: Use non-recursive graph traversal
Fixes a stack overflow when traversing particularly deep graphs.

This changes the iteration order which changes some of the diagnostic
notes, but the diagnostics are still correct and deterministic so it
does not matter.

Fixed: chromium:47418
Change-Id: I2def633b6d96d1525027f7929b0fa0a6fba0efeb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90140
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-05-16 11:53:25 +00:00
James Price a89ff5981b tint: Show where control flow became non-uniform
Add additional nodes to capture places where control flow is changed
(if, switch, for, short-circuiting op, function call), and use these
to show the actual point at which control flow became non-uniform as a
result of a non-uniform value.

Do this recursively, to capture cases where control flow becomes
non-uniform after a function call statement.

Bug: tint:880
Change-Id: Ied92d690f98a5c11a1892eef500a50d0f123943d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89862
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-05-16 11:53:25 +00:00
James Price 7dd0ab791a tint: Show the source of non-uniformity
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>
2022-05-11 22:05:15 +00:00
James Price be656f7984 tint: Implement uniformity analaysis
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>
2022-05-11 22:05:15 +00:00
James Price 3b671cb377 wgsl: Separate struct members with commas
Use of semicolons is still supported, but deprecated.

Also updates the parsing methods for structures to better match the
WGSL grammar.

Bug: tint:1475
Change-Id: I7675ba42c13f91080b0ac173c352e0092021f80b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/84380
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-03-28 14:31:22 +00:00
Ryan Harrison dbc13af287 tint->dawn: Shuffle source tree in preperation of merging repos
docs/    -> docs/tint/
fuzzers/ -> src/tint/fuzzers/
samples/ -> src/tint/cmd/
src/     -> src/tint/
test/    -> test/tint/

BUG=tint:1418,tint:1433

Change-Id: Id2aa79f989aef3245b80ef4aa37a27ff16cd700b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80482
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-02-21 15:19:07 +00:00