Commit Graph

1235 Commits

Author SHA1 Message Date
Ryan Harrison a28d19b18d Add tests for MinBufferBindingSize
BUG=tint:283

Change-Id: Id198175d232680ca89e04561b8b7510f41d982f7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31106
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-03 16:53:59 +00:00
dan sinclair d5fd7e02ba Fixup lint errors.
This CL fixes up the various lint errors.

Change-Id: If4d3077b55aadec33980452c43917194d803fac6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31680
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-11-03 16:26:09 +00:00
Ben Clayton de6938789c Add test for bad function attribute
This test reproduces the unhelpful error message described in tint:291.

Bug: tint:291
Change-Id: Ie93cc59d981691981ba978b690d11c93dfe46ae0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31571
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-03 15:33:19 +00:00
Ben Clayton d59a5da9e5 Have tint executable use the diagnostic printer
Will now print with better formatting and colors on terminals that support it.

Bug: tint:282
Change-Id: Ibff341cb1dc2dcbda6fa0d72e24fdcb172990138
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31570
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-03 13:15:19 +00:00
Ben Clayton ecea5c8aec Make Formatter a non-interface
I had originally created `Formatter` as an interface as I was intending to implement this differently for linux and windows (for terminal coloring).

Color printing is instead implemented by the `Printer` interface / PIMPL classes.

Replace the multi-boolean constructor with a `Style` struct, as this will make life easier when we want to add / remove flags.

Bug: tint:282
Change-Id: I630073ed7a76c023348b66e8a8517b00b2b6a0d2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31569
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-02 21:16:38 +00:00
dan sinclair 28f7764704 [spirv-writer] Generate load in Unary Op generation.
When generating a unary operation we need to make sure we correctly
generate the load otherwise the resulting SPIR-V will be invalid. This
CL adds the required GenerateLoadIfNeeded call into the unary
generation.

Bug: tint292
Change-Id: Ia04314726afdda8f63a78e8e52f996681373db6e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31620
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-11-02 19:43:08 +00:00
Ben Clayton 2e6cc992c8 Implement diagnostic color printing
For linux and windows consoles.

Still needs hooking up to `samples/main.cc`

Bug: tint:282
Change-Id: If8430572708ea7d8788ef05d5379886be89fcb17
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31564
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-11-02 19:26:28 +00:00
Ben Clayton 2d89d98fe1 Fix all doxygen warnings
Bug: tint:282
Change-Id: I6c243c30f4477bb972dc737c8b3ff9cc2e0a91f2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31568
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-11-02 18:02:18 +00:00
Ben Clayton cd5e4a8083 Remove Parser constructors that take a string
... for the content. Everything should be using a `Source::File*` now.

Bug: tint:282
Change-Id: I9bebb94995a946a5919ba6503f2b0ee2058f0fb1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31482
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-11-02 17:55:18 +00:00
dan sinclair 3d0e273ec3 Make doxygen happy.
This CL adds some code comments to fixup doxygen warnings.

Change-Id: I0d0f4b20a1023691141b2f49f82f4538ffe18614
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31600
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-11-02 16:03:38 +00:00
Ben Clayton 3d54f13613 Use the new diagnostics for wgsl the parser
Keep the `ParserImpl::error()` format identical to the old error style for now.
Use the explicit `ParserImpl::diagnostics()` method for the error message tests, updating the tests to match the new, improved output.

Bug: tint:282
Change-Id: Ia7e1237170f0f5203a8cfa256322df29e90e2791
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31481
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-02 15:56:28 +00:00
David Neto 0a06243a70 spirv-reader: support scalar spec constants
Translate OpSpecConstantTrue, OpSpecConstantFalse, and OpSpecConstant.
The latter only can be used with integer or float scalars.

If the constant has a SpecId decoration, then generate a module-scope
decorated constant.  Otherwise generate a module-scope constant without
decorations.

Register the ID so we know to use the declared const identifier in
expressions later in the module.

Bug: tint:156
Change-Id: Icd6e9b60225ced7ee99963c4f85cec1eb0e3ae6b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31541
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-02 15:44:27 +00:00
Ben Clayton f0740ae0f2 Add tint::diag namespace for diagnostics
Diagnostics will be used for printing parser / validator error mesasges.
Diagnostics are collected into a `diag::List`, and can then be formatted into a human readable message with `diag::Formatter`.

