Commit Graph

61 Commits

Author SHA1 Message Date
James Price 0e6534e44d [tint] Make Transform base class
This will allow for both AST transforms and IR transforms to be used
in the same transform manager.

The transform manager is no longer a Tranform subclass.

Bug: tint:1718

Change-Id: I59bd87806090fa365ce4b575710c5ffcfc657bd8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132501
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-17 01:21:45 +00:00
James Price b4acbb8bb0 [tint] Introduce an ast::transform namespace
All AST transforms live inside this namespace. There will be a
corresponding ir::transform namespace for IR transforms.

Change-Id: I543972451c08e7df5632b835257999a8af3701d1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132424
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-05-11 21:27:16 +00:00
Ben Clayton 3731ce8f21 tint: Use new string utilities in various places
Change-Id: I8c97a8a92f5e5e3d9768933589aa304ff52ab103
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131748
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
2023-05-09 17:34:08 +00:00
Ben Clayton 895d240fbf tint/ir: Replace Converter with FromProgram() free function
ToProgram() will most likely be conditionally compiled as a separate .h
and .cc file. With just one static method, ir::Converter doesn't make a
lot of sense to be a class. Just replace with a free-function.

Bug: tint:1902
Change-Id: I305bf9cb73082a94848ec5b94129feabdb9b6fe9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131620
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-05 09:51:22 +00:00
James Price 8f9ea96c20 tint/writer/spirv: Add path for generating from IR
This adds a GeneratorImplIr class and an option to the SPIR-V writer
to use it instead of the AST-based GeneratorImpl class.

The Tint exe now has a --use-ir flag which will use this path.

Bug: tint:1906
Change-Id: I34cc5c7468c8faf4a808669da8c44551ad01da8f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131341
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2023-05-04 01:31:36 +00:00
dan sinclair 5e344a338f [ir] Split AST and SEM sources out of core ir.
This CL moves the need to pull in SEM and AST into a specific
`libtint_ir_builder_src` library. This will make it a GN error if we
accidentally try to use the SEM or AST inside the IR after the initial
construction.

This required move the `ToProgram`/`FromProgram` methods out of
`ir::Module` and into an `ir::Converter` class.

Bug: tint:1921
Change-Id: I2e6ae195f9a100030b43f35a2c5dad634433147f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/129661
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-04-27 11:56:58 +00:00
dan sinclair 889edb18b2 Add simple program for perf testing.
This CL adds a simple program which can be set to loop over specific
parts of the tint pipeline to generate profiling data.

Change-Id: I6375940619b7ef2f7e66540d4f740e6e0b9b3132
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128541
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-24 16:17:56 +00:00
dan sinclair d1d1bf7135 Split base_src apart.
This CL splits the base_src set in the GN build into a symbols_src and a
utils_src.

Change-Id: I39036a4ba5163aa816233b42d9a2ebfe34ddf038
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128361
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-21 10:54:13 +00:00
Ben Clayton 5f4847c23e tint/sem: Make BindingPoint optional
Reduces hops from sem -> ast, just to know whether the variable has a binding point.

Change-Id: I5620198e6f08b73d5a0171d95874f1a2dae5d93e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127060
Reviewed-by: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
2023-04-19 13:24:27 +00:00
dan sinclair d026e13f48 Remove `SymbolTable::NameFor`
This CL removes the `NameFor` method from SymbolTable and accesses the
symbols name directly.

Change-Id: Ic4ad6eecfa78efb946d97aeaecf2d784af2e6f16
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127301
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-18 19:38:25 +00:00
dan sinclair c4cc6ec038 Remove the demangler.
The demangler is no longer used by the Tint executable, and nothing else
calls it, so delete it.

Change-Id: Ic47238e4a6126e5daacd81dfc6f5986524b648ba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127280
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-13 21:17:12 +00:00
dan sinclair 2200823afd Allow building SPIRV_WRITER without READER
Currently the SPIR-V headers are only included when building the
SPIRV_READER. This means the build breaks if the SPIRV_WRITER is enabled
but not the reader.

This CL fixes the conditionals to include the SPIR-V header for both the
reader and the writer.

