This CL adds support for alias types in the members of structures.
Bug: tint:5
Change-Id: I22f19b9a57d0f1be0ec4d6299948c1a93766ff9d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20347
Reviewed-by: David Neto <dneto@google.com>
TEST=Built fuzzer in local checkout of Chromium with tint integrated.
BUG=dawn:14
Change-Id: I84aacd41f893070c3af40f5e640361e177689f9e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20343
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL adds the missing storage classes to the module scoped variables
in compute boids.
Change-Id: I59cbe0f9bcc4b235f2f9157801dcbc445a6bd5eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20346
Reviewed-by: David Neto <dneto@google.com>
As long as a type constructor is not global the values can be non-const
which means they don't have to be constructors. This CL fixes an issue
where we incorrectly assumed the value was a constructor.
Change-Id: Ib1661830cbb14298ea9254145edd60b74e0dee1d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20344
Reviewed-by: David Neto <dneto@google.com>
The member accessors end up being aliases in a lot of cases because you
can't have a struct that isn't an alias. This Cl unwraps the aliases at
the start of the determination for member accessors.
Change-Id: Ib090ebd6aedd502c2812d95373c19d8eb831a361
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20342
Reviewed-by: David Neto <dneto@google.com>
Make sure we unwrap pointers in import determination so things like
passing a member of a struct will determine the import correctly.
Change-Id: Id4565351c45e7798664c3368e2dec19b1440492d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20341
Reviewed-by: David Neto <dneto@google.com>
This CL adds load and store tests for a member accessor result.
Bug: tint:5
Change-Id: I5b8da3bb8d3df2c150967c812ffe3eeae3189fa7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20340
Reviewed-by: David Neto <dneto@google.com>
This CL updates the type determiner such that variable result types
end up wrapped inside pointers, constants do not. The result of Member
and Array accessors are also pointers if the source was a pointer.
Change-Id: I6694367daf6ba1db929e54a975dfea8404fca40c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20265
Reviewed-by: David Neto <dneto@google.com>
This CL adds a DISABLED test for the single swizzle case.
Bug: tint:5
Change-Id: I75df147adba4e2e2b7eb6bfd0e0ede951502a73d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20300
Reviewed-by: David Neto <dneto@google.com>
Also, list remaining logical instructions to be tested
Bug: tint:3
Change-Id: I48dda1d3637bc7c4d75358e26fb9de8f0c6f0bb6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20261
Reviewed-by: dan sinclair <dsinclair@google.com>
Record header/merge cross-links, and single_block_loop attribute of BlockInfo.
Also checks that they are sane: only target blocks in the same function.
Bug: tint:3
Change-Id: I715f7ed354a556e92d58a4c9ba6f306c746c3641
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20080
Reviewed-by: dan sinclair <dsinclair@google.com>
This is in anticipation of future fuzzer implementations.
BUG=tint:56
Change-Id: I73492c135bed7d5bee9c114ec336a837b4f447ac
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20243
Reviewed-by: David Neto <dneto@google.com>
This CL fixes up the member accessor code and adds tests.
Bug: tint:5
Change-Id: I139cb2e853da92e762255e4836daf2b9a437179d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20181
Reviewed-by: David Neto <dneto@google.com>
Each basic block must have a terminator, and if the terminator branches
to another block, that block must name a label in the same function.
Bug: tint:3
Change-Id: If22bece6a8041fef362c02b05e4dfee999a3e5bf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20046
Reviewed-by: dan sinclair <dsinclair@google.com>
This Cl adds the code for the ArrayAccessor generation. Some of the
MemberAccessor code is included, but tests are coming in a later Cl.
Bug: tint:5
Change-Id: Id7d006ab4a82c1d31d8036d141c83d0d61f9bea5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20180
Reviewed-by: David Neto <dneto@google.com>
This CL adds the missing call for the call expression.
Bug: tint:5
Change-Id: Ia046e2b57ebc56eaf0c3dc330d9f8e81763df8bc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20144
Reviewed-by: David Neto <dneto@google.com>
This CL adds the code to generate the negation and not operators.
Bug: tint:5
Change-Id: Ibb4d374586e1415a2a678e375c64ba69bbc20367
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20143
Reviewed-by: David Neto <dneto@google.com>
This CL adds the needed code to handle three parameter methods in the
type determinater.
Bug: tint:5
Change-Id: Id8584fbb1d308de585b59a4034e184b41f5bd74c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20141
Reviewed-by: David Neto <dneto@google.com>
This CL updates the expression class to set the alias value instead of
an alias as the result type.
Change-Id: If19ae394a09ba0dc76380514e53a488bbb5a7292
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20140
Reviewed-by: David Neto <dneto@google.com>
- branch-conditional where both targets are the same
- switch where the default target is the same as a case target
Bug: tint:3
Change-Id: If5a3e1fead43ae3d528341f3e54dcae959d9eb8c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20061
Reviewed-by: dan sinclair <dsinclair@google.com>
Separate them into different test files, to match SPIR-V spec sections
Bug: tint:3
Change-Id: I89fe76230740da060d57ac23870069a5483b2d7d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20043
Reviewed-by: dan sinclair <dsinclair@google.com>
Test non-nested sequences and selections.
Bug: tint:3
Change-Id: Ibbbcd428d701d9e7d4da1682f94c2bdbef00121b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19920
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL makes it clearer where errors are coming from and fixes the
source information on a few type determiner error messages.
Change-Id: I356518ac3004effe005bb7dea147c7fe442ab1a8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20063
Reviewed-by: David Neto <dneto@google.com>
For a swizzle with one element (eg vec.x) the result type is just the
type of the vector, instead of a new vector.
Change-Id: I04ddb22da61db1c3553d465e4e5f9d6b32beae83
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20062
Reviewed-by: David Neto <dneto@google.com>
This CL adds support for the GLSL distance command.
Bug: tint:5
Change-Id: I0934d461ca6d4fca379849d8f41a33fb202c67ff
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20060
Reviewed-by: David Neto <dneto@google.com>
This CL adds conversions for the remaining GLSL methods which accept
two float parameters.
Bug: tint:5
Change-Id: I545567f67baaae62d5a85d3d7cacc64571d7a8e8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20020
Reviewed-by: David Neto <dneto@google.com>
This CL adds support for the Atan2 GLSL command.
Bug: tint:5
Change-Id: I724e94ffb6d93136a9976b4949320f60075618ab
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19961
Reviewed-by: David Neto <dneto@google.com>
Fix bad merge around emission of OpBitcast.
Change-Id: Iacc5ba1c3940745e4b2c46878bbc416397ec555f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20047
Reviewed-by: David Neto <dneto@google.com>
This CL adds support for the GLSL length command.
Bug: tint:5
Change-Id: I2704bc04e493fb3aef8e5cd58039b6b863cc80f8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20001
Reviewed-by: David Neto <dneto@google.com>