Bug: tint:282
Change-Id: I8bbef3db22b72d62cb9467c878d9a346890589ad
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31480
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-02 15:41:08 +00:00
Ben Clayton 580d6c7f3e Produce end ranges for tokens and AST nodes
This includes a couple of position fixes in `lexer.cc`.

The source for identifiers (vars, params, etc) now refer to the identifier, not the first token of the construct.

Bug: tint:282
Change-Id: I58cb8422a4af1c7dc5f84431fd7f06b823b514c5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31444
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-02 15:25:18 +00:00
Ben Clayton a3bcde2c10 Rm line() & column() from wsgl::Token & ast::Node
Use `source().range.begin.line` and `source().range.begin.column` instead.

Bug: tint:282
Change-Id: I6c9bf8766d6db2c9d8e7e1b8bafb2eea93e065d8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31441
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-02 15:17:50 +00:00
Ben Clayton fc5a9cfaf7 Remove tint::Source(size_t, size_t) constructor
This was a temporary overload to break up the changes into smaller chunks.
Change all call sites to use one of the other constructors.

Bug: tint:282
Change-Id: I500fe9700d22f72312827808caa22f7feef7b294
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31440
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-11-02 15:07:47 +00:00
David Neto 74023424da Remove stale TODO
Change-Id: I1b7dbbc0290c48309c9cbf00a432e3beccd27bcf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31540
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-11-02 14:56:47 +00:00
Ben Clayton 5bee67fced Add File & Range information to tint::Source
This is the first step in improving the error messages produced while parsing.

The `line` and `column` information of `Source` has been moved to `Source::Location`.

`Source::Range` has been added that contains a `Location` interval - allowing error messages to highlight the full region of the error.

The `File` information provides an optional file path, and pre-splits the content into lines. These lines can be used to print the full line containing an error.

This CL contains a few temporary changes that help split up this work, and to ease integration with Tint.

Bug: tint:282
Change-Id: I7aa501b0a9631f286e8e93fd7396bdbe38175727
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31420
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: David Neto <dneto@google.com>
2020-10-30 20:44:53 +00:00
dan sinclair 17e0deaeba One command per line
Change-Id: I35253ef04c307af85e07f0c4f9691ab0dcacc6fe
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31384
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-10-30 15:03:21 +00:00
Ben Clayton 5d40a5621b Add ParserImplTestWithParam to reduce boilerplate
There were a number of places where we were declaring classes derived from `testing::TestWithParam<T>` and then adding the same `parser()` helper logic.

Move this common logic down to a new `ParserImplTestWithParam<T>` class, and derive from that instead.

Removes a whole bunch of copy-pasta.

Change-Id: I8f308b77817fd6327c045d2fdee4462b7f32897a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31401
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-29 19:19:34 +00:00
dan sinclair bfc2fceb84 Use min for bounded array accessing.
This CL updates the BoundArrayAccess transform to use `min(u32(val),
size)` instead of `clamp(val, 0, size)` so as to reduce the number of
instructions needed to clamp within range.

Bug: tint:285
Change-Id: Ic12bd67f3d755c8e52590f0585bac114ba9eaa94
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31360
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-10-29 17:56:06 +00:00
dan sinclair c8b2d23e9d [spirv-writer] Emit access control information.
This CL adds emission of the decorations for the access control flags.

Bug: tint:208 tint:108
Change-Id: I3286132dad8edd2586228dc6e87749ad49451739
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31082
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-10-29 14:45:02 +00:00
David Neto 6857ed0b0b spirv-reader: apply access control to storage buffers
- Apply the AccessControlType wrappar around the struct type for any
  variable in the StorageBuffer storage class.
- Drop the NonWritable member decorations for the struct type.

Bug: tint:108
Change-Id: I6496c8c3e8b5d92b2ed0071385915d2b8065a80d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31020
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-29 14:36:22 +00:00
dan sinclair c55fc39acb [ast] Unify the access control types.
This CL merges the StorageAccess enum with the AccessControl enum. The
enum is moved up to src/ast and placed in its own file for clarity.

Change-Id: I95a905a399b5d2e046ea1ea429b35f2064510c2d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31242
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-10-29 13:36:32 +00:00
Ben Clayton 4dd5665502 Add tests for all reachable parser errors
These are _mostly_ covered in the over various test files, but unlike those, these new tests always parse from the root translation unit.

These new tests also use a new testing class which may be extended to verify error output for different error styles (verbosity, colors, etc).

