Commit Graph

3181 Commits

Author SHA1 Message Date
Stephen White ba4d6ab01d GLSL: implement derivative instructions.
While Desktop GLSL supports the Coarse and Fine flavours, GLSL ES does
not. For now, emit dFdx/dFdy in all cases for ES, but excluding the
Coarse and Fine flavours via validation is also an option.

Bug: tint:1445
Change-Id: Iaac589f72043b5547e9141a6e870c1fd49631f6f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/82142
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-28 18:08:13 +00:00
Stephen White 3b68fcb544 GLSL: implement reverseBits().
Bug: tint:1431
Change-Id: I816ce26e98705f459e2fbc652d06d6fc97bab7fb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/82141
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-28 17:43:37 +00:00
Stephen White 10c554ecf4 GLSL: implement countOneBits().
Bug: tint:1430
Change-Id: I1aa886d1f68e50f0ce6fd5b55d87722742ca5f69
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/82140
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-28 17:41:47 +00:00
Ben Clayton 2e6269acb0 Use the new Switch() inferred types
Change-Id: I48ecd18957101631caa27480e7b1937a10791118
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81106
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-25 23:02:22 +00:00
Ben Clayton f33f1b41ff castable: Make Switch() smarter about return types
Infer the return type by finding the common type across all cases.
Types that derive from CastableBase will automatically infer to
the common base class.

Change-Id: I2112ca1abae34e55396685e9ebf2da12f8a6e3fc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80320
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2022-02-25 20:24:42 +00:00
Brandon Jones 6661b28d1e Delete Single-Plane External Texture Transform
The multiplanar external texture transform has been integrated into
Dawn, which means we have no use for the single plane transform - so it
should be deleted.

Bug: dawn:1082
Change-Id: Id8977d03839b76c90ae6e70400d048c13fbe85f4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80120
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-02-25 20:14:52 +00:00
Ben Clayton dbf75bc217 benchmarks: Fix path to benchmark files
Bug: tint:1378
Bug: tint:1418
Change-Id: I601d344c0fe5598b5ccc50dc1fc4cecf5a8f5357
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/82000
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-25 19:18:23 +00:00
Ben Clayton fe08ba4677 builtins: Add insertBits
CTS tests: https://github.com/gpuweb/cts/pull/1012

Bug: tint:1371
Change-Id: Idd55c0bc9dad1dffb558d0bc57d744f65e9041b5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81701
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
2022-02-23 21:18:09 +00:00
Ben Clayton d868e860e0 builtins: Add extractBits
CTS tests: https://github.com/gpuweb/cts/pull/1005

Bug: tint:1371
Change-Id: I228c7b2a27c6fbac0653c416fac603a6fb4bff85
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81640
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-02-23 21:18:09 +00:00
Ben Clayton 8169693136 builtins: Add firstLeadingBit
Currently polyfilled for all backends.
HLSL should be able to map this to 'firstbithigh', but there might need
to be some special case handling for 0 (undocumented behavior). For now
just polyfill.

CTS tests: https://github.com/gpuweb/cts/pull/1004

Bug: tint:1367
Bug: tint:1449
Change-Id: I9c9a08ea93d1c4a602e0ab763e95e2eea336fb0d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81503
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-23 18:20:30 +00:00
Antonio Maiorano 2680d1f846 Fix VS2022 build error
VS2022 fails with "error C7631: 'info': variable with internal linkage
declared but not defined" because Iguana's type info was not defined.
Moved globals out of internal linkage to fix it.

Change-Id: Ieb24ea04d4328971ada87bf39b7a0b1c2329e45c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81660
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-02-23 15:02:30 +00:00
Ben Clayton d14b30471b Remove test/builtins/gen/countLeadingZeros
Files left over from the Grand File Shuffle.

These already exist at test/tint/builtins/gen/countLeadingZeros

Change-Id: I3651e34b2390771947894a5ae29f95dad4c2adf4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81700
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2022-02-23 14:59:20 +00:00
Ben Clayton df3630c194 builtins: Add firstTrailingBit
Currently polyfilled for all backends.
HLSL should be able to map this to 'firstbitlow', but there might need
to be some special case handling for 0 (undocumented behavior). For now
just polyfill.

