Commit Graph

73 Commits

Author SHA1 Message Date
Albin Bernhardsson 04cef273d6 Fix broken links in docs
Change-Id: I795fd03a34f8faeaf0bf6ac7207267cebca8a5b8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132622
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Albin Bernhardsson <albin.bernhardsson@arm.com>
2023-05-15 14:51:24 +00:00
dan sinclair 5a5b7dfe92 Add builtin information to Symbol.
This CL extends the Symbol class to store if the content of the symbol could parse as a builtin.

Change-Id: I7e14ad944c1c9c43d900f9ccf8be6539ac9ea667
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127460
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-04-21 11:54:23 +00:00
dan sinclair d1d1bf7135 Split base_src apart.
This CL splits the base_src set in the GN build into a symbols_src and a
utils_src.

Change-Id: I39036a4ba5163aa816233b42d9a2ebfe34ddf038
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128361
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-21 10:54:13 +00:00
dan sinclair 12fa303899 Move castable into utils.
The Castable class is used by utils/. This Cl moves the implementation
into the utils/ folder. The `Is` and `As` methods are added into the
`tint` namespace to make usage shorter.

Change-Id: I0decedb92ebed01b6aa12d2e3efa7190742e9a33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127402
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-04-19 23:52:33 +00:00
dan sinclair c4cc6ec038 Remove the demangler.
The demangler is no longer used by the Tint executable, and nothing else
calls it, so delete it.

Change-Id: Ic47238e4a6126e5daacd81dfc6f5986524b648ba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127280
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-13 21:17:12 +00:00
Ben Clayton b549b3051e tint: Validate @must_use on functions and builtins
Fixed: tint:1844
Change-Id: I812dd338925c1dccaa3029a46e10a0ea34a8ed54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120960
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2023-02-22 16:18:22 +00:00
dan sinclair b92ff39724 Remove `static_assert` deprecation.
The `static_assert` builtin has been replaced with `const_assert`. This
CL removes the deprecation.

Bug: tint:1807
Change-Id: Ibcdc75e167bf6c1a6f74c295d9dcac7fff884d3a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120580
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-21 18:44:16 +00:00
dan sinclair 21571709a2 Remove the `type` keyword.
`type` has been deprecated in favour of `alias`. This CL removes the
deprecation warning and moves `type` to a reserved word.

Bug: tint:1812
Change-Id: I05246b9887a0890ae8343a0a132bd6f93353d5ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120540
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-21 16:55:07 +00:00
dan sinclair accc687b32 Add tint layering doc.
A simple MD file to show the source set hierarchy which constrains where
includes can go in Tint.

Change-Id: Ia360430793faef01503260f29f88ef361bb91611
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120443
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-20 09:56:29 +00:00
James Price d9c0f2178d tint/resolver: Make pointer aliasing a hard error
Fixed: tint:1675
Change-Id: I620ac9854395b35acd8d42090f854e37360983db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119001
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-07 19:40:01 +00:00
dan sinclair f374b819d9 Remove `sig` deprecation.
This CL removes support for the `sig` member in `frexp`. It is now an
error if `sig` is used, the deprecation is removed.
`fract` should be used instead.