Change-Id: I8690e3e42dbe3071dcaa3ed467d6eac8f62a7bbc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127160
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-04-13 12:59:33 +00:00
Zhaoming Jiang 6af073cecc Tint&Dawn: Enable f16 override
This CL enable using f16 override, and also fix related tests in Dawn
and Tint.

Bug: tint:1473, tint:1502
Change-Id: I8336770e8a73e5023c1aba224b7b5f21692fbaa6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/124544
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2023-03-20 10:32:45 +00:00
dan sinclair 0551c4f40f Move MSL configuration for `ArrayLengthFromUniform` transform.
The configuration for the `ArrayLengthFromUniform` transform was pulled
out to generator options in a previous CL. The HLSL backend was updated
to pass this information into the generator. The MSL backend was using
the deprecated path of having the transform determine the values.

This CL updates the MSL backend to pass the information into the
generator and removes the deprecated code from the transform.

Bug: tint:1855 chromium:1421379

Change-Id: I679c57914d575a758a9ff03b9db27a051d55fe17
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123880
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-15 11:07:26 +00:00
Ben Clayton 8f80d999c4 tint: Support multiple extensions per 'enable'
Fixed: tint:1865
Change-Id: I245bd36b12ff23977c2e69deee27f976db820849
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123900
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-15 05:06:57 +00:00
dan sinclair 6521a357f5 Convert generators over to use external texture options.
This CL updates the generators to receive the exteral texture options
instead of generating them.

Bug: tint:1855 chromium:1421379
Change-Id: Ib38b902aa441e33d394f947d753075ca6a8fe73b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123260
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-03-14 16:18:24 +00:00
Ben Clayton a36fa42dd7 tint/cmd: Use correct preprocessor guard for libspriv.hpp
This header is used by TINT_BUILD_SPV_READER not TINT_BUILD_SPV_WRITER

Change-Id: Ia42e4f2bf2ad37f426d2bf14e962abed9de147a9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122520
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-09 23:46:59 +00:00
dan sinclair eebbdef81a Split `BindingPoint` out of MultiplanarExternalTexture.
This CL moves the `using` statement for `BindingPoint` out to its own
file in `src/tint/writer/binding_point.h`. Usages of
`tint::transform::BindingPoint` have been updated to
`tint::writer::BindingPoint`.

Bug: tint:1855
Change-Id: Ife7d92807e0a65b93f21158d73a60d5068fc5da9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123000
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-03-08 02:48:42 +00:00
dan sinclair 0917fbb147 Reland "Add writer to emit the AST."
This reverts commit 5e56551551.

Change-Id: I2c3da583090ebef87cc71a743746d741345847c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122782
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-03-07 18:28:38 +00:00
Austin Eng 142bddf7da Fix #ifdefs for spvtools
Change-Id: I76d8d983e44e04be4abfbb25678cab8d926fbd6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122840
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-03-07 09:27:45 +00:00
Austin Eng f244bffdd5 Fix build of tint_cmd_helper
spvtools_headers are not available without tint_build_spv_writer

Change-Id: If4539715b0e685c9b54bf24719a905fb0265a402
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122820
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
2023-03-07 02:41:45 +00:00
Dan Sinclair 5e56551551 Revert "Add writer to emit the AST."
This reverts commit a753ad47a4.

Reason for revert: This seems to be breaking `gn check` when the option is not enabled. Not sure why the preprocessor guard isn't working. Will fix and reland later.

Original change's description:
> Add writer to emit the AST.
>
> This CL adds a new `SyntaxTree` writer and a `dump-syntax-tree` option
> to the `tint` program which emits a copy of the AST to the terminal.
>
> Change-Id: I83f6cd7aad3413b0a823728e8aac0d551421b33a
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122540
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>

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

Change-Id: Icaac76f8daba6034658cf05e15f15676ce2bf155
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122760
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-03-06 20:30:23 +00:00
dan sinclair a753ad47a4 Add writer to emit the AST.
This CL adds a new `SyntaxTree` writer and a `dump-syntax-tree` option
to the `tint` program which emits a copy of the AST to the terminal.

