Enfore that the Expr(bool) overloads are only used if the argument type
is explicitly a bool.
Fix a test bug where this was happening.
Change-Id: I5d7520be4859a700265d62b322416a90f278b2d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89400
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Generate different tokens for:
• 'f' suffixed float literals
• unsuffixed integer literals
'f' and unsuffixed are currently both treated as f32 by the resolver,
but this is the first step to supporting abstract floats.
Bug: tint:1504
Change-Id: Id3b1fe420b6eb8901f88d6a5de06ef4f54aa3edf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89031
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This patch adds the support of dot4I8Packed and dot4U8Packed in
semantics under the extension "chromium_experimental_dp4a".
Bug: tint:1497
Test: tint_unittests
Change-Id: I659172fcb8953ba13b49664c6c9ad75724ff5957
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88962
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This avoids Tint validation errors between transforms caused by unused
entry-points having conflict with the remapped bindings.
Fixed: dawn:1363
Change-Id: If7d22d09905816bfe777ab22211af21513f98698
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89441
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
- Unexpected device lost should result in an error.
Fixes: dawn:1412
Change-Id: I6fe0b1ccc3e4b51cc85b9a058f8eac65c7622d89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89500
Auto-Submit: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This CL adds missing constructors and destructors. Others are moved
from the header file to implementation files.
Bug: dawn:1405
Change-Id: I06657d4a4faa437ca5a95a0067a8f9f9bbc89d12
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89181
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
• Declare all the unary ops in the intrinsics.def file.
• Reimplement the bulk of Resolver::UnaryOp() with the IntrinsicTable.
This will simplify maintenance of the operators, and will greatly
simplify the [AbstractInt -> i32|u32] [AbstractFloat -> f32|f16] logic.
Bug: tint:1504
Change-Id: Ifc646d086fc93cfbe3f3f861b8c447178664c1f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89028
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Removes check for Unsafe API toggle for multiplane external textures.
This is no longer needed now that the the implementation is functional.
Bug: dawn:1409
Bug: chromium:1323647
Change-Id: Iaf1c1b6bd053b68e306df61759ee9d81777f9b87
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89460
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
This CL adds some missing constructors and destructors. Others are moved
from the header file to implementation files.
Bug: dawn:1405
Change-Id: I17e98f6da48518112bafb0876679cc3989ba2548
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89160
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
• Declare all the binary ops in the intrinsics.def file.
• Reimplement Resolver::BinaryOpType() with the IntrinsicTable.
This will simplify maintenance of the operators, and will greatly
simplify the [AbstractInt -> i32|u32] [AbstractFloat -> f32|f16] logic.
Bug: tint:1504
Change-Id: Ie028602e05b59916c3f2168c92f200f10e402b96
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89027
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL moves the constructors and desctructors for the native
unittest mocks into separate cpp files.
Bug: dawn:1405
Change-Id: I20dccaa8114f3d7f8b61da1c1495648cb7328148
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89121
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Adapt the builtin parsing and resolving to also support operators.
Will be used to generate intrinsic table entries for operators.
This will simplify maintenance of the operators, and will greatly
simplify the [AbstractInt -> i32|u32] [AbstractFloat -> f32|f16] logic.
Bug: tint:1504
Change-Id: Id75735ea24e501877418812185796f3fba88a521
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89026
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This CL fixes a few missing overrides and updates some `auto`'s to
have a `*` on them.
Bug: dawn:1405
Change-Id: I621cd35fb10d8308a5831db11c22a3595e52e295
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89120
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
• Rename 'builtin-gen' back to 'intrinsic-gen', as 'intrinsics' now
include both builtins and operators.
• Move the intrinsic definitions, and IntrinsicTable to the resolver
package, where it belongs.
Bug: tint:1504
Change-Id: I5ad5c285c1e360a224ee1235c293ccd55eb2693d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89025
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Tint has already implemented the enable directive for using WGSL
extension in the future, and using a WGSL extension that is not allowed
for the device should result in a shader creation error.
In this patch a WGSL extension allow list is added in DeviceBase, and
a validation is added in shader module base initialization to make sure
all extensions used in the WGSL program are in the allow list. This
patch also rename the `ValidateShaderModuleDescriptor` to
`ValidateAndParseShaderModule`, which is more descriptive for what it
actually does.
Bug: tint:1472
Change-Id: I4b039a3e37c25159b4fc6cfa37488aa817004ab2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88241
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This change ensures that when errors are raised from WebGPU, including
lost context errors, they can include any associated Vulkan validation
layer messages in the message text if backend validation is enabled.
This will allow these messages to be surfaced in places like when
running CTS tests on browser build infrastructure.
Because of how Vulkan messages are raised at the instance level, some
routing of the messages to the appropriate device needed to be added.
This is based on appending message IDs to object labels and then parsing
them out of the message when it comes in.
This change also makes Vulkan validation messages cause a device loss,
which is inline with the behavior of the D3D12 backend.
Bug: dawn:1396
Change-Id: I2b309ba5475a338e7e99d4b4daaa7c3d5de61011
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88460
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Unsuffixed integer literals are currently treated as i32,
but will shortly become AbstractInteger. To keep tests behaving
identically to how they are currently, change all test literals
to using either 'i' or 'u' suffixes.
Bug: tint:1504
Change-Id: Ic373d18ce1c718a16b6905568aec89da3641d36b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88845
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
If the Switch() has a default case, then allow support for return types that do not have a default constructor.
Bug: tint:1504
Change-Id: I671ea78fe976138a786e2e0472e1e5f99afa0c5d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89022
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
And use this to define constants for override vars in unit tests that
would fail for HLSL.
Bug: tint:1519
Change-Id: I4fd15c517868694d2bcd81d563399f817ed74ae6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88882
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Various things are deprecated or removed in C++20, including
* Various allocator member types
* std::iterator
* std::result_of
Replace these with supported versions.
Bug: chromium:1284275
Change-Id: I11a2909e3a269cdb98ada2bd6621086409878242
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89040
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Peter Kasting <pkasting@google.com>
Commit-Queue: Peter Kasting <pkasting@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Use this for the BlockAllocator cast.
Bug: dawn:1406
Change-Id: Ic5d1acf7f8e74037fb51fc9d5d3b5141a15bd962
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89021
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Use a memcpy to avoid a bad-cast seat belt which is firing in ChomeOS.
Bug: dawn:1406
Change-Id: I3acf0e2552ef8c5267e8c5701cc2f95f6e283c7a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89020
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Bug: dawn:667
Change-Id: I6a78c7f6f9a850ef9ba30d3bafde9b198bab2edc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88940
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
For all i32 literal values.
Reduces risk of the SPIR-V reader producing WGSL that behaves
differently, when abstract-integers are fully implemented.
Bug: tint:1504
Change-Id: Ieaf8afec5b09c7978c75a38c6ed144633ddc017e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88843
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Merge SintLiteralExpression and UintLiteralExpression with
IntLiteralExpression. IntLiteralExpression has a new Suffix field which
indicates whether the literal is either a:
• 'i' suffixed integer literal
• 'u' suffixed integer literal
• no-suffix integer literal
Have the SPIR-V reader produce no-suffixed literals for i32 types, to
keep this change small. In future changes the SPIR-V reader will
produce 'i' suffixed types for these.
Have all consumers of IntLiteralExpression treat unsuffixed integers the
same as 'i'-suffixed literals. Unsuffixed will be treated as abstract in
future changes.
Removed SemHelper::TypeOf(const ast::LiteralExpression* lit).
Fixed: tint:1510
Bug: tint:1504
Change-Id: I443f41984e637ddd948182ee756af1010c5f8226
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88842
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>