Bug: tint:1766
Change-Id: I991544b675caf31f22c8c9472a60c77811ff4efd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117920
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-01-30 15:34:49 +00:00
James Price b4049dcf40 tint/docs: Add uniformity entries to release notes
Change-Id: Id66969fe22e5afd39ef83692dec5568d5c1aa7a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117803
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-01-26 13:02:59 +00:00
Ben Clayton 41884e4ebf tint: Update origin-trial-changes for parser changes.
Change-Id: Ia2571eea79bb7175b2578888c3e3857fff418b52
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117214
Kokoro: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-01-24 19:32:04 +00:00
Ben Clayton c98d57d662 tint: Rename 'static_assert' to 'const_assert'
Bug: tint:1807
Change-Id: I2c2a205ada01ad14d0bf6620a3dc3ec84dd7ee67
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117212
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-01-24 14:59:43 +00:00
Ben Clayton 9dc48bcef3 tint: Rename 'type' to 'alias'
Bug: tint:1812
Change-Id: I50bd8b036b47b4ec223a81eda53bd658d19645e9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117211
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-01-24 14:55:17 +00:00
James Price fe0c2a73e7 tint: TINT_EMIT_COVERAGE -> DAWN_EMIT_COVERAGE
Change-Id: Ic215fba55238d89f9790f071361e29fddfc3624d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116340
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-01-04 18:06:49 +00:00
David Neto 24c8440eb6 Update spirv-reader docs: supports texture and sampler func args
Change-Id: I893f050e3377c2aebe933a55d6e75c505c3e23d2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113560
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: David Neto <dneto@google.com>
2022-12-09 19:53:27 +00:00
Ben Clayton 543dd18d3c tint: Remove textureSampleLevel(texture_external)
Fixed: tint:1671
Change-Id: Iafed8d3ddbc99b80bbe70d3fc3847ac7a25c5e37
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110101
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-11-18 11:17:41 +00:00
James Price 4d65fc91bb tint: Implement pointer alias analysis
Track reads and writes to pointer parameters for each function in the
Resolver, as well as accesses to module-scope variables. At function
call sites, check the root identifiers of each pointer argument to
determine if problematic aliasing occurs.

The MSL backend passes pointers to sub-objects to functions when
handling workgroup storage variables, which triggers the alias
analysis. Add a validation override for this scenario.

Bug: tint:1675

Change-Id: I81a40d1309df65521cc5ad39764d6a09a260f51e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110167
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-11-17 17:27:27 +00:00
Ben Clayton 10fae7ac79 tint: Rename `frexp().sig` to `frexp().fract`
Fixed: tint:1757
Change-Id: Iacce6ab0f08f89abbe5831e6f2285a0c964e74d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110100
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2022-11-14 15:29:29 +00:00
Ben Clayton 55a8eace75 tint/resolver: Forbid workgroup pointer parameters
Fixed: tint:1721
Change-Id: I80a2cfc753f928facc165e1c8cd8c5af6c497550
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108701
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-09 20:11:43 +00:00
dan sinclair 5071a54af4 Make reserved words an error.
This CL moves reserved words from a deprecation to an error.

Bug: tint:1463
Change-Id: I5c66baa15dc748215877c8152171c690495bc0c2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108861
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-11-07 16:15:55 +00:00
dan sinclair 3b2b5484e2 Remove module-scope let deprecation.
This CL moves module-scope let from a deprecation to an error.

Change-Id: Iffecbb667cf79515234b6510ce7c5bbbb6e673bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108862
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-11-07 14:20:33 +00:00
dan sinclair f218af0461 Remove the `@stage` attribute
This CL removes the `@stage` attribute.

Bug: tint:1503
Change-Id: I1e31e96056a053f0c1e92b4bfc3c63c3592e9765
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108860
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-07 11:34:34 +00:00
David Neto 0e6d95bafd doc: Create overview of the SPIR-V reader
Describe the peculiare mismatches between Vulkan-flavoured
SPIR-V and WGSL that the SPIR-V Reader has to contend with.

Describe the solution in broad terms.

This is likely incomplete, but a good start.

Change-Id: I76992e9b830169d81cb55c46e849d9ad2f55c6c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105600
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
2022-11-01 03:54:42 +00:00
dan sinclair eee8d88210 Start adding IR.
This CL starts adding the basics for an IR for Tint. The IR is
a lower level representation then the AST with several of the
restrictions removed. For example, the IR is mutable, is a DAG
instead of a tree, and removes a number of WGSL constructs to
simplify transforms.

Bug: tint:1718
Change-Id: I6a16ac3116cee31410896c3a0424af7b41f958c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105800
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-10-28 01:22:58 +00:00
Ben Clayton 2e376a9bb0 tint/intrinsics: Allow mixing of signed / unsigned integer arguments
Fixed: tint:1733
Change-Id: Id83c5c5a59df062320a9a9fde087a34b85fbaa2a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107160
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-10-26 18:47:02 +00:00
Ben Clayton 13f089095f tint/intrinsics: Texture queries now return unsigned integer / vectors
To match the spec.

