This CL adds emitting return statements into the WGSL writer.
Bug: tint:4
Change-Id: Ia2331f7c20e3a3e3af1aa1553cef83bec315eae3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17260
Reviewed-by: David Neto <dneto@google.com>
This CL adds the Kill, Nop and Fallthrough statements to the WGSL
writer.
Bug: tint:4
Change-Id: Ic0c635cfa7ca4c3195c593b119f9436ffeb1f9dc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17201
Reviewed-by: David Neto <dneto@google.com>
This Cl adds support for emitting the WGSL continue statement.
Bug: tint:4
Change-Id: I20f87d46e707bdd7ae2a517983e779988892c445
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17200
Reviewed-by: David Neto <dneto@google.com>
This CL adds case statements to the WGSL generator.
Bug: tint:4
Change-Id: Ic7945646d79b7c3e9e1cb1cf57d1633a28f45fc0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17180
Reviewed-by: David Neto <dneto@google.com>
This CL adds emitting of the break statement to the WGSL writer.
Bug: tint:4
Change-Id: Iceae8cf8c1c77d63455621ea23f566af57c9e717
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17163
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL writer to emit the assignment statement nodes.
Bug: tint:4
Change-Id: I8a52f4e96c61ecb9e97cd3da41f4a1aa718e8d37
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17162
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL generator to emit the UnaryOpExpression node.
Bug: tint:4
Change-Id: I54046b5238a45994f7a4ed27941bd22b0c75f836
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17161
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL generator to output UnaryMethodExpression
nodes.
Bug: tint:4
Change-Id: If43c0e5c12a967f08cc23e816d292353490404cf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17160
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL writer to emit the unary derivative expression.
Bug: tint:4
Change-Id: I18c0fd56d88f98a6c5d37e176d98ab7b3077a50c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17120
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL writer to emit the relational expressions.
Bug: tint:4
Change-Id: I2b2f5e40f2091ce2b7715773f3811aed7ed61f6a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17100
Reviewed-by: David Neto <dneto@google.com>
This CL sets the root folder to be used by the linter when determining
header guards.
Bug: tint:23
Change-Id: I52ce8d3cd67e9882d4ea8a2c9cbd2d5d5650d5b7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17205
Reviewed-by: David Neto <dneto@google.com>
This CL adds MemberAccessor handling into the WGSL generator.
Bug: tint:4
Change-Id: Ib84f9ca1969fec48f167433af957dc1ed4de3415
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17063
Reviewed-by: David Neto <dneto@google.com>
This CL adds Cast Expression emission to the WGSL generator.
Bug: tint:4
Change-Id: Ib48290d53423be5770cfb8f1b5f1ccb93b53a4df
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17062
Reviewed-by: David Neto <dneto@google.com>
This CL adds call expressions to the WGSL writer support.
Bug: tint:4
Change-Id: I1caa2f5f81ac2e2ab89755c1721e96d44c331853
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17060
Reviewed-by: David Neto <dneto@google.com>
This CL adds 'as' generation into the WGSL generator.
Bug: tint:4
Change-Id: Ica9e615e30aae1882681d8da74b26a51cff6dc30
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16880
Reviewed-by: David Neto <dneto@google.com>
This makes it easier to find and track tests as the generator grows.
Bug: tint:4
Change-Id: I9660e459f3ffd33f3048a331f23623318af013e0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16840
Reviewed-by: David Neto <dneto@google.com>
This makes it easier to see the bug.
Bug: tint:22
Change-Id: Ic5acc0b8299ef31eb73b49863bc42ac09de6e9bf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17203
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL extends the WGSL writer to output ArrayAccessorExpression the
initializers are also output so we can test the array[5] syntax..
Bug: tint:4
Change-Id: I560ca6af4d714e13b136f6ded2fb3329e309c9ca
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16820
Reviewed-by: David Neto <dneto@google.com>
This CL extends the build options to Tint to make the various readers
and writers all optional.
Change-Id: I913e1830b1bb2243eff5deb4b8079ba592dd52e1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16801
Reviewed-by: David Neto <dneto@google.com>
This CL creates the skeleton for the SPIR-V writer.
Bug: tint:5
Change-Id: I849d8766d32d48314a51096710272f9821e2c1c4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16641
Reviewed-by: David Neto <dneto@google.com>
The `assert` will compile out in Release builds so we don't actually
parse the module, which means we're always testing against an empty
module and the tests fail.
Bug: tint:22
Change-Id: I49a1f8fc8ec6231a65f4f17e385cff576c4f0d06
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17204
Reviewed-by: David Neto <dneto@google.com>
It will always use the "std::glsl" import name.
Remember all the IDs of such imports.
Never add more than one GLSL.std.450 import to the AST.
Also refactor the Assemble test helper into its own file.
Bug: tint:3
Change-Id: I5b2b70ea0f00d44aacf553aa009756dff2a4cecf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16662
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL marks the specific `bool` test as NOLINT in fail_stream to stop
the linter from emitting errors.
Change-Id: Ifa3d9b0a2e0f06bcd0d48cbe79f8dbe91fe7b4ef
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17061
Reviewed-by: David Neto <dneto@google.com>
This CL adds unit tests for the VariableStatement AST element.
Bug: tint:11
Change-Id: I36d1b134e4c1c93ee414c29e8bb8d5e7e9704da6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16760
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds a test to the variable AST node to verify the initializer
is valid.
Bug: tint:11
Change-Id: I95553e8572124e8e2e861b451003e5c9bf6358f1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16743
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the UnlessStatement AST elements.
Bug: tint:11
Change-Id: Icd003e81925d60c6681e447be2f1a5610564eda7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16742
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds unit tests for the UnaryOpExpression AST element.
Bug: tint:11
Change-Id: I086d167c3b2ef0764a45a41268222254adba4017
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16741
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds unit tests for the UnaryMethodExpression AST element.
Bug: tint:11
Change-Id: I5e99bb15f1333c1fa7ff34efafd86739c6a1d662
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16740
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the UnaryDerivativeExpression AST element.
Bug: tint:11
Change-Id: Ieabfdcb7940aedc58a3455b74c0ddb508b4859ff
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16673
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds unit tests for the TypeInitializerExpression AST element.
Bug: tint:11
Change-Id: I92790563c995038cc5a09afd03e84496b8f41487
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16672
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests to the SwitchStatement AST element.
Bug: tint:11
Change-Id: I3e12667d14ab31cc15f6ea8595847f9daf55dc46
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16682
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This Cl adds more IsValid tests to the StructMember AST node.
Bug: tint:11
Change-Id: I7fec6fb5e96f025735fd444c74f97d4ded8b3ae6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16671
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This Cl adds tests for the Struct::IsValid to make sure struct members
are also valid.
Bug: tint:11
Change-Id: I49d9f1dd6a6d2da8c49a273466316a849e1d28cd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16670
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds a test for the set decorations to_str method.
Bug: tint:11
Change-Id: I06396c1bf59c90aad6a6851cf9695fbee42546a8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16669
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the ReturnStatement AST node.
Bug: tint:11
Change-Id: Ib20e38e67e07e0ae03d359619cc260bc8d6e3a3b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16668
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds test for the RelationalExpression AST node.
Bug: tint:11
Change-Id: Id16e97110423dd9d987b045325696227df0d2913
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16667
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds the test for the RegardlessStatement AST element.
Bug: tint:11
Change-Id: Ide4a126e4fa68e84238985d1379dd80123aea5a8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16666
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the NopStatement AST node.
Bug: tint:11
Change-Id: I890b7f6bc6347ba4f5a67334385feffd24079d5d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16665
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds unit tests for the MemberArrayExpression.
Bug: tint:11
Change-Id: I790d27018b516b3b2b79b6ed892c1a0e00b65818
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16681
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the KillStatement AST element.
Bug: tint:11
Change-Id: I1388051ca0639ddaf6b3f2bd2fa5ea8e492b114c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16561
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the if statement AST node.
Bug: tint:11
Change-Id: Ice3f281e1dfd72d76f43767f7b3040af862f4a58
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16540
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds tests for the identifier expression AST node.
Bug: tint:11
Change-Id: Ie7dd4f1de3d8a23ac7e878285564d8c5fc9e1250
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16502
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>