This CL pulls the interpolation sample and type name parsing out
to methods to closer match the WGSL spec. This will also make it simpler
to convert to using generated parsing for these strings if desired.
Bug: tint:1633
Change-Id: Ib7b663a3eeef7f3ecacae8bf160d41641b5474f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98260
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
The parser skipped over the `expression` node and went straight
to `logical_or_expression`. This CL adds `expression` which just
calls `logical_or_expression`. This will allow moving the rest of the
parser to more closely match the WGSL spec.
Bug: tint:1633
Change-Id: I994a186ea50f3b3196c9ded77d9c478cb08b019b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98220
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This Cl updates the parser implementation of the `global_decl` rule.
The `type_alias` rule is renamed to `type_alias_decl` and the `struct`
parsing is moved out of the synchronization to `;` code as a `struct`
no longer has a trailling `;`.
Bug: tint:1633
Change-Id: I44b25035cbe0ea0963ec73400986205e1623060e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98065
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
They now return a utils::Result so they can add an error to diagnostics
and return Failure. Returning nullptr still means cannot evaluate at
compile time, but not a failure.
Bug: tint:1581
Change-Id: Ic30d782fb9fa725ec2faf89a87f74de6282d0304
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98107
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Fixes "dxc failed : unable to parse shader model.".
On windows the called program is responsible for splitting arguments
from one joined string. Command line arguments on 'nix systems need to
be passed as separate strings. This CL makes it so that we pass in the
arg separately, and support ignoring empty string args to make writing
this code easier.
Change-Id: Ia9618c2a743f8fdb49913572e2bbfc4bd1519d3a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98110
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This patch adds several dawn_end2end_tests as a preparation to support
clearing color attachments with arbitrary 32-bit integer values on
D3D12.
Bug: dawn:537
Test: dawn_end2end_tests
Change-Id: I5e5232d4ebb2ed0e0da007fea101ed13f972ce9e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98103
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This CL updates the origin trial changes list to include the
deprecation of reserved words.
Bug: tint: 1463
Change-Id: I70aef6cdd68573413878d595928a7d92b40a275c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98064
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
`./test/tint/test-all.sh ./out/active/tint --generate-skip`
A bunch of these got missed by https://dawn-review.googlesource.com/c/dawn/+/98020, as I assumed only `glsl` and `spvasm` backends would be affected.
Some are just refreshes of existing skips
Bug: tint:1632
Change-Id: I1b003a56143b52e8e47bef8a10fec2878a48be06
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98120
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
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>
The vector sizes for expression traversal were excessive.
Reduce.
Change-Id: I3a2b7e7ba4cd82310565b883f85322834275ea8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98082
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
These (with exception to the WGSL writer) are not emitted.
Bug: tint:1625
Change-Id: Id8b36b5c83a6fe2dab042cf46b0c3dbca75e0926
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97962
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Replace use of std::unordered_map with a utils::Vector.
Significantly reduces heap allocations.
Change-Id: I501bfffb7620df9b4e09cd8569c39e418b25e32a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98080
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This CL updates the list of reserved words to match the WGSL spec. The
use of a reserved word is changed from an error to a deprecation at the
moment be cause the majority of the list would be new errors.
Bug: tint:1633 tint:1624
Change-Id: I498db41689cdd666dfb291b1a6761a1182c87ec8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98042
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Previously all of the device IDs I was aware of for a given vendor could
be comfortably filtered with a single mask, but there's at least one
exception that has come up since that indicates that support for
multiple different masks per vendor is necessary.
This change allows devices to be identified in groups, with each group
being given a different mask or no mask at all. Architectures may be
shared between groups.
Also added the ability to mark a device group as internal, which will
generate the helper functions (like `IsVendorArchitecture()`) for the
internal architectures but not allow them to be exposed in
GPUAdapterInfo. Internal device IDs may overlap with non-internal ones.
Finally, added some validation logic to prevent duplicate deviceIds or
conflicts between device sets/architectures. This was actually supposed
to be in an earlier CL but somehow got omitted from the version that
eventually landed.
Bug: dawn:1498
Change-Id: Icb8bfbee47324cbd9791f63089877ace86c763db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96900
Reviewed-by: Yunchao He <yunchao.he@intel.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This CL adds the `global_directive` rule into the WGSL parser and
moves `enable_directive` under that rule. This matches the WGSL
specification.
Bug: tint:1633
Change-Id: I48b809cd1d2f2ffa6ec0d83474c716d4015e1dea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98041
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL fixes various util::Vector calls that were needed after
the push constant CL landed.
Change-Id: I0a21ad61ece6327b8789c5c083f4d1fcfd6339b1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98040
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This CL adds `<<=` and `>>=` to the supported operators in WGSL. The
ExpandCompoundAssignment transform is used to convert to the expanded form.
Bug: tint:1594
Change-Id: I20519052c52d4b69bc90def1acc5c0a30c36fd8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97980
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Intel Xe is also called Intel Gen 12. Quite a few Intel architectures
are classified into Gen 12. Some of these architectures are Gen 12
LP (low power), while the others are Gen 12 HP (high performance,
for example, some Intel discrete GPUs). For more details, see
https://en.wikipedia.org/wiki/Intel_Xe. We need to separate Intel Gen
12 LP from Intel Gen 12 HP for some toggles on D3D12 backend.
Bug: dawn:949
Change-Id: Id5d10c0ecb31ca9e323ede65c3d55e6d4954370e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97901
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: yang gu <yang.gu@intel.com>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
There are many devices in Intel HD630 family, we cannot enumerate all
their device ids in the tag. We want cts to run as expected on other
Intel devices of the same architecture, add generation-based tag
intel-gen-9 to include a broad range of devices in the expectations.
Bug: dawn:1444
Change-Id: I80b6ae64ea2efc41bcc68e1c917919a86ec87f44
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97760
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Brian Sheedy <bsheedy@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
The elements of the VectorRef is now immutable, but can be
moved, if the caller relinquishes ownership by explicitly using
std::move() at the callsite.
Also add utils::Empty as a way of signalling that a vector should be
constructed with no elements. This is helpful in templated code where
{} cannot be used due to overload ambiguity.
Change-Id: I24a50a13956b0692771a8bc9046336ad46261562
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97842
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This extension adds support for the push_constant storage class such
that it can be tested with WGSL test files. The real goal is to allow
future transforms that will add push constants that the SPIRV writer
will output.
The extension:
- Adds the `chromium_experimental_push_constant` enable.
- Allows the push_constant storage class for global variables.
- Adds validation that the types are host-shareable for push_constant
variables, and that they don't contain f16 (must be 32bit types
only).
- Validates that at most one push_constant variable is statically used
per entry-point.
- Skips validation that the extension has been enabled if
kIgnoreStorageClass is used.
Tests are added:
- For parsing of var<push_constant>
- Caught a missing conversion.
- For each of the validation rules.
- For the wrapping of push constants in structs if needed by
AddSpirvBlockAttribute.
- For the layout and type rules of the storage class.
- For a shader with multiple entry-points using various push constants.
- Caught a missing reset of the previous push constant variable in
the validation check that at most one is used.
- Caught the missing wrapping in structs that had to be added to
AddSpirvBlockAttribute.
- Caught incorrect logic when adding diagnostics about the call
graph leading to the reference to push constants.
Bug: tint:1620
Change-Id: I04a5d8e5188c0dcef077f2233ba1359d1575bf51
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96682
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>