Also add a bunch of missing texture test cases to
src/tint/ast/builtin_texture_helper_test.cc. Fix all the tests that were
broken because these were not being exercised.

Fixed: tint:1526
Change-Id: I207b51d307bbdc054b595e0e0e0fd3330607e171
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106681
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-10-26 18:36:44 +00:00
Antonio Maiorano 0640c81073 tint: make uniformity analysis failures warnings again
Bug: tint:1728
Change-Id: I7684a49567d2e5c2c49f3c5b1d45a9fe543abbc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-10-26 00:27:38 +00:00
Ben Clayton 75bc93c0df tint: Fix const eval of type conversions
These were quite spectacularly broken.

Also:
* Fix the definition of 'scalar' in `intrinsics.def`. This was in part why conversions were broken, as abstracts were materialized before reaching the converter builtin when they shouldn't have been.
* Implement `ScalarArgsFrom()` helper in `const_eval_test.cc`. This is used by the new conversion tests, and also implements part of the suggestion to improve tint:1709.

Fixed: tint:1707
Bug: tint:1709
Change-Id: Iab962b671305e868f92710912d2ed07e3338c680
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105261
Commit-Queue: 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-10-11 20:36:48 +00:00
dan sinclair ff7cf21021 Rename StorageClass to AddressSpace.
This CL updates the internals to use AddressSpace instead of the old
StorageClass name.

Bug: tint:1404
Change-Id: Iecc208e839453437f4d630f65e0152206a52db7e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104420
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-10-03 14:05:23 +00:00
Ben Clayton 4c70d7fff2 tint: Make uniformity analysis failures a hard error
These have been warnings for multiple months.
Time to properly turn this on.

Bug: tint:880
Change-Id: I3b38f672309b5acd48c12a38dc5a1675f3c62470
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103480
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-09-26 12:30:05 +00:00
Ben Clayton c4ebf2cc57 tint: Implement textureSampleBaseClampToEdge
Fixed: tint:1671
Change-Id: Iaae5b5d571a4401c0255de727245bf8dbbe06740
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102642
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-09-22 22:59:16 +00:00
Ben Clayton 4d8fa43663 docs/tint: Fix OT notes.
Move notes in M106 which should have been in a new M107 section.

Change-Id: Id3cbe39b4889054d3b23202fb0da1d85afbab48b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103200
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-09-21 13:20:13 +00:00
Ben Clayton 751e6686aa tint/intrinsics.def: Implement saturate()
Fixed: tint:1591
Change-Id: I0b1397d74abd49cd44caf326a2063e50c5cf07de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101480
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-13 22:57:52 +00:00
Ben Clayton f3d9ea4bea tint: Error if statically indexing out of bounds.
Fixed: tint:1665
Change-Id: Icd5f24f3b4d6ebbdc18b536dc426da92558a3a4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101183
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-09-13 22:47:12 +00:00
dan sinclair 0e141c2d86 Add reserved words to the origin trial changes.
This CL updates the origin trial changes list to include the
deprecation of reserved words.

Bug: tint: 1463
Change-Id: I70aef6cdd68573413878d595928a7d92b40a275c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98064
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-08-03 14:34:16 +00:00
Ben Clayton f7953083e1 docs/tint: Documented addition of 'static_assert'
Bug: tint:1625
Change-Id: I20c51bd137796ea03e0085d69d46181e243970e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97964
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-08-03 12:12:25 +00:00
Ben Clayton cae5547aee docs/tint: Update OT changes for `array()`
Fixed: tint:1628
Change-Id: Ic865a0247176185b68e76513911341d0a4bbebd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97920
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-08-02 16:14:25 +00:00
dan sinclair 4abf28e29b tint: Add basic support for chromium_experimental_push_constant.
This extension adds support for the push_constant storage class such
that it can be tested with WGSL test files. The real goal is to allow
future transforms that will add push constants that the SPIRV writer
will output.

