Ben Clayton
558a3537c9
reader/spirv: Don't pass invalid programs to DecomposeStridedMatrix
...
This transform expects valid input.
Fixed: chromium:1233795
Change-Id: I6460bded0a7e89888a4b034e792db6dc07012127
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60348
Auto-Submit: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-07-30 16:05:26 +00:00
David Neto
9d4c24fa5e
spirv-reader: ldexp second argument must be signed
...
Fixed: tint:1079
Change-Id: I628b81d95201474c6d1c584eafacd125448de30b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60240
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-29 17:54:35 +00:00
David Neto
c1cfa84ff9
spirv-reader: reduce fragment output location
...
MSL compiler requires colour output location at most 7.
Bug: tint:1043
Change-Id: I2b0c09fecae124cc4af05712d7f3c872c2f93f99
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60081
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: David Neto <dneto@google.com >
2021-07-28 15:49:27 +00:00
Ben Clayton
97668c8c37
reader/spirv: Handle the MatrixStride decoration
...
Add `transform::DecomposeStridedMatrix`, which replaces matrix members of storage or uniform buffer structures, that have a [[stride]] decoration, into an array
of N column vectors.
This is required to correctly handle `mat2x2` matrices in UBOs, as std140 rules will expect a default stride of 16 bytes, when in WGSL the default structure layout expects a stride of 8 bytes.
Bug: tint:1047
Change-Id: If5ca3c6ec087bbc1ac31a8d9a657b99bf34042a4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59840
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
2021-07-27 08:17:29 +00:00
Ben Clayton
fd35aa8e47
Implement texture_depth_multisampled_2d
...
Implemented for all readers and writers.
Cleaned up some verbose code in sem::Function and the Inspector in the
process.
Fixed: tint:1032
Change-Id: Ia6f2f59e6d2e511c89160b97be990e8b7c9828d9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59664
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Auto-Submit: Ben Clayton <bclayton@google.com >
2021-07-26 22:19:48 +00:00
David Neto
60d1eb6688
spirv-reader: fix emission of arrayLength
...
Pass a pointer argument instead of a reference argument.
Also handle the case where the argument is the result of
an OpCopyObject, which will generate a let-declaration of pointer
type.
Fixed: tint:1042
Change-Id: I25b1b7b95ade1b79130e51691194f32b3240e013
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59451
Auto-Submit: David Neto <dneto@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-26 19:29:38 +00:00
David Neto
1fd3d95dd5
spirv-reader: disable dumping for known bug
...
Bug: tint:1043
Change-Id: I43759420c1d4f7104de02645505c23049bd867eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59450
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-26 19:22:59 +00:00
David Neto
85ca807a00
spirv-reader: fix unit test validity
...
Use Private or Function storage instead of Workgroup storage.
Bug: tint:1043
Change-Id: I07055c30c8b89c9661c2a4913b0c03c3dff5a75b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59562
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-26 18:54:28 +00:00
David Neto
ad8eccea6f
spirv-reader: fix storage class for pointer-to pipeline builtins
...
The DefInfo structure is used for remapping storage buffer types
as well as tracking special values like builtin variables.
In the latter case, don't take the defaulted storage class value
from the DefInfo initialization.
Fixed: tint:1040, tint:1043
Change-Id: I41ee364d76e632736d51f4474c97036bcc136c93
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59484
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-26 18:23:58 +00:00
David Neto
4e4cef90fe
spirv-reader: disable dumping for known incorrectness
...
Bug: tint:1043, tint:1039
Change-Id: I6de89097d166df30bcf573ec77b9af6f09eb3d75
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59483
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-26 18:09:59 +00:00
David Neto
1444a2e117
spirv-reader: fix mapping of OpLogicalOr, OpLogicalAnd
...
These work on scalar and vector of bool, and map to ast::BinaryOp::kOr
and kAnd.
Bug: tint:1043
Change-Id: I009edf8e43c21cb75ccfdcde1106ec177d2fe50e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59561
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-26 17:34:58 +00:00
David Neto
31579c92b2
spir-reader: fix validity of unit tests
...
- skip dumping due to SPIR-V Tools validation error for Location
conflicts for IO variables duplicated on an OpEntryPoint interface
list (SPIRV-Tools issue #4403 )
- Skip dumping for unit test for conversion of RelaxedPrecision
decoration.
Bug: tint:1043
Change-Id: I8ce3a7660d74b771e3fa62dc39e4e030e4ba6aa1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59560
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-26 17:18:26 +00:00
David Neto
d77c00f419
Update spirv-reader tests to be valid for WebGPU
...
- each vertex shader must have builtin-position output.
- when testing non-vertex shader features, change to fragment shaders,
to avoid the need to have a builtin position output.
- Fix ordering of entry point declaration vs. OpName
Bug: tint:1043
Change-Id: Ic66383d42419a1ef893835ae71729ae27fc6e539
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59482
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-26 16:59:51 +00:00
Antonio Maiorano
dcd3dcec70
Add support for parsing hex floats to WGSL frontend
...
As per https://gpuweb.github.io/gpuweb/wgsl/#literals , HEX_FLOAT_LITERAL
token.
Bug: tint:77
Change-Id: I09105df15a1888c2f0c84d7cccd2cc53e596f5cc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58781
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Antonio Maiorano <amaiorano@google.com >
2021-07-26 14:02:18 +00:00
Corentin Wallez
b32c22cead
spirv-reader: Polyfill GLSLStd450 Degrees and Radians
...
Fixed: tint:1044
Change-Id: I5b2f3820b35c47bdc589ef41fb7a8735a7c6dff1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59660
Auto-Submit: Corentin Wallez <cwallez@chromium.org >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-26 09:12:57 +00:00
David Neto
f7d0c1cbfe
spirv-reader: polyfill scalar reflect
...
Fixed: tint:1018
Change-Id: I60916d6c4ac4ae8c1a88763c12acf83d19bb2e68
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58821
Commit-Queue: David Neto <dneto@google.com >
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@chromium.org >
2021-07-24 06:31:02 +00:00
David Neto
70eb1d3573
spirv-reader: polyfill scalar faceForward
...
Bug: tint:1018
Change-Id: I912c6deaed4e3c3f4c5dfb76e7ed7e917b4c6498
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58820
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: David Neto <dneto@google.com >
Auto-Submit: David Neto <dneto@google.com >
Reviewed-by: Ben Clayton <bclayton@chromium.org >
2021-07-24 06:11:52 +00:00
Sarah
f76c227cee
parser: fix wgsl expect_const_expr()
...
Bug: tint:1025
Change-Id: I35aab866ffce57681662f59e4b8e701bb03cf718
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59220
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com >
2021-07-23 13:15:10 +00:00
James Price
eb39420ae6
reader/wgsl: Add support for block comments
...
Handles nested block comments.
Allow unterminated block comments at EOF, as it is not clear whether
WGSL will allow this or not.
Bug: tint:881
Change-Id: Ieae4e0073dab69f773adb32018a9bdaf4f352116
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59180
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-22 14:41:37 +00:00
Ben Clayton
0f2d95dea3
sem: Split sem::Variable into global, local and parameter
...
Each of these may contain information specific to their kind.
Change-Id: Ic8ac808088132b7bc2e43da6ce46a06571e0fed5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59200
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
Reviewed-by: James Price <jrprice@google.com >
2021-07-22 13:24:59 +00:00
Ben Clayton
81d4ed0d9c
Fix operator% for f32 and vecN<f32>
...
https://github.com/gpuweb/gpuweb/pull/1945 changes the SPIR-V mapping of this operator so that it now maps to OpFRem instead of OpFMod. Polyfill OpFMod with `x - y * floor(x / y)`
Also map the MSL output of this operator to use `fmod()`.
Behavior of this operator is now consistent across all backends.
Fixed: tint:945
Fixed: tint:977
Fixed: tint:1010
Change-Id: Iefa009b905989c55ace24e073ab0e261c7cf69b0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58393
Auto-Submit: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
2021-07-21 14:11:01 +00:00
James Price
c41d940650
Parse num_workgroups builtin and reject it
...
We have chosen not to implement this for origin trial, so just parse
it and produce an error in the validator.
Bug: tint:752
Change-Id: I40ebf0b4051fb0b8bab9d4c733e555b836320cd4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58780
Auto-Submit: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
2021-07-19 21:32:27 +00:00
David Neto
94a5fd476e
spirv-reader: polyfill scalar refract
...
Compute it in 2 dimensions, with a 0-valued y component,
then extract the x component of that result.
Fixed: tint:974
Change-Id: Ie23668d3403e68be14f34da9540f27f6f3c3aca2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58782
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: James Price <jrprice@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-19 21:31:59 +00:00
Ben Clayton
0c3ddc9649
parser/wgsl: Error if type decorations are not consumed
...
Fixed: chromium:1230604
Change-Id: Ia847e58c30f2c5787db4c239d561e4fe5da01355
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58761
Auto-Submit: Ben Clayton <bclayton@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-19 21:23:39 +00:00
David Neto
93d4501e67
spirv-reader: refactor handling pipeline IO decorations
...
This is in preparation for handling the "invariant" decoration.
Bug: tint:972
Change-Id: I17465946932ab37a32dfd3c477525649ab622c6f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58580
Auto-Submit: David Neto <dneto@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-19 17:02:36 +00:00
James Price
76feb6b626
reader/wgsl: Add source info to CallStatement
...
We were not printing source information for errors involving call
statements.
Change-Id: I576b4d095162333d4392d6be590e827a49918d3d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58520
Auto-Submit: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-18 14:45:24 +00:00
David Neto
a01bb4c984
spirv-reader: reject undef and null pointers
...
This is defensive. Without variable pointers capabilities, this is
definitely invalid, but not yet checked by the SPIRV-Tools validator.
Bug: tint:807
Change-Id: If9b0b19573b1ca14a1c55aa20c9d42784ec12568
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56700
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: David Neto <dneto@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-17 19:19:16 +00:00
David Neto
5f994247a2
reader: fix ordering of select operands
...
Updates:
spirv-reader
hlsl-writer
spirv-writer
Bug: tint:1001
Change-Id: I7359d35c3384e164d149a6af03cbdc959a2eea76
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58400
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-16 18:17:05 +00:00
Ben Clayton
29c70796d3
parser/wgsl: Fix stack overflow in postfix_expression()
...
Have postfix_expression() use a loop instead of recursively calling itself.
Fixed chromium:1229669
Change-Id: Ied7684d00ba453a8b89ab0251d42e2a72169421f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58381
Auto-Submit: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-07-16 17:55:14 +00:00
David Neto
e087a95706
spirv-reader: support remaining interpolation decorations
...
NoPerspective interpolation maps to 'linear'
Centroid maps to 'centroid'
Sample maps to 'sample'
Otherwise, allow 'center' to be defaulted.
Fixed: tint:935
Change-Id: I0b040da0c57d2a363f9dc9474c1ac889e0fe2278
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56840
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-07-16 16:20:25 +00:00
James Price
ae23bd5548
reader/wgsl: Reserve ++ and -- tokens
...
Fixed: tint:971
Change-Id: I70732db7b22f7785866066cd7966eec630078de0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57761
Auto-Submit: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: James Price <jrprice@google.com >
2021-07-13 13:34:15 +00:00
Ben Clayton
3797ab6465
reader/wgsl: Be more aggressive at bailing
...
... once the maximum number of errors have been reached.
https://dawn-review.googlesource.com/c/tint/+/56070 introduced maybe_set_synchronized(), which only set synchronized_ when the number of errors reported was less than max_errors_, but it seems the fuzzers have found ways to generate an excessive number of errors that keep the parser synchronized.
Revert 56070, and instead check the synchronized state along with the error count for every unbounded loop in the parser.
Fixed: chromium:1226655
Fixed: chromium:1226379
Change-Id: I178d758ac1424d4d19923fe6a3d9e123879b9eae
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57427
Auto-Submit: Ben Clayton <bclayton@google.com >
Commit-Queue: James Price <jrprice@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-12 16:50:31 +00:00
James Price
fcc0de0b86
wgsl: Implement invariant attribute
...
Make sure the other backends ICE on unrecognized attributes.
Add E2E tests, currently skipped for the other backends.
Bug: tint:772
Change-Id: I4e68d111ff79b19ebb6c574058a91debcb746011
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57642
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-12 12:28:52 +00:00
dan sinclair
bf1ec305db
reader/wgsl: Remove old token methods.
...
This CL removes the old token `Is<Name>()` methods which are no longer
being used in the parser or lexer. (Some of them were used in tests but
the generic `Is(<type>)` is used instead.
New `peek` methods are added which will peek if the given token comes
either next or at the given index.
Change-Id: I8d15f2a42889f981d273b6459d20c4202db1ae32
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57540
Auto-Submit: dan sinclair <dan.sinclair@gmail.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@chromium.org >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@chromium.org >
2021-07-12 11:21:51 +00:00
Ben Clayton
1b03f0a07a
reader/wgsl: Generate ForLoopStatements
...
Instead of LoopStatements.
Update the writers to handle these.
Fixed: tint:952
Change-Id: Ibef66e133224810efc28c224d910b5e21f71f8d6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57203
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-08 21:23:33 +00:00
Ben Clayton
9545fb76b6
Remove depreated APIs and WGSL
...
WGSL:
* Remove vertex_idx and instance_idx.
These are now vertex_index and instance_index.
It seems this was removed once before, then reverted due to CTS
failures, but the original change never landed again.
* Remove the [[set(n)]] decoration. This has been [[group(n)]] for
months now.
API:
* Remove deprecated enums from transform::VertexFormat.
* Remove transform::Renamer constructor that takes a Config. This should
be passed by DataMap.
* Remove ast::AccessControl alias to ast::Access.
Change-Id: I988c96c4269b02a5d77163409f261fd5923188e0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56541
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-07-06 10:20:19 +00:00
Ben Clayton
5d8eb4a758
reader/wgsl: Improve reserved keyword error messages
...
And add `vec` and `mat` to the reserved keyword list (see https://github.com/gpuweb/gpuweb/pull/1896 )
Move these reserved keyword checks out of the lexer and into the parser.
Generate a sensible error message.
Add tests.
Change-Id: I1876448201a2fd773f38f337b4e49bc61a7642f7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56545
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-07-05 21:48:37 +00:00
Ben Clayton
b0455217fa
Add refract intrinsic
...
See: https://github.com/gpuweb/gpuweb/pull/1901
Bug: tint:950
Change-Id: I6f00ab753a2ddf2374352ddf636e1abfebe86ba7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56777
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Antonio Maiorano <amaiorano@google.com >
2021-07-05 16:47:37 +00:00
James Price
f83e406b37
reader/wgsl: Fix parsing of stride on return type
...
Split out the stride decoration and pass it to type_decl() so that it
attaches to the type node instead of the function.
Fixed: tint:781
Change-Id: I8c238d69bd3238047016b5b0a2108273fb9f32ae
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56680
Kokoro: Kokoro <noreply+kokoro@google.com >
Auto-Submit: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-05 15:56:32 +00:00
David Neto
5cb31a8a7f
spirv-reader: support Flat decoration
...
Bug: tint:935
Change-Id: Ie6f97d8d9a273fd8099d8e9807ffa189ba3031a0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56820
Auto-Submit: David Neto <dneto@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-05 13:08:27 +00:00
David Neto
9bf951eee5
spirv-reader: infer function storage class on OpAccessChain without indices
...
Fixed: tint:941
Bug: tint:807
Change-Id: I37bec630c1b83dbb56d2f8937322a5b5be81f407
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56660
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: David Neto <dneto@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-07-02 14:14:23 +00:00
David Neto
62c8f2a9d6
spirv-reader: handle locations on structure members
...
Bug: tint:912
Change-Id: Ia179a3152cfcdfed812f1673aaa4dba8b565dadf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56341
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Commit-Queue: David Neto <dneto@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-06-30 19:48:23 +00:00
David Neto
91622e3853
spirv-reader: flatten output matrix, array, struct
...
Bug: tint:912
Change-Id: Iebbcb7ea8d870cccadad7dd1ce8aaccf8965b370
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56301
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: James Price <jrprice@google.com >
Auto-Submit: David Neto <dneto@google.com >
2021-06-29 14:38:56 +00:00
David Neto
c15dbfa1ae
spirv-reader: flatten struct pipeline inputs
...
Bug: tint:912
Change-Id: I01002f4996d3205af06edda092a1c18dcf6213e3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56220
Kokoro: Kokoro <noreply+kokoro@google.com >
Auto-Submit: David Neto <dneto@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-06-29 14:38:56 +00:00
David Neto
1d2f08b4ad
spirv-reader: flatten input IO arrays and matrices
...
Bug: tint:912
Change-Id: I403d504b577bda7918a81d990da5a13ca2036971
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56141
Auto-Submit: David Neto <dneto@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-06-29 14:38:56 +00:00
James Price
03a7522276
reader/wgsl: Add support for interpolate attribute
...
Bug: tint:746
Change-Id: I43486c0244a893a73b734e888fc8811c8e954ab6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56242
Kokoro: Kokoro <noreply+kokoro@google.com >
Auto-Submit: James Price <jrprice@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
2021-06-28 23:04:43 +00:00
Ben Clayton
c41c7cdf31
reader/wgsl: Only resync if num errors less than limit
...
As all loops in the parser require `synchronized_` to be true, don't set this to true if we've hit the maximum number of error diagnostics.
This lets the parser bubble up as soon as the limit was reached, instead of only aborting once we finally reach the top level loop.
ClusterFuzz has uncovered a number of cases where, in a loop, it can produce an error, then resynchronize, then error again on the next loop iteration. This produces more than the max limit of errors, and can stall the tests long enough to time out.
No unit tests for this, as it requires a really contrived input to trigger, and to exhaustively catch all the places we now call maybe_set_synchronized() would result in a large colleciton of horrible tests. Instead, let ClusterFuzz do the testing.
Fixed: chromium:1224031
Fixed: chromium:1224032
Fixed: chromium:1224042
Fixed: chromium:1224049
Fixed: chromium:1224050
Fixed: chromium:1224130
Fixed: chromium:1224131
Fixed: chromium:1224132
Fixed: chromium:1224144
Fixed: chromium:1224191
Change-Id: I63f160e28d13b85ee92e1b921239d7fb8ac22a08
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56070
Auto-Submit: Ben Clayton <bclayton@google.com >
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: James Price <jrprice@google.com >
2021-06-28 16:09:57 +00:00
Ben Clayton
ffd28e2e1a
diag: Add System enumerator to all diagnostics
...
Describes what Tint system raised the diagnostic.
Use this information in the fuzzers to distinguish between expected and unexpected failure cases in the Transform fuzzer tests.
Fixed: chromium:1206407
Fixed: chromium:1207154
Change-Id: I3b807acafe384a2fc363d2a4165a29693450b3cf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55254
Kokoro: Kokoro <noreply+kokoro@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
Reviewed-by: Ryan Harrison <rharrison@chromium.org >
2021-06-24 11:27:36 +00:00
Antonio Maiorano
261643bb9f
Fix doxygen warnings
...
Change-Id: I5b3765ca0362e517990334d47f9defa673732a04
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55800
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: Ben Clayton <bclayton@google.com >
2021-06-24 09:15:06 +00:00
David Neto
f37f8df38b
spirv-reader: explicitly error out on extended arithmetic
...
The feature is not yet finished in WGSL.
Fixed: tint:804
Change-Id: I5268126f68316e57ee60d099f2000223703845df
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55500
Kokoro: Kokoro <noreply+kokoro@google.com >
Reviewed-by: Ben Clayton <bclayton@google.com >
Commit-Queue: David Neto <dneto@google.com >
2021-06-22 20:17:09 +00:00