Change-Id: I83f6cd7aad3413b0a823728e8aac0d551421b33a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122540
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-03-06 17:48:33 +00:00
Ben Clayton f7910f5b95 tint.h: Remove 'libspirv.hpp' include
This does not belong in the public header - the spirv writer public header does not depend on it.

Change-Id: Id1b2107c3a2003632e1868c2d6a337ddbb0c8b48
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122382
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2023-03-03 14:20:53 +00:00
dan sinclair 6cc183c85a Generic template and forward in stringstream.
This CL updates the templates in the StringStream to match more types.
All of the internal `operator<<` methods have been converted over to
StringStream. The precision was increased in order to better match the
precision needed to read back as a double.

Bug: tint:1686
Change-Id: Iaa15cf247f174967dd1014647ba5a74804997c22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122080
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-03-02 21:28:45 +00:00
Ben Clayton 03de0e83ae Move tint::transform::Robustness to a santizier transform
There's no good reason for this to be public.
Move it into the writers, and expose a 'disable_robustness' option to
turn it off. This can be expanded to hold more fine-grain control in the
future.

Change-Id: I6ea6e54a27b2ae0fbcba5fdf45539063045cc15a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122203
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2023-03-02 20:48:48 +00:00
dan sinclair dee884c925 Convert most remaining usages to utils::StringStream.
This CL converts most of the remaining Tint usages (leaving out the
fuzzer code and some float_to_string code).

Bug: tint:1686
Change-Id: I4d5cef176c15479250861903870ec5bec0f95b5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122002
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-28 22:22:58 +00:00
dan sinclair e4039c76c7 Move the Extension builtin to the builtin/ folder.
This CL moves Extension from ast:: to builtin::

Change-Id: Ica1e6f4f9229341b547011389d47ae3be9830b0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120362
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-17 21:58:59 +00:00
dan sinclair be967e31fc Add JSON output to tint_info.
This CL adds a `--json` output to the `tint_info` command to generate a
JSON file of the WGSL program information.

Change-Id: I8cdd9675954f793fc7142d857f846a18f4a07ffc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120082
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-02-16 19:22:19 +00:00
dan sinclair c1799cc75a Add a `tint_info` command.
This CL adds a second command `tint_info`. The `tint_info` command can
be used to dump information about a WGSL program to the console. This
includes things like the inputs and outputs to an entrypoint along
with structure information like offsets and alignments.

Bug: 1825
Change-Id: Ia2fb4be08b39c1a592f78a388d34edf9af8b6a0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118643
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-02-06 16:28:37 +00:00
dan sinclair 2da119a0ce Split constant and type out of libtint_core_all_src
This CL moves the constant and type headers out of the
`libtint_core_all_src` target. In order to do so a `libtint_base_src`
target is created with the bits of core_all that are required to build
constant/ and type/ along with all the util/ files.

Change-Id: Idb016f51e9dcaa84b6d7a14e4e5f62d4a46a4161
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117582
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2023-01-25 18:39:00 +00:00
James Price f38ee3e073 tint/exe: Add --allow-non-uniform-derivatives flag
When used with the SPIR-V reader, this will insert a module-scope
diagnostic directive to suppress uniformity violations for derivative
operations.

Bug: tint:1809
Change-Id: I2305265231ccffad49461d194669ba598484e8e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117740
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-01-25 01:24:46 +00:00
dan sinclair d54dabeab5 Split the reader/ and writer/ out of libtint_core_all_src.
This CL splits the code in `reader/` and `writer/` out of the
`libtint_core_all_src` target and into individual `libtint_reader_src`
and `libtint_writer_src` targets. The various readers and writers are
updated to have the specific target as dependencies.

The `deps` are moved to being private from `public_deps`. The places
where dependencies were missing are updated.

Change-Id: I4e30113cdc6b1e1941efa34ce6579f8f501201ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117242
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-01-21 18:50:20 +00:00
Ben Clayton d03dceebf3 tint: Add bgra8unorm storage texture support
Polyfill this for the SPIR-V, HLSL and GLSL backends by replacing bgra8unorm with rgba8unorm, and swizzling.