The extension:

 - Adds the `chromium_experimental_push_constant` enable.
 - Allows the push_constant storage class for global variables.
 - Adds validation that the types are host-shareable for push_constant
   variables, and that they don't contain f16 (must be 32bit types
   only).
 - Validates that at most one push_constant variable is statically used
   per entry-point.
 - Skips validation that the extension has been enabled if
   kIgnoreStorageClass is used.

Tests are added:

 - For parsing of var<push_constant>
   - Caught a missing conversion.
 - For each of the validation rules.
 - For the wrapping of push constants in structs if needed by
   AddSpirvBlockAttribute.
 - For the layout and type rules of the storage class.
 - For a shader with multiple entry-points using various push constants.
    - Caught a missing reset of the previous push constant variable in
      the validation check that at most one is used.
    - Caught the missing wrapping in structs that had to be added to
      AddSpirvBlockAttribute.
    - Caught incorrect logic when adding diagnostics about the call
      graph leading to the reference to push constants.

Bug: tint:1620
Change-Id: I04a5d8e5188c0dcef077f2233ba1359d1575bf51
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96682
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-08-02 15:55:35 +00:00
Ben Clayton 8b0ceea0b1 tint: Clean up legacy type cruft
Fix TODOs dating back to when types were an AST / SEM hybrid concept.
Bring the `arch.md` to reflect how things work today.

Bug: tint:724
Change-Id: I6bf4174158cf490f2839aeed78164b66e3410f27
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96141
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-07-15 17:16:49 +00:00
Ben Clayton f19cb029b8 tint: Remove single scalar matrix constructors.
These were never part of the spec, and they were not correctly
implemented for all backends.

Fixed: tint:1597
Change-Id: If1a23f1619c61c53baae277f1cf37aee4460ab7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95952
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-07-15 15:25:30 +00:00
dan sinclair cfa951a662 tint: Remove semicolon as struct member delimeter
Fixup a couple of internal Dawn shaders that used this syntax.

Fixed: tint:1475
Change-Id: Ibd6b3309944bfd955e724fef5d71d1297a84ef5f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93361
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-07-04 16:58:00 +00:00
Ben Clayton c64ca23d94 tint: Deprecated module-scope 'let' for 'const'
Enable the parsing of 'const'.
Warn on use of module-scope 'let', and automatically replace with 'const'.

Fixed: tint:1580
Change-Id: I214aabca80686dc6b60ae21a7a57fbfb4898ea83
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93786
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-06-29 00:55:36 +00:00
dan sinclair d23f296a9a tint: Implement acosh, asinh, atanh
Polyfill them completely for HLSL.

For the other backends, just add range checks for acosh and atanh.

Fixed: tint:1465
Change-Id: I3abda99b474d9f5ba09abf400381467dc28ea0bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94380
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-06-28 15:27:44 +00:00
Ben Clayton 53af158366 tint/reader: Allow module-scope 'var' type inferencing
Fixed: tint:1584
Change-Id: I193ad2c00faa4ae2001d981bb38a55d4d6a4c269
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94687
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-06-28 12:53:56 +00:00
dan sinclair 49d1a2d950 Add while statement parsing.
This CL adds parsing for the WGSL `while` statement.

Bug: tint:1425
Change-Id: Ibce5e28568935ca4f51b5ac33e7a60af7a916b4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93540
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-06-16 12:01:27 +00:00
James Price 3e38d7effe tint: Remove support for smoothStep builtin
The new spelling `smoothstep` was introduced in M102.

Fixed: tint:1483
Change-Id: Ia5e1401f8f09450a3a767b0bb975216bd85be8db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93360
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-06-15 23:32:14 +00:00
Ben Clayton 8174713752 docs/tint: Update origin trial changes for abstract-numerics
Bug: tint:1504
Change-Id: I2807051c1e0abd170607e2786eb9295f7b9d7e4f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93240
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-06-09 16:45:05 +00:00
dan sinclair 0fa572ff05 Emit deprecation warnings for @stage.
This PR enables the deprecation warnings for the @stage builtin.

Bug: tint:1503
Change-Id: I4a560f451a9ad56bc712f6a04c18eba6ae67ab64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93121
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-06-09 15:33:42 +00:00