CTS tests: https://github.com/gpuweb/cts/pull/1003

Bug: tint:1367
Bug: tint:1449
Change-Id: I8125b32687196678906e5a9d056b4f2efd885073
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81502
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-23 14:32:14 +00:00
Ben Clayton f8672d8c35 builtins: Add countTrailingZeros
Requires polyfilling for all but the MSL backend.

CTS tests: https://github.com/gpuweb/cts/pull/1002

Bug: tint:1367
Change-Id: I0cf56b74c01f30436f9ad00595a554a4042587e4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81501
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2022-02-22 23:16:39 +00:00
Ben Clayton 27aa57ccac builtins: Add countLeadingZeros
Requires polyfilling for all but the MSL backend.

CTS tests: https://github.com/gpuweb/cts/pull/1001

Bug: tint:1367
Change-Id: I75097de945909e3242ede9001124d8821bc832bc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81380
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-22 23:13:39 +00:00
Ben Clayton 1fcb2a7a24 tools: Update post-shuffle paths for builtin-gen
Bug: tint:1418
Change-Id: Ic1560bf7a0aa99ecbe554b985dc07f1b055fab64
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81500
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-02-22 20:24:59 +00:00
Ryan Harrison 16d5739b73 Update fuzzer build path that was missed in the repo shuffle
BUG=tint:1418

Change-Id: Ie30d9859845b74b36775b56e0dd41ff731a63528
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81580
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-02-22 17:45:19 +00:00
Ben Clayton aa58a6934c test: Move unicode e2e test to tint dir
This got left out of the large reshuffle of dbc13af2

Bug: tint:1418
Change-Id: I0e55e19cdb8e3931ab87a99bce0e16b0cf5d5bff
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81320
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-21 16:51:06 +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
Ben Clayton 38f1e9c75c resolver: Optimize type dispatch with Switch()
Bug: tint:1383
Change-Id: Ia02c7ddd3e46d36134f5430e4f22df04993b2158
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81104
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Ben Clayton <bclayton@chromium.org>
2022-02-18 22:06:33 +00:00
Ben Clayton 473b6087ac Simplify traits, add CastableCommonBase & IsCastable
Use `static constexpr bool` instead of `std::integral_constant` for `IsTypeOrDerived`. This is often cleaner to use.

Add `IsCastable`, a helper for determining if all the template types derive from `CastableBase`.

Add `CastableCommonBase`, some template magic for determinine the most derived, common base type for all castable types.

Change-Id: Ia3d33548424750f8260f518ecd63d39949e4a826
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81105
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-02-18 22:05:53 +00:00
Ben Clayton 911944cc8d resolver: Error when calling shadowed functions
The fix involves unifying the dependency logic of DependencyScanner, which also cleans up the code quite a bit.

Also:
* Correctly resolve parameter type before declaring the parameter variable.
* Fix bonkers typos in utils::Lookup.

Fixed: tint:1442
Change-Id: I77b548e148b461f87ec10e8272c398f6fee297bd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81102
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-18 21:57:53 +00:00
James Price 3fac602d6c Minor fixups for unicode CL
This didn't make the M100 release branch, so update the release notes.

Fix a type in one of the E2E test names.

Bug: tint:1437
Change-Id: I36c018a126f412607a55ff254add60dae4fa9ae5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81200
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-18 21:47:24 +00:00
Ben Clayton d29d3d5740 reader/wgsl: Support unicode identifiers
Bug: tint:1437
Change-Id: Ie00ccb3e93d207111e55117dfc989f79b76164bf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80844
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-18 20:39:43 +00:00
Ben Clayton 1c6c6b19ab Put tint::debugger::Break() behind a build flag
Breaking isn't always desirable, as there are many tests that intentionally trigger ICEs, which are caught by a EXPECT_DEATH().

On Linux the break also performs IO, which will likely cause problems in Chromium's sandboxed environment.