Bug: tint:1804
Change-Id: I36638202840d7313001dff6c5b60dcb948988c34
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117204
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-01-18 19:42:03 +00:00
dan sinclair 19ebcb2230 Convert ir::Constant over to use a constant::Value
This CL updaets the ir::Constant to store a constant::Value instead of the specific numbers
themselves.

Bug: tint:1718
Change-Id: I66b0a9643893b6079399daf61ee39ac5811e1eaf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114362
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-12-15 19:17:22 +00:00
dan sinclair 669e15e139 [ir] Add EmitBinary
This CL adds the machinery to emit binary operations to the IR. The
debug helper is split into Debug and Disassembler. The Disassembler is
used to help test the IR output.

Bug: tint:1718
Change-Id: Iffdd3be92e69a87828655ac41be91b34d5618174
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110841
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-11-23 02:11:52 +00:00
dan sinclair 5fbce71eea Change some kNone to kUnknown.
Missed a couple kNone settings in the Tint executable when attempting
to determine the output format. This CL updates the to be kUnknown.

Change-Id: Ia0c4293fe69711cf1de878255bd18c6eeec4bffe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110502
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-17 18:42:39 +00:00
dan sinclair c214cbe98b Add a `none` format.
This CL adds a `none` format to the tint command in order to allow
skipping the emission of the resulting program. This adds a `unknown`
format to take the place of the original `none`.

Change-Id: Ib25e933857c0acb26e3cf0e04ed8a5d1cca1e633
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110480
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-16 22:29:12 +00:00
dan sinclair c6d46994af [ir] Add framework to dump IR to text
This CL adds the framework and `tint` option to write the IR to stdout
as text for debug purposes.

Bug: tint:1718
Change-Id: I05bd83635800fbfe3b65d968a84b30931ec1bdb6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110171
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-16 14:36:30 +00:00
Ben Clayton 1ef277db0e tint: Skip e2e test validation for known-good
Cache the hash of the test output, and only re-validate if the output changes.
This speeds up incremental end-to-end testing.

Change-Id: I44bc1eff62320df1e80524e8481d1c012fb67f42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109761
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2022-11-14 13:58:36 +00:00
Ryan Harrison 4e0eac148d Manual Roll third_party/vulkan-deps/ a7a3fb393..c29c532c9 (71 commits)
https://chromium.googlesource.com/vulkan-deps/+log/a7a3fb39310c..c29c532c92db

