Commit Graph

4 Commits

Author SHA1 Message Date
Ben Clayton 32cb9cf2f8 tint/writer: Disable constant inlining for lets
Once 'const' is introduced, let will no longer resolve to a
creation-time constant value.

Add temporary code into each of the writers to prevent constants that
originate from a 'let' from being inlined. This will reduce the amount
of noise in later CLs.

Bug: tint:1580
Change-Id: Id3493a43ac09fe9f042ff2d517d04b2ae854d43e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94541
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-06-24 18:15:39 +00:00
Ben Clayton 25b7e98d11 tint/writer/glsl: Inline constant expressions
This is required to handle materialized values, and for constant
expressions.

Bug: tint:1504
Change-Id: Ie0177f148e08a0e1a3f4d7e06e283f121655804b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92080
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
2022-06-01 01:11:59 +00:00
James Price d68d3a9809 Add support for increment/decrement statements
Refactor the ExpandCompoundAssignment transform to handle these
statements, which delivers support for all of the non-WGSL backends.

Fixed: tint:1488
Change-Id: I96cdc31851c61f6d92d296447d0b0637907d5fe5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86004
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-04-07 13:42:45 +00:00
James Price b02fe31e46 wgsl: Add support for increment/decrement statements
Implemented in both the reader and writer with E2E tests. Other
backends will ICE for now.

Bug: tint:1488
Change-Id: Ied2afa55a338347f427dee98a4076643ac432d9c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86003
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-04-07 13:42:45 +00:00