Change-Id: I105488f9b16d90279af4cc418a1c845b6e239e9e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31263
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-29 13:05:52 +00:00
dan sinclair 62bbc6f6c0 Fix doc tables
Change-Id: I9b82269c0dd77e3dc368c6f74cd02948e95f3b44
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31340
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-29 12:44:32 +00:00
dan sinclair d2fa57d26d [doc] Add some documentation around translations.
This CL adds the start of a document listing how things translate into
various backends.

Change-Id: Iebeb4488450b4f299e83d0de7ee124b441795e98
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31240
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-29 03:39:34 +00:00
dan sinclair 5ede1190cf [hlsl-writer] Add read-only storage buffers.
This CL updates the HLSL backend to emit based on the AccessControlType.

Bug: tint:208 tint:108
Change-Id: I25baccaaa9af99a214467fe67d55a2f4256dab8c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31105
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-10-28 21:08:12 +00:00
dan sinclair e8dc46a8c8 [msl-writer] Add read-only storage buffers.
This CL updates the MSL backend to emit based on the AccessControlType.

Bug: tint:208 tint:108
Change-Id: I02c0afe360c286888580135b496fb78a1e747d3b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31241
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-28 20:45:02 +00:00
dan sinclair 512ecc2762 Rename unwrap helpers.
With the addition of the AccessControlType we want to look through the
access control as well as the aliases as we work through the type tree.
This CL renames UnwrapAliasesIfNeeded to be UnwrapIfNeeded and
UnwrapAliasPtrAlias to UnwrapAll.

Change-Id: I5b027919c3143a89be24c4d87b8106f70358c03b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31104
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-10-28 20:32:22 +00:00
Ben Clayton c23a5652bd Fix a couple of typos found in parser_impl.cc
Change-Id: Ice4047838ad5c5e48803d8a529f3ca24d2ce77c5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31262
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-10-28 20:18:22 +00:00
Ben Clayton adb10d60de Add option and target for generating code cov info
The new `tint-generate-coverage` CMake target can be used with the clang toolchain to generate a `lcov.info` file at the root of the project, along with a `coverage.summary` human readable plain text file.

The `lcov.info` file can then be used by various tools to display code coverage information in your IDE / code editor.

Useful for ensuring decent test coverage.

Change-Id: I3d846f6da3af25d3d600d8e028f27b89e35b545f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31121
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-27 21:04:59 +00:00
dan sinclair bfd81096a5 [ast] Add AccessControlType.
This CL adds the AST for an AccessControlType. This type contains an
access control (ReadOnly, WriteOnly, or ReadWrite) along with another
type pointer.

Bug: tint:208 tint:108
Change-Id: I2eed03f8760239f7e71dc2edd4a19a7c1661746e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31060
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
2020-10-27 18:50:59 +00:00
Ben Clayton ebe97f3ce1 Fix build for tests on gcc-9
```
../src/inspector/inspector_test.cc
[build] ../src/inspector/inspector_test.cc:203:13: error: explicit specialization in non-namespace scope ‘class tint::inspector::{anonymous}::InspectorHelper’
[build]   203 |   template <>
[build]       |             ^
[build] ../src/inspector/inspector_test.cc:205:60: error: template-id ‘MakeLiteral<bool>’ in declaration of primary template
[build]   205 |                                                   bool* val)
```

These `MakeLiteral()` methods can just be standard non-templated overloads - so do that.

Change-Id: I7e0b4ec10636eaf772d1ed4d3e9341c5da4087af
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31120
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-27 18:47:39 +00:00
Ryan Harrison 70a3f152f2 Ran 'git cl format' over repo, found some nits
Change-Id: I5774e4cfc8a570522ac6533d69b5b87f7e5e0b6c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31081
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-27 18:14:29 +00:00
Ryan Harrison fcbc6efa8f [inspector] Extract storage-buffer information
BUG=tint:257

Change-Id: Ib85d76a3b972226b401e57ba2a632d6252e95f8f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31080
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-27 18:03:09 +00:00
Ryan Harrison 57694c8dab Change test terminology to reflect WebGPU spec
The spec explicitly refers to these as uniform buffers, not uniform
buffer objects (UBOs).

Change-Id: Ia825f8ddd64fe9a3c20fb10914c6446346fc0217
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31001
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
2020-10-26 20:11:48 +00:00
David Neto 1bafdc3c45 spirv-writer: Generate load for return value, when needed
spirv-writer: treat function parameter as const

