Commit Graph

465 Commits

Author SHA1 Message Date
dan sinclair c8a85aa5a9 [wgsl-reader] Add stride support.
This CL adds stride support to the WGSL reader.

Bug: tint:178
Change-Id: Id6b5163438e562a371255ad3fb992d0a716543e7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26040
Reviewed-by: David Neto <dneto@google.com>
2020-07-30 16:50:25 +00:00
dan sinclair 9a2b692b1c Add return to simple test
Change-Id: I0432724f3b77912ec547a0700c022f9dbbca7d36
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25460
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-07-22 13:41:04 +00:00
dan sinclair fbbc617888 Parse void function call.
This CL updates the WGSL parser to handle a void function call.

Fixes: tint:45
Change-Id: If5b2a4b9e62f0b10e0f2e2e10c0ca2586c5268e8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25322
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-07-21 15:13:36 +00:00
dan sinclair df415a8919 [msl-writer] Generate entry point functions.
This CL generates entry point functions and duplicate functions as
needed to call from the entry points.

Bug: tint:8
Change-Id: I8092ce463248e7a887c26ae05b0774e8fa21ab94
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24764
Reviewed-by: David Neto <dneto@google.com>
2020-07-15 18:04:11 +00:00
dan sinclair 8604eb4495 Update cube example
This Cl updates the cube example to use unique names for the entry
points and fixes the duplicate name used for fragColor between the
vertex and fragment shaders.

Change-Id: Icb77897bac88f7641cab2702b37573bfd771a586
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24781
Reviewed-by: David Neto <dneto@google.com>
2020-07-14 19:43:02 +00:00
dan sinclair 6366f68121 [metal-writer] Emit constructors.
This Cl adds the code to emit scalar and type constructors from the
Metal backend.

Bug: tint:8
Change-Id: I95c713568ae3a73b82f8c9e10119e29e3469893e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23707
Reviewed-by: David Neto <dneto@google.com>
2020-06-23 18:22:21 +00:00
dan sinclair 5b853eebc6 Support the zero initializer syntax.
This Cl updates the system to allow zero initializers. This allows:

```
var a : vec3<f32> = vec3<f32>();
```

Bug: tint:34
Change-Id: I84d6b431914c4ddf112ed375fae028d912f4a080
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23660
Reviewed-by: David Neto <dneto@google.com>
2020-06-22 20:44:27 +00:00
dan sinclair 32b41b79da Add block annotations to computeboids
Annotate structures with [[block]] annotations.

Change-Id: Ieb6d5cee203fa1e9c090dc147d2c8d1473abb224
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/21022
Reviewed-by: David Neto <dneto@google.com>
2020-05-05 14:21:43 +00:00
dan sinclair 265d5d0904 Unique method names in computeboids
WebGPU requires unique entry point names.

Change-Id: I0dc5123abdc1a4da343b60460443498f8611d7b9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/21021
Reviewed-by: David Neto <dneto@google.com>
2020-05-05 14:21:35 +00:00
dan sinclair de4259ef80 Fixup computeboids translation error.
There was a - that changed to a + while converting. Fixed.

Change-Id: Ic50a04624c5f4efdfc114459ccd5f42fc53c3ca2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20629
Reviewed-by: David Neto <dneto@google.com>
2020-05-01 19:06:03 +00:00
dan sinclair 64db1d9a9b Add mising computeboids casts.
This CL adds in missing casts from i32 to f32 when using the count
variables in computeboids to create vec3<f32> values.

Change-Id: I3e66e2db0fc626b94ae98142cd95a65feff7fc53
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20627
Reviewed-by: David Neto <dneto@google.com>
2020-05-01 19:05:43 +00:00
David Neto ac47807974 Fix compute_boids.wgsl literal types, storage class
Change-Id: I13279ab0db4c0a7587f4307bf923a59c59d5af2e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20624
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-05-01 19:02:35 +00:00
dan sinclair 75dbd8739e Add missing storage classes to compute boids.
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>
2020-04-24 00:41:23 +00:00
dan sinclair 32a68fec42 Fix type of gl_GlobalInvocationId in compute boids.
The variable was incorrectly set to be a `vec3<f32>` instead of a
`vec3<u32>`.

Bug: tint:24
Change-Id: I84262a185925c50adf3a149f5f93f45124499596
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/18400
Reviewed-by: David Neto <dneto@google.com>
2020-03-31 15:06:07 +00:00
Dan Sinclair 6e581895a5 Initial commit 2020-03-02 15:47:43 -05:00