Commit Graph

7 Commits

Author SHA1 Message Date
Ben Clayton 8ec32a6ec9 writers: Use the new sem::Module::DependencyOrderedDeclarations
As the resolver currently enforces in-order declarations, this does not
change the declaration order from iterating over the
ast::Module::GlobalDeclarations.

The MSL backend has been changed to use the
sem::Module::DependencyOrderedDeclarations list instead of looping over
different declaration types separately.

Bug: tint:1266
Change-Id: I698d612032285311017bfceab3c42adae1928a0e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/79767
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-02-09 23:55:51 +00:00
James Price a5d73ce965 transform/shader_io: Generate a wrapper function
This is a major reworking of this transform. The old transform code
was getting unwieldy, with part of the complication coming from the
handling of multiple return statements. By generating a wrapper
function instead, we can avoid a lot of this complexity.

The original entry point function is stripped of all shader IO
attributes (as well as `stage` and `workgroup_size`), but the body is
left unmodified. A new entry point wrapper function is introduced
which calls the original function, packing/unpacking the shader inputs
as necessary, and propagates the result to the corresponding shader
outputs.

The new code has been refactored to use a state object with the
different parts of the transform split into separate functions, which
makes it much more manageable.

Fixed: tint:1076
Bug: tint:920
Change-Id: I3490a0ea7a3509a4e198ce730e476516649d8d96
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60521
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-08-04 22:15:28 +00:00
Ben Clayton 33afd6ce97 Revert "writer/hlsl: Special case negative zero"
This reverts commit efceb83536.

Reason for revert: Possibly broke tint -> dawn roll (again)

Original change's description:
> writer/hlsl: Special case negative zero
>
> Fixed: tint:960
> Change-Id: I04de8713fe299607f32fd93288a22b75a9dff381
> Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58760
> Reviewed-by: Ben Clayton <bclayton@chromium.org>
> Reviewed-by: James Price <jrprice@google.com>
> Commit-Queue: Ben Clayton <bclayton@google.com>
> Kokoro: Kokoro <noreply+kokoro@google.com>

TBR=bclayton@google.com,jrprice@google.com,bclayton@chromium.org,noreply+kokoro@google.com,tint-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Ic3042dabbd5a399851185714a6dd5e33ba8a5fc6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59023
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2021-07-20 20:35:41 +00:00
Ben Clayton efceb83536 writer/hlsl: Special case negative zero
Fixed: tint:960
Change-Id: I04de8713fe299607f32fd93288a22b75a9dff381
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58760
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2021-07-20 12:45:30 +00:00
Ben Clayton 5d922d02fc Revert "writer/hlsl: Special case negative zero"
This reverts commit 26b6edc545.

Reason for revert: Seems to be breaking Dawn's tests. Investigation required.

Original change's description:
> writer/hlsl: Special case negative zero
>
> Fixed: tint:960
> Change-Id: I060bc6b7a9ad4d21dd5cadb4b68998c7e54ebaed
> Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57142
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Ben Clayton <bclayton@google.com>
> Auto-Submit: Ben Clayton <bclayton@google.com>
> Reviewed-by: James Price <jrprice@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ia0b0ec996f2ed6b1599a344c970f155c12314ea9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57460
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2021-07-08 16:49:33 +00:00
Ben Clayton 26b6edc545 writer/hlsl: Special case negative zero
Fixed: tint:960
Change-Id: I060bc6b7a9ad4d21dd5cadb4b68998c7e54ebaed
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57142
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2021-07-07 11:19:20 +00:00
Ben Clayton 692fc20797 [writer/hlsl,msl] Correctly generate inf and nan literals
Also add missing msl macros to the renamer.

Bug: tint:951
Change-Id: I543e6eae885c979596ca63f9d6c7378dd5425e8a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56941
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
2021-07-06 09:43:49 +00:00