This CL refactor the logic adapter creating device toggles set when
creating device and the way device holding its toggles. This CL also
introduce the concept "toggle stage", currently "device stage" only but
in future will add "instance stage" and "adapter stage" for instance and
adapter toggles. No changes on Dawn API.
More details:
1. Introduce `TogglesState` objects that represent the complete toggles
state of a device (and will used for instance and adapter in future).
2. When creating a device, adapter set up a TogglesState object for it
in `AdapterBase::CreateDeviceInternal` and
`Adapter::SetupBackendDeviceToggles`, no other place would change
the device's toggles state. This change simplify the logic.
3. Introduce the `ToggleStage` enum for every toggle and `TogglesState`
object. Currently we only have `Device` toggle stage, but in future
will have `Instance` and `Adapter` for instance and adapter toggles.
Bug: dawn:1495
Change-Id: Ifafac6a6a075b5b9a733159574ae5b6d4f3ebde9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118030
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Add scaffolding for structured Dawn wire fuzzer.
This CL contains a basic fuzzer for Dawn wire server
that shows some simple design ideas:
1) A basic protobuf spec that is generated using dawn.json
2) conversion from protobuf message to a dawn wire server
command.
This is not the complete implementation and serves as a
foundation for the fuzzer so that subsequent CLs will be
easier to review.
Bug: chromium:1374747
Change-Id: Ife1642dda13d01d3308bdd5fe56cf85978399fd3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109406
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brendon Tiszka <tiszka@chromium.org>
This CL removes support for the `sig` member in `frexp`. It is now an
error if `sig` is used, the deprecation is removed.
`fract` should be used instead.
Bug: tint:1766
Change-Id: I991544b675caf31f22c8c9472a60c77811ff4efd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117920
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Track reads and writes to pointer parameters for each function in the
Resolver, as well as accesses to module-scope variables. At function
call sites, check the root identifiers of each pointer argument to
determine if problematic aliasing occurs.
The MSL backend passes pointers to sub-objects to functions when
handling workgroup storage variables, which triggers the alias
analysis. Add a validation override for this scenario.
Bug: tint:1675
Change-Id: I81a40d1309df65521cc5ad39764d6a09a260f51e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110167
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
This CL moves reserved words from a deprecation to an error.
Bug: tint:1463
Change-Id: I5c66baa15dc748215877c8152171c690495bc0c2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108861
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL moves module-scope let from a deprecation to an error.
Change-Id: Iffecbb667cf79515234b6510ce7c5bbbb6e673bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108862
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Describe the peculiare mismatches between Vulkan-flavoured
SPIR-V and WGSL that the SPIR-V Reader has to contend with.
Describe the solution in broad terms.
This is likely incomplete, but a good start.
Change-Id: I76992e9b830169d81cb55c46e849d9ad2f55c6c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105600
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
This CL starts adding the basics for an IR for Tint. The IR is
a lower level representation then the AST with several of the
restrictions removed. For example, the IR is mutable, is a DAG
instead of a tree, and removes a number of WGSL constructs to
simplify transforms.
Bug: tint:1718
Change-Id: I6a16ac3116cee31410896c3a0424af7b41f958c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105800
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
To match the spec.
Also add a bunch of missing texture test cases to
src/tint/ast/builtin_texture_helper_test.cc. Fix all the tests that were
broken because these were not being exercised.
Fixed: tint:1526
Change-Id: I207b51d307bbdc054b595e0e0e0fd3330607e171
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106681
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
These were quite spectacularly broken.
Also:
* Fix the definition of 'scalar' in `intrinsics.def`. This was in part why conversions were broken, as abstracts were materialized before reaching the converter builtin when they shouldn't have been.
* Implement `ScalarArgsFrom()` helper in `const_eval_test.cc`. This is used by the new conversion tests, and also implements part of the suggestion to improve tint:1709.
Fixed: tint:1707
Bug: tint:1709
Change-Id: Iab962b671305e868f92710912d2ed07e3338c680
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105261
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This CL updates the internals to use AddressSpace instead of the old
StorageClass name.
Bug: tint:1404
Change-Id: Iecc208e839453437f4d630f65e0152206a52db7e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104420
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
These have been warnings for multiple months.
Time to properly turn this on.
Bug: tint:880
Change-Id: I3b38f672309b5acd48c12a38dc5a1675f3c62470
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103480
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Move notes in M106 which should have been in a new M107 section.
Change-Id: Id3cbe39b4889054d3b23202fb0da1d85afbab48b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103200
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@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>
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>
These were not marked as optional previously because it would mean that
C++ methods would look like void F(a = null, b, c) which is invalid in C++
because default arguments must be contiguous and at the end of the
signature.
This commit adds a special case when optional=true where no_default=true
still marks the argument as optional, but doesn't produce a C++ default
argument.
Fixed: dawn:1502
Change-Id: I1b648d37edb94b8412109fc0a06a91bbbd31b8c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97002
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Fix TODOs dating back to when types were an AST / SEM hybrid concept.
Bring the `arch.md` to reflect how things work today.
Bug: tint:724
Change-Id: I6bf4174158cf490f2839aeed78164b66e3410f27
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96141
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
These were never part of the spec, and they were not correctly
implemented for all backends.
Fixed: tint:1597
Change-Id: If1a23f1619c61c53baae277f1cf37aee4460ab7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95952
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This helps output in the headers information about which structure can
be used to extend which. In the future it could also be used to generate
helpers that validate that the chain for a root structure contains only
allowed extension structs.
Fixed: dawn:1486
Change-Id: I6134332d477503e242b3bec9f8e9bedeeb352351
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96000
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Fixup a couple of internal Dawn shaders that used this syntax.
Fixed: tint:1475
Change-Id: Ibd6b3309944bfd955e724fef5d71d1297a84ef5f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93361
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Enable the parsing of 'const'.
Warn on use of module-scope 'let', and automatically replace with 'const'.
Fixed: tint:1580
Change-Id: I214aabca80686dc6b60ae21a7a57fbfb4898ea83
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93786
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Polyfill them completely for HLSL.
For the other backends, just add range checks for acosh and atanh.
Fixed: tint:1465
Change-Id: I3abda99b474d9f5ba09abf400381467dc28ea0bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94380
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
The new spelling `smoothstep` was introduced in M102.
Fixed: tint:1483
Change-Id: Ia5e1401f8f09450a3a767b0bb975216bd85be8db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93360
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This PR enables the deprecation warnings for the @stage builtin.
Bug: tint:1503
Change-Id: I4a560f451a9ad56bc712f6a04c18eba6ae67ab64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93121
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL converts remaining @stage instances in the dawn tree to use
the equivalent shorter variant.
Bug: tint:1503
Change-Id: I74594cd68544fbd692f77d4646991d9c27e218f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92484
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>