dawn-cmake/docs/tint/layering.md
dan sinclair accc687b32 Add tint layering doc.
A simple MD file to show the source set hierarchy which constrains where
includes can go in Tint.

Change-Id: Ia360430793faef01503260f29f88ef361bb91611
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120443
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-20 09:56:29 +00:00

2.9 KiB

Tint Source Layering

The BUILD.gn is setup with small source units for various components in Tint. The hierarchy of sources almost matches to folder structure in tint (except for base which is a mix of things in src/tint and src/tint/util.

+-----------------------------------------+
|         Readers | Writers               |
+-----------------------------------------+
                  |
                  V
+-----------------------------------------+
| Val | Demangler | Inspector | Transform |
+-----------------------------------------+
   |              |
   +--------------+------------------------------+
                  |                              |
                  V                              V
+-----------------------------------------+ +-----------+
|                AST                      | |  Utils IO |
+-----------------------------------------+ +-----------+
                  |                              |
                  V                              |
+-----------------------------------------+      |
|        Program  | Sem                   |      |
+-----------------------------------------+      |
                  |                              |
                  V                              |
+-----------------------------------------+      |
|              AST Hdrs                   |      |
|    (program and sem cause a cycle)      |      |
+-----------------------------------------+      |
                  |                              |
                  V                              |
+-----------------------------------------+      |
|        Clone Context Hdrs               |      |
|    (program and sem cause a cycle)      |      |
+-----------------------------------------+      |
                  |                              |
                  V                              |
+-----------------------------------------+      |
|             Constant                    |      |
+-----------------------------------------+      |
                  |                              |
                  V                              |
+-----------------------------------------+      |
|               Types                     |      |
+-----------------------------------------+      |
                  |                              |
                  V                              |
+-----------------------------------------+      |
|              Builtin                    |      |
+-----------------------------------------+      |
                  |                              |
                  |------------------------------+
                  V
+-----------------------------------------+
|               Base                      |
+-----------------------------------------+
                  |
                  V
+-----------------------------------------+ +-------------+
|            Text  (unicode)              | | Initializer |
+-----------------------------------------+ +-------------+