Bug: tint:274
Change-Id: Iba4d90ea10a70ce1f551b7b8da6efcc01fe97412
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30924
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-26 14:27:08 +00:00
David Neto f81c1081ea wgsl-reader: treat function formal params as const
They should only be singly-assigned.

This is required because consts can hold pointers, but
var's cannot.  And we need to support pointer arguments.

Bug: tint:275
Change-Id: I00a58734725bd08d40df71c736854a93c364a33c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30923
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-23 23:39:25 +00:00
David Neto 9ab6e8b9eb spirv-reader: treat function parameters as const declarations
Change-Id: I5e5f35be15737c6dc46bb2e9dc1319f7c403eab8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30921
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
2020-10-23 18:19:10 +00:00
David Neto e6fda61ef0 ast::Variable dumping now indicates is_const
If is_const is true, then dump VariableConst{...

For ast::DecoratedVariable, dump "DecoratedVariableConst{..."
when it's const.

Change-Id: I8383e5bc989e4ee20e3a5812f346d5f9a7990dbb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30920
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-23 17:45:50 +00:00
David Neto 79d271580e Don't leak the array-type memo table.
This also keeps tests isolated from each other.

Change-Id: I56937bb160138d7d82b2cf8f2560ddb5c0647048
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30881
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-23 17:04:40 +00:00
dan sinclair f6fdcb1114 Set target defines PUBLIC.
This CL sets the target defines as PUBLIC so downstream CMakeFiles can
correctly setup the defines when including the tint headers

Change-Id: Idcb38761ed73ecda652945287ff096a11e7b2b01
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30840
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-10-23 17:04:10 +00:00
David Neto 1b1d2a5907 Fix doxygen comment
Change-Id: I7ae8d3eda8d9cbe042dc5d571f4e66a54f6c75da
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30880
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
2020-10-23 16:47:30 +00:00
Ryan Harrison 88d705dc85 [inspector] Extract UBO information
Also includes adding in sizing information for various types.

BUG=tint:257

Change-Id: Iaaa8a7c28851d14790285b5bd14636bf3ae2b9b0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30704
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-10-22 19:31:31 +00:00
Sarah Mashayekhi 8f7c80347d [validation] Improve CTS test wrapper.
Updated to check if failure happened with the intended error code

Change-Id: If8eee7605b8ab1af481fde067dcb0e64e0df6256
Bug:tint:271
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30002
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2020-10-21 19:24:00 +00:00
dan sinclair 0ce0704741 Remove type alias struct variant.
This CL removes the `type IDENT = struct` format in favour of the
`struct IDENT` variant.

Bug: tint:175
Change-Id: I4fde8012fd07f811cd0bd80445198f6bbc92b720
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30661
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-10-21 19:15:20 +00:00
dan sinclair 4f79c84050 [spirv-writer] Deduplicate sampler and comparision_sampler.
Both sampler types generate an `OpTypeSampler` in SPIR-V so we need to
make sure they're considered duplicates in the SPIR-V backend. This CL
registers the generated ID with for both sampler type_names when either
one is emitted.

Bug: tint:272
Change-Id: If459bbb34fe8670a7e29d101686b70bf83b184c2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30662
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
2020-10-20 21:43:29 +00:00
dan sinclair 7156d3e314 [wgsl-reader] Add parsing of named structs.
This CL adds the parsing of structs with names. The parsing of type
aliased structs remains to allow for migration to the new system. The
named struct format is always emitted.

Bug: tint:175
Change-Id: Ic0579dedbd2dd0edc7dfd30bc2ec02972091e718
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30341
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
2020-10-19 15:31:47 +00:00
dan sinclair c9a3e47396 Roll Tint dependencies
Roll third_party/spirv-tools/ 8a0ebd40f..7e1825a59 (96 commits)

8a0ebd40f8..7e1825a596

$ git log 8a0ebd40f..7e1825a59 --date=short --no-merges --format='%ad %ae %s'
2020-10-19 afdx spirv-fuzz: Take care of OpPhi instructions when inlining (#3939)
2020-10-16 afdx spirv-fuzz: Fix to TransformationInlineFunction (#3913)
2020-10-16 afdx spirv-fuzz: Wrap early terminators before merging returns (#3925)
2020-10-16 jaebaek Add DebugValue for function param regardless of scope (#3923)
2020-10-16 afdx Temporary fix to make GoogleTest compile. (#3922)
2020-10-15 afdx spirv-fuzz: Lower probability of adding bit instruction synonyms (#3917)
2020-10-15 afdx spirv-fuzz: Fix handling of OpPhi in FlattenConditionalBranch (#3916)
2020-10-13 afdx spirv-fuzz: Avoid creating blocks without parents (#3908)
2020-10-13 afdx spirv-fuzz: Do not allow creation of constants of block-decorated structs (#3903)
2020-10-13 afdx spirv-fuzz: Fixes related to irrelevant ids (#3901)
2020-10-13 afdx spirv-fuzz: Fix to transformation that adds a synonym via a loop (#3898)
2020-10-13 afdx spirv-fuzz: Fix to duplicate region with selection (#3896)
2020-10-09 afdx spirv-fuzz: Do not expose synonym facts for non-existent ids (#3891)
2020-10-08 afdx spirv-fuzz: Do not add synonyms involving irrelevant ids (#3890)
2020-10-08 afdx spirv-fuzz: Do not replace irrelevant ids that are not in blocks (#3892)
2020-10-08 afdx spirv-fuzz: Wrap OpKill and similar in function calls (#3884)
2020-10-08 dj2 Update val to handle reversed instruction sections. (#3887)
2020-10-06 afdx spirv-fuzz: Replace dead-block terminators with OpKill etc. (#3882)
2020-10-06 vasniktel spirv-fuzz: TransformationPropagateInstructionDown (#3692)
2020-10-06 afdx spirv-fuzz: Transformation to add wrappers for OpKill and similar (#3881)
2020-10-06 afdx spirv-fuzz: Use overflow ids when duplicating regions (#3878)
2020-10-06 vasniktel spirv-fuzz: Fix rvalue references (#3883)
2020-10-02 afdx spirv-fuzz: Avoid using block-decorated structs in transformations (#3877)
2020-10-02 afdx spirv-fuzz: Use overflow ids when inlining functions (#3880)
2020-10-02 jaebaek Debug info preservation in convert-local-access-chains pass (#3835)
2020-10-02 vasniktel spirv-fuzz: Refactor fact manager tests (#3879)
2020-10-02 afdx spirv-fuzz: Integrate spirv-reduce with shrinker (#3849)
2020-10-02 afdx spirv-fuzz: Only recommend passes when a pass had an effect (#3863)
2020-10-02 stefano.milizia00 spirv-fuzz: Merge the return instructions in a function (#3838)
2020-10-01 jaebaek Debug info preservation in redundancy-elimination pass (#3839)
2020-10-01 jaebaek Debug info preservation in if-conversion pass (#3861)
2020-10-01 vasniktel spirv-fuzz: Refactor conditions in the fact manager (#3867)
2020-10-01 vasniktel spirv-fuzz: TransformationWrapRegionInSelection (#3674)
2020-10-01 afdx spirv-fuzz: Enable some passes with high probability (#3860)
2020-10-01 afdx spirv-fuzz: Do not add constants for Block-decorated structs (#3862)
2020-10-01 vasniktel spirv-fuzz: Fix to FuzzerPassFlattenConditionalBranches (#3865)
2020-09-30 vasniktel spirv-fuzz: Fix TransformationRecordSynonymousConstants (#3868)
2020-09-30 afdx spirv-fuzz: Fix flatten conditional branch transformation (#3859)
2020-09-29 afdx spirv-fuzz: Report fresh ids in transformations (#3856)
2020-09-28 dj2 [spirv-dis] Add some context comments to disassembly. (#3847)
2020-09-28 emaxx Fix use-after-move in val/validate.cpp (#3848)
2020-09-26 antonikarp spirv-fuzz: Fix bug in TransformationDuplicateRegionWithSelection (#3819)
2020-09-26 andreperezmaselco.developer spirv-fuzz: Support OpNot bit instruction case (#3841)
2020-09-25 afdx spirv-fuzz: Return IR and transformation context after replay (#3846)
2020-09-24 paulthomson spirv-fuzz: fix test (#3845)
2020-09-24 afdx spirv-fuzz: Use unique_ptr<FactManager> in TransformationContext (#3844)
2020-09-24 ehsannas Start SPIRV-Tools v2020.6
2020-09-24 ehsannas Finalize SPIRV-Tools v2020.5
2020-09-24 ehsannas Update CHANGES
2020-09-24 vasniktel spirv-fuzz: Support dead blocks in TransformationAddSynonym (#3832)
2020-09-24 vasniktel spirv-fuzz: Move IRContext parameter into constructor (#3837)
2020-09-24 Simran-B Add missing backticks around <result-id> (#3840)
2020-09-23 rharrison Validate SPIRV Version number when parsing binary header (#3834)
2020-09-23 stefanomil spirv-fuzz: Create synonym of int constant using a loop (#3790)
2020-09-22 58573781+richard-lunarg Fix compiler error on macOS with XCode12 (#3836)
2020-09-22 vasniktel spirv-fuzz: Handle OpPhis in TransformationInlineFunction (#3833)
2020-09-22 stevenperron Update CHANGES
2020-09-22 afdx spirv-fuzz: Refactor fuzzer, replayer and shrinker (#3818)
2020-09-18 afdx spirv-fuzz: Add pass recommendations (#3757)
2020-09-18 stefanomil spirv-fuzz: Consider all ids from dead blocks irrelevant (#3795)
2020-09-18 afdx Fix header guard macros (#3811)
2020-09-18 antonikarp spirv-fuzz: Fix TransformationDuplicateRegionWithSelection (#3815)
2020-09-17 46493288+sfricke-samsung spirv-val: Add DeviceIndex (#3812)
2020-09-16 rharrison Fix missed modification flagging (#3814)
2020-09-16 andreperezmaselco.developer spirv-fuzz: Use an irrelevant id for the unused components (#3810)
2020-09-16 stefanomil spirv-fuzz: Improvements to random number generation (#3809)
2020-09-16 greg Add buffer oob check to bindless instrumentation (#3800)
2020-09-16 vasniktel spirv-fuzz: Remove CanFindOrCreateZeroConstant (#3807)
2020-09-15 andreperezmaselco.developer spirv-fuzz: Add bit instruction synonym transformation (#3775)
2020-09-16 vasniktel spirv-fuzz: Skip unreachable blocks (#3729)
2020-09-15 afdx Fix build errors (#3804)
2020-09-15 vasniktel spirv-fuzz: Handle invalid ids in fact manager (#3742)
2020-09-15 vasniktel spirv-fuzz: Support memory instructions MoveInstructionDown (#3700)
2020-09-15 stefanomil spirv-fuzz: Pass submanagers to other submanagers when necessary (#3796)
2020-09-15 stefanomil spirv-fuzz: Transformation to flatten conditional branch (#3667)
2020-09-14 46493288+sfricke-samsung spirv-val: Add BaseInstance, BaseVertex, DrawIndex, and ViewIndex (#3782)
2020-09-14 dnovillo Properly mark IR changed if instruction folder creates more than one constant. (#3799)
2020-09-11 afdx Add missing file to BUILD.gn (#3798)
2020-09-11 antonikarp spirv-fuzz: Add TransformationDuplicateRegionWithSelection (#3773)
2020-09-11 afdx spirv-reduce: Support reducing a specific function (#3774)
2020-09-10 afdx spirv-reduce: Refactoring (#3793)
2020-09-10 afdx Favour 'integrity' over 'coherence' as a replacement for 'sanity'. (#3619)
2020-09-10 antonikarp spirv-fuzz: Fix header guards in transformations/fuzzer passes (#3784)
2020-09-10 paulthomson spirv-fuzz: Add SPIRV_FUZZ_PROTOC_COMMAND (#3789)
2020-09-10 paulthomson Add missing include (#3788)
2020-09-09 paulthomson Improve spirv-fuzz CMake code (#3781)
2020-09-08 stevenperron Allow SPV_KHR_8bit_storage extension. (#3780)
2020-09-08 stefanomil spirv-opt: Add function to compute nesting depth of a block (#3771)
2020-09-03 stefanomil spirv-fuzz: Transformation to convert OpSelect to conditional branch (#3681)
2020-09-02 46493288+sfricke-samsung spirv-val: Add Vulkan VUID labels to BuiltIn (#3756)
2020-09-02 vasniktel spirv-fuzz: Add support for BuiltIn decoration (#3736)
2020-09-02 stefanomil spirv-fuzz: Fix GetIdEquivalenceClasses (#3767)
2020-09-02 stefanomil spirv-fuzz: Replace id in OpPhi coming from a dead predecessor (#3744)
2020-09-01 stefanomil spirv-fuzz: Transformation to replace the use of an irrelevant id (#3697)
2020-09-01 vasniktel spirv-fuzz: TransformationMutatePointer (#3737)
2020-09-01 stefanomil spirv-fuzz: Compute interprocedural loop nesting depth of blocks (#3753)

Created with:
  roll-dep third_party/spirv-tools

Roll third_party/gpuweb-cts/ 40e337a38..2a53a9bd3 (61 commits)

40e337a387..2a53a9bd3d

$ git log 40e337a38..2a53a9bd3 --date=short --no-merges --format='%ad %ae %s'
2020-10-13 9856269+sarahM0 Update WGSL tests (#303)
2020-10-01 yunchao.he Fix a bug for texture usage validation in compute (#300)
2020-09-29 kainino Rename asyncReinitDeviceWithDescriptor -> selectDeviceOrSkipTestCase (#298)
2020-09-29 jiawei.shao Add tests about compressed texture formats in CopyT2T validation tests (#296)
2020-09-28 kainino Add cts.code-workspace for project-global settings. (#299)
2020-09-28 yunchao.he Test replaced bindings for texture usage validation in compute (#291)
2020-09-28 jiawei.shao Add .vscode/ to gitignore
2020-09-25 enrico.galli Moving createEncoder to ValidationTest (#293)
2020-09-25 kainino Enable WebGPU tests with descriptors (#294)
2020-09-24 shaobo.yan Validation tests for copyImageBitmapToTexture. (#285)
2020-09-23 jiawei.shao Add validation tests for CopyTextureToTexture - Part II (#287)
2020-09-21 yunchao.he Resource usage validation in compute (#288)
2020-09-18 kainino Allow per-test descriptions (#290)
2020-09-18 kainino Add a very lightweight preprocessor using JS template strings (#280)
2020-09-18 kainino Significantly speed up build by optimizing n^2 code (#289)
2020-09-15 enrico.galli Add debug groups and makers test (#286)
2020-09-12 jiawei.shao Add validation tests of CopyTextureToTexture - Part I (#284)
2020-09-09 yunchao.he Add texture usage validation scope test (#283)
2020-09-10 jiawei.shao Add operation tests of CopyBufferToBuffer (#282)
2020-09-08 yunchao.he Combine Texture subresource shapes/overlap with using bundle or not (#281)
2020-09-02 yunchao.he Add more texture usage validation tests: unused bindings (#274)
2020-08-28 yunchao.he Enhance texture usage validation tests (#273)
2020-08-27 dj2 Fix WGSL test syntax errors. (#277)
2020-08-25 44079328+kunalmohan Fix setScissorRect() validation (#276)
2020-08-20 tommek Copy between linear data and texture operation tests (#269)
2020-08-20 yunchao.he Add more tests for texture resource usage tracking in render (#260)
2020-08-19 fd Add w3c.json file for W3C tracking purpose
2020-08-19 kainino Revise README and include new guidelines for pull requests (#271)
2020-08-18 kainino Support JSON objects in param values (#270)
2020-08-16 kainino empty commit (#268)
2020-08-14 yunchao.he Add test for different read write usages combinations (#253)
2020-08-15 tommek Adding a TODO for copy between linear data and texture tests (#261)
2020-08-14 kainino Split IDL flags tests into one case per member; add QUERY_RESOLVE (#267)
2020-08-14 kainino Update types and split texture tables to accommodate compressed formats (#263)
2020-08-14 kainino Make jsUndefinedMagicValue less magic (#266)
2020-08-12 kainino standalone: use <pre> for descriptions (#259)
2020-08-13 jiawei.shao Add validation tests for CopyBufferToBuffer (#256)
2020-08-11 tommek Copy between linear data and texture validation tests (#255)
2020-08-10 44079328+kunalmohan Use Babel plugin to support Nullish Coalescing operator (#257)
2020-08-04 yunchao.he Add subresource usage validation tests for different shader stages (#254)
2020-07-31 yunchao.he Add texture subresource usage validation tests in render (#252)
2020-07-30 brandon1.jones Implement Render Pass Resolve Validation Tests (#250)
2020-07-27 brandon1.jones Implement RenderPass StoreOp Operation Tests (#243)
2020-07-27 yunchao.he Fixes about hasDynamicOffset and multisampled in BGL (#249)
2020-07-24 kainino Update to use new mapping primitives everywhere (#245)
2020-07-24 yunchao.he Refactor some validation tests in createBindGroupLayout (#244)
2020-07-24 kainino Represent undefined with a magic value in JSON (#247)
2020-07-23 68128706+cerisano Update README.md (#246)
2020-07-17 brandon1.jones RenderPass StoreOp Validation Tests (#241)
2020-07-17 kainino In params().combine() types, flatten unions of interfaces before merging them (#242)
2020-07-15 yunchao.he Add tests for bindGroupLayout's variables (#238)
2020-07-16 shaobo.yan CTS for CopyImageBitmap: test color conversion (#237)
2020-07-13 yunchao.he Add a test for minBufferBindingSize (#233)
2020-07-13 yunchao.he Update node_module/@webgpu/types to 0.0.27 (#235)
2020-07-10 yunchao.he Remove dynamic_set_to_true_is_allowed_only_for_buffers (#231)
2020-07-08 brandon1.jones Add Initial Coverage TODOs for Render Pass StoreOP (#227)
2020-07-07 kainino Update README.md (#229)
2020-07-06 yunchao.he Move visibility_and_dynamic_offset to createBindGroupLayout tests (#224)
2020-07-06 brandon1.jones Minor Improvements To Setup Instructions (#226)
2020-06-29 kainino Travis deploy master->main (#222)
2020-06-23 44079328+kunalmohan Use babel plugin to prevent optional chaining in generated code (#221)

Created with:
  roll-dep third_party/gpuweb-cts

Roll third_party/googletest/ df6b75949..3c95bf552 (35 commits)

df6b75949b..3c95bf5524

$ git log df6b75949..3c95bf552 --date=short --no-merges --format='%ad %ae %s'
2020-10-15 dmauro Googletest export
2020-10-14 absl-team Googletest export
2020-10-14 dmauro Googletest export
2020-10-14 dmauro Googletest export
2020-10-14 absl-team Googletest export
2020-10-14 dmauro Googletest export
2020-10-14 absl-team Googletest export
2020-10-13 dmauro Googletest export
2020-10-13 dmauro Googletest export
2020-10-13 absl-team Googletest export
2020-10-13 absl-team Googletest export
2020-10-09 ofats Googletest export
2020-10-09 absl-team Googletest export
2020-10-08 absl-team Googletest export
2020-10-12 peternewman Fix a typo
2020-10-07 pravin1992 Issue 2135: Change template args in NiceMock, NaggyMock and StrictMock from A1, A2, ... to TArg1, TArg2,... to avoid clash with legacy header files
2020-09-29 absl-team Googletest export
2020-10-01 63450189+ranodeepbanerjee A slight Gramatical change.
2020-09-29 dmauro Googletest export
2020-09-29 absl-team Googletest export
2020-09-25 absl-team Googletest export
2020-09-27 56075233+keshavgbpecdelhi Update cook_book.md
2020-09-23 absl-team Googletest export
2020-09-23 absl-team Googletest export
2020-09-21 absl-team Googletest export
2020-09-24 thomas.barbier Fix warning maybe-uninitialized
2020-09-18 absl-team Googletest export
2020-09-17 absl-team Googletest export
2020-09-18 63900998+JethroSama Update README.md, added missing 'a'
2020-09-08 absl-team Googletest export
2020-09-02 dmauro Googletest export
2020-09-01 absl-team Googletest export
2020-09-01 absl-team Googletest export
2020-08-25 27jf Add timestamp to in old method mock macro guide
2020-05-05 igor.n.nazarenko Detect proto messages based on presense of DebugString.

Created with:
  roll-dep third_party/googletest

Roll third_party/spirv-headers/ 3fdabd0da..c43a43c7c (4 commits)

3fdabd0da2..c43a43c7cc

$ git log 3fdabd0da..c43a43c7c --date=short --no-merges --format='%ad %ae %s'
2020-10-12 hwguy.siplus  Register the Xenia emulator as a generator (#171)
2020-09-27 atyuwen Register the Messiah SPIR-V CodeGen (#169)
2020-09-10 syoussefi Register the ANGLE compiler (#168)
2020-09-08 cepheus Rebuild of latest headers, which slightly moves OpTerminateInvocation

Created with:
  roll-dep third_party/spirv-headers

Change-Id: Id23cf07aedff60a09d068fd145c2dcfc88aea95b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30460
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2020-10-19 15:31:17 +00:00