$ git log a7a3fb393..c29c532c9 --date=short --no-merges --format='%ad %ae %s'
2022-11-10 chromium-autoroll Roll Vulkan-ValidationLayers from 096b2903118c to f276f028ee79 (1 revision)
2022-11-10 chromium-autoroll Roll Vulkan-ValidationLayers from 45b81b398ab4 to 096b2903118c (2 revisions)
2022-11-10 chromium-autoroll Roll Vulkan-ValidationLayers from 983b408199f2 to 45b81b398ab4 (3 revisions)
2022-11-10 chromium-autoroll Roll Vulkan-Headers from f97f29836cb9 to 29c0457cc167 (1 revision)
2022-11-10 chromium-autoroll Roll Vulkan-Tools from e8234991418c to 3a729c0a9d58 (1 revision)
2022-11-10 chromium-autoroll Roll SPIRV-Tools from aae7d4132571 to 68e8327f2932 (2 revisions)
2022-11-10 chromium-autoroll Roll Vulkan-Loader from 1b40be299b02 to 0df63661a5fa (1 revision)
2022-11-10 chromium-autoroll Roll Vulkan-ValidationLayers from e7380d60c9a6 to 983b408199f2 (8 revisions)
2022-11-10 chromium-autoroll Roll Vulkan-Headers from 689821914113 to f97f29836cb9 (1 revision)
2022-11-10 chromium-autoroll Roll Vulkan-ValidationLayers from afd4e9d82d92 to e7380d60c9a6 (3 revisions)
2022-11-10 chromium-autoroll Roll Vulkan-ValidationLayers from fc9da6832a2b to afd4e9d82d92 (1 revision)
2022-11-10 chromium-autoroll Roll Vulkan-ValidationLayers from 1059ee93ebff to fc9da6832a2b (1 revision)
2022-11-10 chromium-autoroll Roll Vulkan-ValidationLayers from 065b8cbc41cb to 1059ee93ebff (1 revision)
2022-11-09 chromium-autoroll Roll Vulkan-Loader from 7e61110364b4 to 1b40be299b02 (2 revisions)
2022-11-09 chromium-autoroll Roll SPIRV-Tools from 525bc38062ab to aae7d4132571 (1 revision)
2022-11-09 chromium-autoroll Roll Vulkan-Loader from 5b054b4333fd to 7e61110364b4 (1 revision)
2022-11-09 chromium-autoroll Roll Vulkan-ValidationLayers from f162411346bb to 065b8cbc41cb (1 revision)
2022-11-09 chromium-autoroll Roll Vulkan-Tools from 6e5bd86b76c0 to e8234991418c (1 revision)
2022-11-09 chromium-autoroll Roll Vulkan-ValidationLayers from 8a253a6c5b7a to f162411346bb (1 revision)
2022-11-09 chromium-autoroll Roll Vulkan-ValidationLayers from e09172e79c0b to 8a253a6c5b7a (1 revision)
2022-11-08 chromium-autoroll Roll Vulkan-Loader from 6442b72aea02 to 5b054b4333fd (1 revision)
2022-11-08 chromium-autoroll Roll glslang from f4cba22d0824 to 2b2523fb951f (1 revision)
2022-11-08 chromium-autoroll Roll Vulkan-ValidationLayers from 212ea587c100 to e09172e79c0b (1 revision)
2022-11-08 chromium-autoroll Roll Vulkan-Headers from ef96d229cb3d to 689821914113 (1 revision)
2022-11-08 chromium-autoroll Roll SPIRV-Tools from 54d4e77fa559 to 525bc38062ab (1 revision)
2022-11-08 chromium-autoroll Roll glslang from 5e08deae050c to f4cba22d0824 (1 revision)
2022-11-08 chromium-autoroll Roll Vulkan-Headers from 1661f3e962f5 to ef96d229cb3d (3 revisions)
2022-11-08 chromium-autoroll Roll Vulkan-ValidationLayers from 2dbf684715c2 to 212ea587c100 (2 revisions)
2022-11-08 chromium-autoroll Roll SPIRV-Tools from a5e766b2b47c to 54d4e77fa559 (1 revision)
2022-11-08 chromium-autoroll Roll Vulkan-ValidationLayers from bcf3a2bd93f2 to 2dbf684715c2 (1 revision)
2022-11-08 chromium-autoroll Roll SPIRV-Cross from abc31207bffb to edd66a2fc9e9 (1 revision)
2022-11-08 chromium-autoroll Roll Vulkan-ValidationLayers from 8382dbcaeb7c to bcf3a2bd93f2 (3 revisions)
2022-11-08 chromium-autoroll Roll Vulkan-ValidationLayers from b5cbd4242593 to 8382dbcaeb7c (2 revisions)
2022-11-08 chromium-autoroll Roll Vulkan-Headers from 91388ba10409 to 1661f3e962f5 (1 revision)
2022-11-07 chromium-autoroll Roll Vulkan-Loader from 6b0551428e57 to 6442b72aea02 (1 revision)
2022-11-07 chromium-autoroll Roll Vulkan-ValidationLayers from 2632b3362f77 to b5cbd4242593 (1 revision)
2022-11-07 chromium-autoroll Roll Vulkan-ValidationLayers from 8a1cdac2bde1 to 2632b3362f77 (1 revision)
2022-11-07 chromium-autoroll Roll Vulkan-ValidationLayers from 94c32cc2541c to 8a1cdac2bde1 (1 revision)
2022-11-07 chromium-autoroll Roll Vulkan-Loader from 8ff839bda370 to 6b0551428e57 (1 revision)
2022-11-07 chromium-autoroll Roll Vulkan-Headers from 52b7c620a540 to 91388ba10409 (1 revision)
2022-11-07 chromium-autoroll Roll Vulkan-ValidationLayers from 62eb78a06365 to 94c32cc2541c (1 revision)
2022-11-07 chromium-autoroll Roll Vulkan-ValidationLayers from 8debb3bd2948 to 62eb78a06365 (2 revisions)
2022-11-07 chromium-autoroll Roll SPIRV-Tools from d35a78db57e6 to a5e766b2b47c (1 revision)
2022-11-05 chromium-autoroll Roll Vulkan-ValidationLayers from 226b595aeec0 to 8debb3bd2948 (1 revision)
2022-11-04 chromium-autoroll Roll Vulkan-Loader from 256a5e3b6d6f to 8ff839bda370 (1 revision)
2022-11-04 chromium-autoroll Roll SPIRV-Tools from c8e1588cfa3f to d35a78db57e6 (1 revision)
2022-11-04 chromium-autoroll Roll Vulkan-ValidationLayers from 37e77914ef0d to 226b595aeec0 (7 revisions)
2022-11-04 chromium-autoroll Roll SPIRV-Headers from 747031e10dea to 47f2465ee3e7 (1 revision)
2022-11-04 chromium-autoroll Roll Vulkan-Loader from 1bc3a2fa8ec1 to 256a5e3b6d6f (8 revisions)
2022-11-04 chromium-autoroll Roll Vulkan-ValidationLayers from a566d5b79346 to 37e77914ef0d (2 revisions)
2022-11-04 chromium-autoroll Roll Vulkan-Loader from 374dbe9df7bd to 1bc3a2fa8ec1 (1 revision)
2022-11-04 chromium-autoroll Roll Vulkan-Headers from ff03306bf986 to 52b7c620a540 (1 revision)
2022-11-04 chromium-autoroll Roll Vulkan-ValidationLayers from e108987ee76c to a566d5b79346 (1 revision)
2022-11-04 chromium-autoroll Roll Vulkan-ValidationLayers from 9a31edfa80d5 to e108987ee76c (7 revisions)
2022-11-04 chromium-autoroll Roll Vulkan-Headers from d4c221772cb2 to ff03306bf986 (1 revision)
2022-11-04 chromium-autoroll Roll Vulkan-ValidationLayers from a38db2b8b172 to 9a31edfa80d5 (1 revision)
2022-11-04 chromium-autoroll Roll Vulkan-ValidationLayers from d5bc5ca269e5 to a38db2b8b172 (1 revision)
2022-11-03 chromium-autoroll Roll glslang from 8da649505887 to 5e08deae050c (1 revision)
2022-11-03 chromium-autoroll Roll Vulkan-Tools from 0bb32875d2e6 to 6e5bd86b76c0 (1 revision)
2022-11-03 chromium-autoroll Roll Vulkan-Loader from da810336e761 to 374dbe9df7bd (1 revision)
2022-11-03 chromium-autoroll Roll SPIRV-Headers from 85a1ed200d50 to 747031e10dea (1 revision)
2022-11-03 chromium-autoroll Roll Vulkan-ValidationLayers from 823f8beb4f70 to d5bc5ca269e5 (2 revisions)
2022-11-03 chromium-autoroll Roll Vulkan-Headers from e12a8f8cde40 to d4c221772cb2 (1 revision)
2022-11-03 chromium-autoroll Roll Vulkan-ValidationLayers from 6d377701f393 to 823f8beb4f70 (1 revision)
2022-11-03 chromium-autoroll Roll Vulkan-Loader from 4f4b32cf7545 to da810336e761 (1 revision)
2022-11-02 chromium-autoroll Roll Vulkan-ValidationLayers from 18a0e59294d1 to 6d377701f393 (2 revisions)
2022-11-02 chromium-autoroll Roll Vulkan-Tools from 292e6ed02141 to 0bb32875d2e6 (1 revision)
2022-11-02 chromium-autoroll Roll Vulkan-Loader from 3f29209dd65d to 4f4b32cf7545 (1 revision)
2022-11-02 chromium-autoroll Roll SPIRV-Tools from a52de681dd17 to c8e1588cfa3f (1 revision)
2022-11-02 chromium-autoroll Roll glslang from 1a8869e4d1be to 8da649505887 (1 revision)
2022-11-02 chromium-autoroll Roll SPIRV-Cross from 744279ec78ff to abc31207bffb (1 revision)

