This CL adds preliminary entry point support to the Metal backend.
Bug: tint:8
Change-Id: I7b904621d706d4503d5054711de64872f79cf2fa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23708
Reviewed-by: David Neto <dneto@google.com>
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>
This CL adds emission of binary operations to the Metal backend.
Bug: tint:8
Change-Id: I797daadd238b718b081842b63ccefab3294bc20c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23706
Reviewed-by: David Neto <dneto@google.com>
This CL adds assignment statements to the Metal backend.
Bug: tint:8
Change-Id: Iaf4faa62124948fd0e785d5bebd20aae778ba050
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23705
Reviewed-by: David Neto <dneto@google.com>
This Cl adds the code to emit functions from the metal writer. Note,
this does not handle entry points yet.
Bug: tint:8
Change-Id: Ie665771169261f6839de5eb1b66dc511bf47616a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23704
Reviewed-by: David Neto <dneto@google.com>
This CL adds the start of identifier expressions to the Metal backend.
Identifiers with paths are currently not supported.
Bug: tint:8
Change-Id: I4df8b6a3c32251d454d3dae5fa8933dad36094f8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23703
Reviewed-by: David Neto <dneto@google.com>
This CL adds generation of the return statement.
Bug: tint:8
Change-Id: Iffee600e77a485649b987d39aab47742968e438e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23702
Reviewed-by: David Neto <dneto@google.com>
This CL adds the start of type emission for the Metal backend. A few
types like pointers and structs aren't complete yet.
Bug: tint:8
Change-Id: I648e9275ef1b9dc6fa63b6ab328fe018a5f620ea
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23701
Reviewed-by: David Neto <dneto@google.com>
This CL adds the basis of the Metal Shading Language backend.
Bug: tint:8
Change-Id: I85976250eb41ac12203a5db116444e993c3d09d4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23700
Reviewed-by: David Neto <dneto@google.com>
Use the shortcut for zero-values: a type constructor without
any parameters. Scalars still use plain literals like false, 1u, 1.0.
Change-Id: Ie436f1af28cbab0b4c87a07b057deb04632eb534
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23680
Reviewed-by: dan sinclair <dsinclair@google.com>
This Cl updates the entry point code to only output Input/Output
variabes which are referenced by the function instead of all
Input/Output variables.
Bug: tint:28
Change-Id: Idc429e02cac8dac7fc7b609cbd7f88039695829e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23623
Reviewed-by: David Neto <dneto@google.com>
When a type alias is created, map the SPIR-V type ID to the
type alias, not the underlying type. Only unpack the alias as
needed when inspecting the content structure to make values.
Bug: tint:3
Change-Id: I11011ddd190d89c81d3323f684a5e13f17dde09d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23582
Reviewed-by: dan sinclair <dsinclair@google.com>
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>
This CL adds calls to functions to the SPIR-V writer.
Bug: tint:5
Change-Id: Id6f3e41deba937edb85fa6ec2f2db8d1f4241944
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23621
Reviewed-by: David Neto <dneto@google.com>
This CL adds generation of OpFunctionParameter entries for function
parameters.
Bug: tint:5
Change-Id: I7af6cb756e20674f32737f2ef362fda12c9d2ef2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23620
Reviewed-by: David Neto <dneto@google.com>
This CL adds support for the && and || operators to the SPIR-V backend.
Bug: tint:5
Change-Id: I63b23d9904b5b8027e189034d24949df71cbbe42
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23501
Reviewed-by: David Neto <dneto@google.com>
TODOs in the test file are or were in the function_arithmetic_test.cc
Change-Id: I679dbf0019e12e26488ccc310dfb03a535628e0b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23462
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL adds support for type determination of the SClamp and UClamp
GLSL methods.
Change-Id: I974e80127f0e256285f126136270ac5131334a92
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23500
Reviewed-by: David Neto <dneto@google.com>
This CL adds the conversion of `as<f32>(b)` to SPIR-V.
Bug: tint:5
Change-Id: If1e04db2fe5520940527f4dcf52a89628b11b518
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23461
Reviewed-by: David Neto <dneto@google.com>
When parsing the `u` in `1024u` we were not advancing the lexer to the
next token which would give parse errors.
Change-Id: I8473b55992ff01d24f9d961878afa6b54d855e68
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23460
Reviewed-by: David Neto <dneto@google.com>
This CL adds type determination for the MatrixInverse GLSL method call.
Change-Id: I976beb00bb5c869407a0c9f522789112ff22bf6a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23400
Reviewed-by: David Neto <dneto@google.com>
This CL adds the type determination code for the GLSL determinant call.
Change-Id: I46bc57f4fd5f4f43021b20ee511b0b8fc809f4f8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23360
Reviewed-by: David Neto <dneto@google.com>
Currently we will attempt to extract composite values for constant
constructors which may happen outside of a function. This causes issues
as the extract requires us to be in a function.
Change-Id: I5724987542cc7d9d86493363ed4d9a44a391a52f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23221
Reviewed-by: David Neto <dneto@google.com>
This is needed to allow users to actually use tint/tint.h
BUG=tint:87
Change-Id: I70c9397a0497feca88ccf8879a3d0e8a03ab8471
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23260
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL cleans up various formatting and lint errors.
Change-Id: Ieee14db90e36acc8b469d58abb84fcf3595321bb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23224
Reviewed-by: David Neto <dneto@google.com>
Add a guard variable for flow control within that if-selection.
Also, the premerge blocks are always surrounded by an if-selection,
to ensure we cause reconvergence at the end of the original if-selection
construct, just like in the original SPIR-V.
Bug: tint:3
Change-Id: I614c6840e539bf9a338058beb5b6f70484e3320a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23182
Reviewed-by: dan sinclair <dsinclair@google.com>
We've already written those tests.
Bug: tint:3
Change-Id: Ic836be43b5f1220e3563e4d27abd9b5e2ab54460
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23180
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL adds the ability to attach a stride to an array type and have it
emitted during SPIR-V generation.
Bug: tint:5
Change-Id: I9c0f0a6afef6ae6662b64f4da2c150ba3f8da29f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23223
Reviewed-by: David Neto <dneto@google.com>
This CL updates the type determination code to determine the types of
module scoped variable constructors.
Bug: tint:89
Change-Id: Icd5d65409fcf17a0cbf0b34b9919f8d9e1577354
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23220
Reviewed-by: David Neto <dneto@google.com>
This supports the extended instructions used by the compute_boids
example.
Bug: tint:3
Change-Id: I364c343217139e489377dd2a9330058114023caa
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23126
Reviewed-by: dan sinclair <dsinclair@google.com>
- Avoid redundant switch-break.
WGSL does an implicit break at the end of a switch case, because
it has fallthrough.
TODO: Emit fallthrough
Bug: tint:3
Change-Id: Ida44b13181a01a2c1459c0447dac496ba5b97ffc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/22961
Reviewed-by: dan sinclair <dsinclair@google.com>
tint.h selectively includes headers depending on what features are enabled. It
is based off of the original sample code, so should give users access to all of
the functionality demonstrated in there.
This is located in include/tint/, so that users can have a pretty include of
tint/tint.h.
BUG=tint:87
Change-Id: I8659c789c154349e4e8e7730dc334da4fb6eba70
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23124
Reviewed-by: dan sinclair <dsinclair@google.com>
In BlockInfo, remove the backpointers from true-head, false-head, and
premerge-head to the if-selection header block.
Convert the forward references from if-selection to its internal heads
from pointers to IDs.
Bug: tint:3
Change-Id: Ic931df519795e14374bff4f60ad37a4b32f79c91
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/23140
Reviewed-by: dan sinclair <dsinclair@google.com>