Block statements will now be parsed in ParserImpl::statement()
Change-Id: I28f63d4a53c85c0306c57df545f78b4562c6ea7b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/27262
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Test a value that should stably convert to decimal exponent
representation. This might be working around a bug in the MSVC runtime
library.
Bug: tint:201
Change-Id: I37200cef815cafc35284c8c873dfbb8a5312360e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/27160
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This CL check validation rule v-0019: Functions used in entry points must exist.
Bug: tint: 6
Change-Id: Ic4d4702cac53dcdaa1207425a6214d53cacb2442
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/27100
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This CL validates the following rule. ie. As functions must be defined before use (v-0005), self-recursion is only case that has to be invalidated.
v-0004: Recursions are not allowed.
Bug: tint: 6
Change-Id: Icfb040907c5ea0abb6359dade74dcfc30a0db7d9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26980
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This Cl adds support for imported methods to the HLSL backend.
Bug: tint:7
Change-Id: Ib906542915670dcc916d48d9e5d64d7032ba829a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26928
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This CL adds the beginning of intrinsic emission for the HLSL backend.
The `outer_product`, `is_normal` and `select` intrinsics are currently
missing.
Bug: tint:7
Change-Id: Ice7a2b285eeb52041e3accd9751e127d6c5a0177
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26927
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This CL adds support for cast expressions to the HLSL backend.
Bug: tint:7
Change-Id: Ie7e180dc89abf137ab7d9b8790cc4206b3d5a672
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26926
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This CL adds the missing tests for emission of Entry Point Data
structures.
Bug: tint:7
Change-Id: If21071b07584780243ccd0629a92efa653640251
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26925
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This CL adds emission of module constants to the HLSL backend.
Bug: tint:7
Change-Id: Iff07b0c0de7351f400dc35ca2ac07b44b22f8499
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26924
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
You can only typedef builtin types in HLSL. This Cl updates the struct
emission to emit named structs instead of typedef'd structs.
Bug: tint:7
Change-Id: I835b7f4d23bc225c730ef3f39c4572c043a58156
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26921
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This CL adds emission of uniform storage class variables to the HLSL
backend. If the variable is a base type (float, int, etc) it is emitted
as a `cbuffer`. If the variable is a struct it will emit as a
`ConstantBuffer`.
Bug: tint:7
Change-Id: I9932d30df24c023c58d3a2ba4167bcb7ccb85dae
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26920
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This Cl adds support for call expressions into the HLSL backend.
Bug: tint:7
Change-Id: Id07e3d95e745aa016a658c3ec5d099f74f21a80e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26781
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This CL adds the beginning of support for input/output locations and
builtins in the HLSL backend.
Bug: tint:7
Change-Id: I8fb01707b50635a800b0d7317cf4a8f62f12cfca
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26780
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
This CL adds the beginning of function handling to the HLSL generator.
Bug: tint:7
Change-Id: Id40109c342e7a128b1fe79a0c50967e1dbd125eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26662
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
This CL adds a disabled test for validating following rule:
v-0004: Recursion is not allowed
Bug: tint: 6
Change-Id: I35d51b08174ac23a4b1def9f762e80c5950a726d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26942
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
When emitting a global constant we'd early exit the emission code before
emitting the debug statement for the constants name. This Cl adds the
needed code to emit names for global constants.
Change-Id: I1a7a3660b4ff31879393a6a776a9f00e895de216
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26923
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This CL checks if the return statement type matches the function return type
Bug: tint 6
Change-Id: I621d67086291c392b68261673a25c0e6caca71ae
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26860
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This CL implements and add a test for the following validation rule:
v-0016: Function names must be unique
Bug: tint: 6
Change-Id: I9f135dd577863e41f03a2d02adebe4347a9922eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26782
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This CL checks if functions end with a return statement (v-0002)
reworks previously added tests to pass
enables related tests
Bug: tint: 6
Change-Id: Iafe46581ccc50e146b33d33f9577d995a7f80d77
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26722
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This CL adds a function which returns the last statement of a ast::Function
Change-Id: I1dc68b7f4669c17a24a62c03a87dcc95866a428d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26720
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
This CL adds a disabled test for validation rule v-0002: functions must
end with a return statement
Bug: Tint: 6
Change-Id: I127aa1bd7d236ff353fd89024b274c9f9b463f15
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26680
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
This CL adds the needed `memory` include for clang on windows and fixes
up some issues to make doxygen happy again.
Change-Id: I2c3f21aa086b079d3b861786834bcf4370123a7d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26703
Reviewed-by: Idan Raiter <idanr@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Finds entry points, and uses set 4 intentionally as it is bigger than
the maximum set for users.
Bug: dawn:480
Change-Id: I24f01d770ba43796233aeb40b3b6b2ae9b3c3663
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26520
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Adds a first-pass version of vertex pulling. This is missing several important things such as buffer offsets, support for more types, and clamping.
Bug: dawn:480, tint:206
Change-Id: Ia8a3abc446bca4c5a40e064f85fb59de1c3f5af9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26260
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
This CL adds implementations and tests for these validation rules:
v-0011: Global variable names must be unique
v-0013: Variables declared in a function must be unique between that function and any global variables.
v-0014: Variables declared in a function must have unique names
Bug: tint 6
Change-Id: I793485c981f67abc6a3dc81d35be743ccc18db5b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26480
Reviewed-by: dan sinclair <dsinclair@chromium.org>
A few of the tests depend on floating point string output which is
slightly different on MSVC. Disable for now.
Bug: tint:201
Change-Id: I51510a1192488f4e391dfb3560b5b6a2915ebcd1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26220
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
WGSL matrices are always column major, with tightly packed columns.
We need to infer that layout and decorate the containing structure
members, if those members require a layout.
Bug: tint:200
Change-Id: Ieceb460ed6c7eeb1244beecbf4e0eee0b8b8e373
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26180
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
This CL adds the texture types into the AST.
Bug: tint:141
Change-Id: I8e95aa23849af737e63d9cacc8c57f23aedec73d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26123
Reviewed-by: David Neto <dneto@google.com>
This CL adds the sampler type into the AST.
Bug: tint:141
Change-Id: Id2f7678a2df677cb7dae47f05543c1e0a1999eed
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26080
Reviewed-by: David Neto <dneto@google.com>
This CL adds support for the LoopStatement emission in HLSL.
Bug: tint:7
Change-Id: Ie42b24abff3a69c9cbfe3d3c8ab6fb9b1823e61d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25849
Reviewed-by: David Neto <dneto@google.com>
This CL adds if/else statement emission to the HLSL writer.
Bug: tint:7
Change-Id: Idd6e6d8c329ed270676fa0276474a68c715dd9eb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25847
Reviewed-by: David Neto <dneto@google.com>
This CL adds variable declarations to the HLSL backend.
Bug: tint:7
Change-Id: I5c1e42ca26029f1595bf4f23b3b867a492ddacc1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25846
Reviewed-by: David Neto <dneto@google.com>
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>
This CL adds array stride decorations to the WGSL writer.
Bug: tint:179
Change-Id: I39d7625e1bdc876bbf9a83da7af76eb98bd09c28
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26002
Reviewed-by: David Neto <dneto@google.com>
Insert will be used for adding code at the beginning of a function, and
non-const global_variables to edit decorations.
Bug: dawn:480
Change-Id: I9fbb0210a95b8488c9ce6d9a536a68f169b0cc33
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25850
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>