Created with:
  roll-dep third_party/vulkan-deps

Change-Id: I24e8219f2226c6ee76a44bc00bb17b30b7a50d32
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109740
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-11-10 22:21:16 +00:00
dan sinclair 9261261da8 [IR] Add ability to dump IR graph to dot
This CL adds the ability to dump an IR graph to a dot file. The
`--dump-ir-graph` option is added to the main tint command. The IR code
is moved behind a TINT_BUILD_IR flag in order to allow the GN build to
continue to build the tint program.

Bug: tint:1718
Change-Id: I0953fe2a59a34c21bb6cd288cb90e9d0298af793
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107860
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-01 18:15:50 +00:00
Ben Clayton c02feff258 tint/cmd: Add `--rename-all` flag
Renames all symbols

Add a test for tint:1725

Bug: tint:1725
Change-Id: Idac45c677d15361d76510068ad756e2f9bffacb0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106880
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-11-01 16:12:23 +00:00
dan sinclair 5c5f47afbf Fixup shadow variable.
This CL fixes up a shadow variable which causes compilation issues
on OSX.

Change-Id: I750423630cc2882d176c5ef304e1e0b4bef133a6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108040
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Ben Clayton <bclayton@chromium.org>
2022-11-01 11:40:08 +00:00
Ben Clayton 8e8e38d129 tint/cmd: Expose multiplaner_external_texture transform
As a command line flag, enabling end-to-end testing of this transform.

