Commit Graph

5 Commits

Author SHA1 Message Date
Ben Clayton 9ef52ffd8c writer/hlsl: Use the WrapArraysInStructs transform
Fixes issues with using arrays as function return types.

Fixed: tint:848
Change-Id: Iee8af0f2cea9d19e448176446c6599be2bd32316
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54321
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
2021-06-16 09:19:36 +00:00
Ben Clayton 5d2f34ecf2 writer/hlsl: Simplify emission logic, clean up output
And fix issues where global variables would not be emitted unless they were transitively referenced by an entry point.

This change requires crbug.com/tint/697 to be fixed before landing.

Change-Id: I712bd9d369e08c9a3cdfb0f114c3609584f91f28
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54241
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
2021-06-16 09:19:36 +00:00
Ben Clayton ada560b289 writer/hlsl: Fix continuing block emission
Inline the `continuing` block in the places where `continue` is called.

Simplifies the emission, and fixes emission of `let` statements in the loop.

Also fix random indenting of intrinsic functions.

Fixed: tint:744
Fixed: tint:818
Change-Id: I06994dbc724bc646e0435a1035b00760eaf5f5ab
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51784
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-05-20 21:31:37 +00:00
Ben Clayton 09d53d5ed1 writer/hlsl: Emit `static` for private global variables
Fixed: tint:812
Change-Id: I822eb6b13f07a74eb47c4c8e18d1f75dcc4818bf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51366
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: David Neto <dneto@google.com>
2021-05-19 09:03:48 +00:00
Ben Clayton 634c829d2c test: Move bug cases to sub-directories
The test runner now recursively scans sub-directories.
Use this for sensibly structuring our test files.

test/bug/tint/###.[wgsl,spvasm] files refer to bugs filed at:
crbug.com/tint/###

Change-Id: I9b4d8d134c8494b0f48c8656f3bf694f76d5303f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51221
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2021-05-17 21:01:37 +00:00