Change-Id: Ic2e1f5d13c9e986c066eaf364ffa5759c7299f6a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81103
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-18 18:56:43 +00:00
Ben Clayton 16446e5b74 CMake: use `TINT_THIRD_PARTY_DIR`
Instead of '${TINT_ROOT_SOURCE_DIR}/third_party'

Fixed: tint:1435
Change-Id: I80622f490326ccba4580021dfe2b355a7586e307
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80760
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>
2022-02-18 14:26:49 +00:00
Ben Clayton 25c6505a64 kokoro: Use 'data' disk for build directory
Fixes spurious out-of-disk failures

Change-Id: I31c5f7f5c07c0f75826909de6444b8ef9cc8818e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81100
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>
2022-02-18 14:15:50 +00:00
David Neto 27605e505b spirv-reader: Ignore Restrict, RestrictPointer decorations
They have no effect in graphics APIs.

Fixes: tint:1440
Change-Id: I80a4b2f5875fbabbd53fd1ebd085ba146401ca71
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80980
Auto-Submit: David Neto <dneto@google.com>
Kokoro: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-18 10:32:19 +00:00
Ben Clayton 6f5316ba46 diagnostic: don't squiggle for unicode lines
If the line contains non-ascii characters, then we cannot assume that a single utf8 code unit represents a single glyph, so don't attempt to draw squiggles.

Bug: tint:1437
Change-Id: Ibd911200b03297f3e1b059ad7cc53fcba59e7714
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80846
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-18 10:26:39 +00:00
Ryan Harrison 7274b8ac19 Add missing documentation to fuzzer code
BUG=tint:1432

Change-Id: Id1c8710821077341ad04d12c1c55211043c84ca7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80861
Reviewed-by: David Neto <dneto@google.com>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-02-17 21:22:49 +00:00
James Price 0f56ed9759 tests: Validate WGSL output
WGSL was the only format that wasn't being validated for our E2E
tests, and this meant that WGSL backend bugs were sometimes going
unnoticed.

This change uses Tint's WGSL reader to validate the WGSL output.

Change-Id: I7d9e1c22feda530e7ba594725f21e576cf928647
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80961
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-02-17 20:43:19 +00:00
James Price 7161ae55c2 DecomposeStridedMatrix: Avoid reserved keyword
The `mat` token is a reserved keyword in WGSL, so don't try to create
identifiers that using it.

Bug: tint:1438
Change-Id: If3840aff35ab0ea937df776cd95920dd55157d9f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80960
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-02-17 20:43:19 +00:00
Ben Clayton 67f5c715a9 Add src/text
Implements a basic decoder for utf8 and codepoint tables for XID_Start and XID_Continue.

The first steps to supporting unicode identifiers.

Bug: tint:1437
Change-Id: I7371d1e63d664f3a3c34929221c7c6d043beb45d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80842
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-17 20:21:19 +00:00
Ryan Harrison 555e94e7e3 Fix legacy non-inclusive language issues
Explicitly filters out problematic files from presubmit with issues
that are not under our control, i.e. URLs.

BUG=tint:1433

Change-Id: I34a449c825edc39f934cbe9afa3436f7514f2808
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80860
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-02-17 15:03:19 +00:00
Ben Clayton c9735450c0 Remove stdout spam
Change-Id: Iaca6434003a0f10f5b35cce39cf48548f22f9114
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80843
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-02-17 14:40:58 +00:00
James Price afb02e8ec7 glsl: Add missing cstdint include for uint32_t
Change-Id: I0d5a8b5e844871028cae874b962b55b1af16fc54
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80880
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-02-17 00:03:10 +00:00
Stephen White 4a15605be7 GLSL: fix Select op with a bool vector condition.
The fix is in the mix().

