Commit Graph

114 Commits

Author SHA1 Message Date
Ben Clayton 00b77a80ab Rework all transforms to transform-on-copy
instead of transform-in-place.

This is a public API breaking change, so I've added the `DAWN_USE_NEW_TINT_TRANSFORM_API` define which is used by Dawn to know which API to use.

As we're going to have to go through the effort of an API breaking change, use this as an opportunity to rename Transformer to Transform, and remove 'Transform' from each of the transforms themselves (they're already in the transform namespace).

Bug: tint:390
Bug: tint:389
Change-Id: I1017507524b76bb4ffd26b95e550ef53ddc891c9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34800
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-12-04 09:06:09 +00:00
Ben Clayton 76d12f0f5a Add EmitVertexPointSizeTransform
EmitVertexPointSizeTransform is a Transformer that adds a PointSize builtin global output variable to the module which is assigned 1.0 as the new first statement for all vertex stage entry points.

If the module does not contain a vertex pipeline stage entry point then then this transformer is a no-op.

Bug: tint:321
Change-Id: I0e01236339d9fa1ceab3622af0931a1199c33b99
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34561
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-12-03 14:54:09 +00:00
Ben Clayton 3e67c5dba6 Move type_manager to the ast dir/namespace
First step to moving this to the `ast::Module`.

Also remove a bunch of redundant includes to `type_manager.h` as this is already included in `context.h`

Bug: tint:307
Bug: tint:337
Change-Id: Ic4baffa7b76ddefa29f56f758c25b1003ef40888
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33665
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-23 19:30:55 +00:00
dan sinclair 196e097730 Place the namer into the context object.
This CL moves the namer into the context object and makes it a parameter
to the various generators. The old constructor is maintained until we've
updated downstream repos.

Bug: tint:273
Change-Id: I49b2519c4250be21fb73374b16e7c702b727078f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32580
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-11-13 18:13:24 +00:00
Sarah Mashayekhi 34f90a0097 [validation] make validator directory
Change-Id: Ia5caea84b48b37f0bee9582ee4c8514da4ee3978
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31981
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-06 17:31:15 +00:00
Ryan Harrison 4735f01193 Move diagnostic/printer.h into the public API
Bug: None
Change-Id: I6dc33f3e589de80b225199fb01a0d80df774ada3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31740
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2020-11-03 19:13:50 +00:00
Ryan Harrison 8904253837 Add getting constant ID information from Inspector
This also involves a reorganization of the code into its own
subdirectory.

BUG=tint:253

Change-Id: If05018da2662e923e659b485576704f3a6bcd062
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30340
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-16 02:26:54 +00:00
dan sinclair 70b4c3baad [transform] Add transforms to the sample app.
This CL extends the sample app to allow running the bound array accessor
transform.

Bug: tint:206
Change-Id: I226a947a2e0a9e0945aa044b2847b4fd62b7c277
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29122
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-30 00:05:23 +00:00
dan sinclair 5c948e4f8f [transform] Move the transform folder
This CL moves the transform folder from src/ast to src/. The transforms
operate on the AST, but they aren't part of the AST so I think the top
level folder makes more sense.

This will possibly cause issues when rolling if the transform is being
used.

Change-Id: Ibd7c94474168a7a4bdf38321f4e12ad111c80323
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28941
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-09-24 14:30:34 +00:00
dan sinclair e7ec7f1689 [wgsl-writer] Add GenerateEntryPoint
This Cl adds the preliminary GenerateEntryPoint method to the WGSL
writer.

Bug: tint:211
Change-Id: Ib414ff66d482179f10eeeb890f6127bc585cd664
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/28045
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
2020-09-03 01:46:36 +00:00
Idan Raiter 63551e3b2f Add vertex pulling transform
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>
2020-08-12 17:23:58 +00:00
dan sinclair feffa9d887 [hlsl-writer] Scaffold the HLSL backend.
This CL adds the scaffolding for the HLSL backend.

Bug: tint:7
Change-Id: Iaf9f5159bc409f3ac71fcec281229258bdfa021b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/25000
Reviewed-by: David Neto <dneto@google.com>
2020-07-20 22:13:37 +00:00
dan sinclair 2a59901483 [metal-writer] Stub out the Metal Shading Language backend.
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>
2020-06-23 17:48:40 +00:00
Ryan Harrison be45ff5081 Create tint.h for external users
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>
2020-06-11 19:35:20 +00:00