This currently generates the binding points for the plane textures and parameters by looking for free binding points.

Bug: tint:1739
Change-Id: Id2b36a075b4fd2f7c71435b15f3edc3ba68f0339
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107682
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-10-31 15:00:45 +00:00
Antonio Maiorano e14a27bc7f tint: remove LoopToForLoop and FoldTrivialSingleUseLets transforms for HLSL and GLSL
Change-Id: I18c807b2449dc2842cb9dbfaeba98dae640d2355
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102621
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-09-19 14:05:21 +00:00
Zhaoming Jiang 7d7976d590 tint: Add end-to-end tests for expressions using f16 types
This patch add DXC compile flag "-enable-16bit-types" and change profile
to SM6.2 when validating generated HLSL using DXC if f16 extension is
enabled in the WGSL program.
The patch add Tint end-to-end test cases for expressions using f16 type,
including constructor, binary operator, splat, zero-init, and others.
Testcases that use f16 types in uniform or storage buffer are SKIPped,
because such usage is not implemented yet.

Bug: tint:1473, tint:1502
Change-Id: I481ab3d12cbb822f11ef85ba807bca3f9770089b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96252
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
2022-08-03 08:45:25 +00:00
Ben Clayton 86329e286b tint/cmd: Dump disassembly with --verbose
Change-Id: I2701117b6c253b632091a59fc1a63d97526d5ce2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97500
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-08-01 19:56:24 +00:00
Ben Clayton 634a2430d8 tint: Use OverrideId for SubstituteOverride transform
Makes the tint public API use the same standardized way to identify overrides.

Bug: tint:1155
Bug: tint:1582
Change-Id: Ib25d9ed5d41844486581e088add24b9131f5f4bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97007
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-07-28 10:22:17 +00:00
Ben Clayton 7d34de88f1 tint/test-runner: Split expectations for FXC and DXC
Change tint's `--fxc` flag to take the path of the FXC compiler DLL.
Have tint attempt to validate with both FXC and DXC if `--validate` is
passed.

Fix the 'dirsWithNoPassExpectations' logic which looks like it got
broken with the tint -> dawn merge. It also incorrectly applied
filepath.FromSlash() on windows.

Change-Id: I0f46aa5c21bc48a2abc48402c41f846aff4a8633
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96800
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-07-22 17:43:27 +00:00