Bug: tint:1429
Change-Id: Id128ead6b124cd364f45a860ad991977be94be5b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80660
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-15 20:00:27 +00:00
Stephen White 5f6a185d02 GLSL: implement textureNumLayers(), and update expectations.
Bug: tint:1426
Change-Id: I609a34be458c14deef866ab66d7b57b8ee6316f2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80580
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-15 17:58:07 +00:00
Stephen White ee38740991 GLSL: implement bitwise & and | on boolean types.
Bug: tint:1427
Change-Id: Ide2b89ac5f61237d0d39c1210dadaf9587c5db97
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80360
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Stephen White <senorblanco@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-15 17:52:37 +00:00
Antonio Maiorano ce982d8a06 HoistToDeclBefore: hoist to reference if expression is a reference type
Don't lose reference-ness of expression. This is necessary for
assignments via the hoisted variable, for example.

Bug: tint:1300
Change-Id: I8e633f20e50541bb70becc5069019f795ec11e01
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80540
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-02-15 17:04:47 +00:00
James Price d0ec88ce61 Add support for override keyword and @id attribute
This replaces the @override keyword that was previously used for
pipeline-overridable constants.

Support for pipeline-overridable constants in Dawn is hidden behind
the "disallow-unsafe-APIs" toggle, so we can make this change directly
instead of deprecating and continuing to support the old syntax.

Fixed: tint:1403
Change-Id: I9b2957a1e33b12772bfe449c0f3a31d929f8aa8b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80480
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-02-15 16:36:57 +00:00
Ben Clayton 5f60eb72c0 docs: Add GLSL backend to arch.md
Change-Id: Ifef0b3bb449de2bffc5bc3b84886d4f678971620
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80521
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-15 14:02:47 +00:00
Ben Clayton f1d570a11e docs: document that OOO-decls is now supported
Fixed: tint:1266
Change-Id: Ib78038bdf63dfeae6c2e328213560c37df41eb81
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80520
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-02-14 21:56:06 +00:00
Ben Clayton f95f11417e resolver: Use Switch() for type-dispatch
Bug: tint:1383
Change-Id: I9efbe6b3e7c0314a76f65b5e8969f1f20bcecf93
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/79771
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-02-14 10:05:16 +00:00
Stephen White 6f9ac3524a GLSL: fix isNormal.
(I know it's deprecated, I'm just being a completist.)

Bug: tint:1222
Change-Id: Ie7716d2f5dd2d2bd2245ba2b0fe7ed8705574de0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80141
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-11 14:35:14 +00:00
Stephen White 723f999ac2 GLSL: fix frexp and modf builtins.
These still had vestiges of HLSL.

Bug: tint:1222
Change-Id: I5f93f75e7384db641f0c5421dca24a3e8f2b716e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80140
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-11 13:41:23 +00:00
Ben Clayton 73e7988694 fuzzers: Shuffle module scope declarations
For the tint_all_transforms_fuzzer. Exercises the fact we now allow
declarations in any order.

Bug: tint:1266
Change-Id: I9ddfac90aaafe213cd860944f210718216cb3d13
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/79770
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-02-11 12:59:08 +00:00
Ben Clayton 6688b0a3c7 resolver: Enable support of out of order declarations
Allow module-scope declarations to be made in any order.

Bug: tint:1266
Change-Id: Ib2607b6c33fad7c83e2c36f85b0a965eac922ec5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/79769
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-02-11 12:59:08 +00:00
Ryan Harrison 98facb28ab Add my @chromium.org account to OWNERS
Change-Id: Ib61ff92d373b63c39bbf664a2c67d5f0b8e9bd2e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80080
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-02-10 19:57:53 +00:00
Antonio Maiorano 0bb04c2057 Split back out two transforms previously combined into PromoteSideEffectsToDeclTest
That is, bring back both VarForDynamicIndex and
PromoteInitializersToConstVar. This is not a complete revert, though:
*  VarForDynamicIndex no longer depends on ForLoopToLoop
* Both can cope with hoisting from "else if"
* More unit tests were added in the interim

Delete PromoteSideEffectsToDecl for now. This may be brought back to
handle ensuring order of evaluation.

Bug: tint:1300
Change-Id: I8bbae46377ec4603cc02c1eb3f0661a8461a19fa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/79940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-02-10 18:50:38 +00:00