Commit Graph

15 Commits

Author SHA1 Message Date
dan sinclair b950e80a59 [type-determiner] Move ast::Module to constructor.
This CL moves the ast::Module to be provided to the type determiner
constructor so we can access it for things like the imports.

Change-Id: I110fffe669a8a007461bf84d30d85d70405e37be
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19761
Reviewed-by: David Neto <dneto@google.com>
2020-04-20 14:20:01 +00:00
Ryan Harrison 460345d993 Add support for WGSL writing to BUILD.gn
BUG=tint:49

Change-Id: I4473176d4177a719b7b2659f765b6b467ac43c84
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19682
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-15 20:54:10 +00:00
Ryan Harrison 0caab67e6e Add support for WGSL reading to BUILD.gn
BUG=tint:47

Change-Id: Ic50421f4dc712c614cf5783027ba273b53b2bd83
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19681
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-15 20:47:55 +00:00
Ryan Harrison 9459dbf3ab Use the correct pop pragma
BUG=tint:43

Change-Id: If0f6ff0b65af4c66fe7114eb7160e93ef060fbf9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19104
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-04-08 18:52:53 +00:00
dan sinclair fa9dbf0dda Add type determiner infrastructure.
This CL adds the Context object, variable ScopeStack and a Function map
into the type determiner.

The sample app is also updated to verify the module produced before
passing to the type determiner.

Bug: tint:5
Change-Id: Ib4af4e4305ee8a306f48e1bd328eaf3ad006fd9a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/18823
Reviewed-by: David Neto <dneto@google.com>
2020-04-06 18:43:56 +00:00
dan sinclair baaf989452 [spirv-writer] Add function variables
This Cl adds function variables to the SPIR-V output. This requires some
refactoring to split function instructions and variables apart in the
builder.

Bug: tint:5
Change-Id: I4d0045f5a02311cf9a2803929c66c648278e3734
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/18600
Reviewed-by: David Neto <dneto@google.com>
2020-04-01 23:40:53 +00:00
David Neto a8cd18e9e7 Context object owns a TypeManager
Add a Context::Reset method to clear state.

Hide the member behind an accessor.

Change-Id: Iafb7c39249f66f70c5a99a8ed1c69f2c0238834f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17742
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-03-27 00:47:16 +00:00
dan sinclair f26d9a8f26 Cleanup doc and lint warnings.
This CL fixes up several documentation and linter warnings.

Change-Id: Ic367ba1937f20dfe47a8c8e4035c17e8a3d0f2e8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17880
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-03-26 15:31:36 +00:00
dan sinclair 9981b63fa4 Use a context object instead of a singleton
This Cl replaces the TypeManager singleton with a context object.

Bug: tint:29
Change-Id: Ia662709db1b562c34955633977ce4363f28f238e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17780
Reviewed-by: David Neto <dneto@google.com>
2020-03-25 19:16:36 +00:00
dan sinclair 4b71b9ed2b Expand build flags for Tint.
This CL extends the build options to Tint to make the various readers
and writers all optional.

Change-Id: I913e1830b1bb2243eff5deb4b8079ba592dd52e1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16801
Reviewed-by: David Neto <dneto@google.com>
2020-03-18 14:08:48 +00:00
dan sinclair e4392c9ab5 Create SPIR-V writer skeleton.
This CL creates the skeleton for the SPIR-V writer.

Bug: tint:5
Change-Id: I849d8766d32d48314a51096710272f9821e2c1c4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16641
Reviewed-by: David Neto <dneto@google.com>
2020-03-17 21:00:22 +00:00
David Neto 4df5d409c4 Rename tint::reader::spv -> tint::reader::spirv
Bug: tint:3
Change-Id: Iabee55bc75f60c04d00cd1560721def903052359
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17001
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-03-17 20:08:06 +00:00
David Neto 4e7f7da729 Rename reader/spv to reader/spirv
Bug: tint:3
Change-Id: I7707e2f9e51c1574e5dde18c83957573671dac70
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17000
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-03-17 20:07:41 +00:00
David Neto bbd8987e71 Instantiate a stubbed SPIR-V parser if file ends in .spv
- spv parser just errors out for now
- link against SPIRV-Tools-opt
- Fixe CMake variable TINT_ENABLE_SPV_PARSER --> TINT_BUILD_SPV_PARSER

Bug: tint:3
Change-Id: Ie4ef9b03e001fca3cc11f65a425612755857feac
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16600
Reviewed-by: dan sinclair <dsinclair@google.com>
2020-03-10 22:54:12 +00:00
Dan Sinclair 6e581895a5 Initial commit 2020-03-02 15:47:43 -05:00