This patch fix the issue that HLSL generator emit wrong constant
element index for vectors with all elements being the same, which may
cause error when emitting a matrix constant with sub columns having
identical elements.
Corresponding unit test is implemented.
Bug: tint:1588
Change-Id: Ia40b3f1a676d84aadaa5ce900677547fb15abe7f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94041
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
The generators were not setting `emit_continuing_` when emitting while
loops. This caused a crash when a `continue` was encountered. This CL
adds the `emit_continuing_` setup to the while emission. It also guards
the `emit_continuing_` usage with making sure the function is setup.
Bug: tint:1490
Change-Id: Ia89c49e567acda71a1f851a582103723cff71d49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93960
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
The while loop and let error message landed about the same time and there were
merging issues that didn't get caught by CQ.
Change-Id: I5cd606f1809cc29fa2366d3b78883fa0cfc3b394
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93961
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Standarize the messages, using 'let', 'override' or 'var'.
Module-scope 'let' needs to be replaced with 'const', but baby steps.
Bug: tint:1582
Change-Id: I290aede118a30ab0f4294c89ec43005371c87b45
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93446
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This patch change DependencyAnalysis::SortGlobals() to make sure that
'enable' directive nodes go before any other global declarations in the
sorted global node list, and thus ensure that all extensions will be
registered by reslover before dealing with any other global declarations.
This is necessary because some transforms will add AST nodes before any
other global nodes, and these added nodes should be handled by resolver
after 'enable' nodes are handled.
Bug: tint:1472
Change-Id: Idc2253fc055b0f121cb0cafcaca5275c23ed7b0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93760
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Copy/pasting this transform as a starting point for new transforms
causes the `State` classes to clash, and weird things happen. This
prevents that from happening.
Change-Id: Ia1c6b2b96e4d6375309aed535d7a87372b839792
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93880
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@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>
Currently nothing in Tint uses a different allocator type, but this
allows the CloneContext to support different allocators, the day we do.
Change-Id: I70367bd3710128d0708b3369f66b441344b789f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93602
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Parameters don't have storage classes or access qualifiers. This was
just (ab)using the fact that a parameter uses the same AST type as a
'var'.
Also simplify the parameter disable validation logic.
Bug: tint:1582
Change-Id: Ic218078a410f991e7956e6cb23621a94a69b75a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93603
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Add a validation to ensure zero-attribute for unused vertex
buffer slots (stepMode = VertexBufferNotUsed).
Fuzz tests found that non-zero-attribute with unused vertex
buffer can cause an error in swiftshader.
We may be able to think input data having non-zero-attribute
with unused vertex buffe is malformed. Refusing such input
data can avoid the error.
Bug: chromium:1333293
Change-Id: Ib58d526bdaefa683e459b5c813e348b72e81e13e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93560
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
Kokoro: Kokoro <noreply+kokoro@google.com>
This is currently identical to ast::VariableList, but once we break
ast::Variable up, this will become a different vector type.
Bug: tint:1580
Change-Id: Ib2db5772996a63cd1989e36f1034dc1fbd3b371a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93601
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Drop the vector typename from the initializer lists. These don't really
provide any significant help in understanding the arguments types, as
the list of element types can be easily inferred.
This is done to simplify the refactor ast::VariableList ->
ast::ParameterList.
Bug: tint:1580
Change-Id: Ibf8564ca9b2bafd2eaa2e4aa54c29be6bbe7a682
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93600
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This patch removes Depth24Unorm-stencil8 from IsDepthOrStencilFormat
to resolve a compilation error in latest Dawn.
Bug: 1459
Change-Id: Ic9a4aa669f28803eeeeea5280ad26d54897b35d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93740
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch removes the call of TextureFormatSupportsRendering() from
the dawn_unittest TextureValidationTest/SampleCount as in Dawn we have
already updated the restriction that non-renderable formats cannot be
used to create multisampled textures.
Bug: dawn:1459
Test: dawn_unittests
Change-Id: I3b7a016328c8cd06c771c58dd181005b61e01510
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93421
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
It was removed from the spec after determining it didn't provide any
additional capabilities beyond depth24plus-stencil8.
Bug: dawn:1454
Change-Id: Ifba62f22cd38bea88866c849c8d1754a2aa683e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92963
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Also adds override to all child classes' destructor so they correctly
get put in the vtable.
Bug: dawn:1451
Change-Id: Ic03841392b994f9bdc8487b6abc88bd86128e783
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93443
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
ObjectBase::refcount is no longer exposed and instead Reference() and
Release() methods are available to operate on it.
The client is now exposed through a GetClient() accessor.
Bug: dawn:1451
Change-Id: Ia47ed2de0a8f03ccc3275cb81d6335d2125060cb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93442
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Previously the ObjectAllocator was tracking the generation on the side
of the object. This was done to avoid the need to check that the objects
aren't null before accessing the generation in ClientHandlers. This is
only a very minor optimization for return commands so it is removed in
favor of simplifying the code.
The code is simplified in a bunch of place by getting the ObjectHandle
for an object directly (since it knows the generation now) instead of
walking the object graph returned by the allocator.
The ObjectBase class is also changed to store an ObjectHandle
interrnally that's only accessible via getters. Encapsulating the other
memebers will be done in follow-up CLs.
Also adds the generation to the ObjectBaseParams since all ObjectBases
now require it.
Bug: dawn:1451
Change-Id: Ic6c850fc989f715f7c80952ff447b7c29378cd27
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93146
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This allows using it without including all of WireCmd_autogen.h. Start
using in client::ObjectBase to use the typedef for ObjectId.
Bug: dawn:1451
Change-Id: I80e7247cc0e83ae48818b0d73b5236c6980204d1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93145
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This will allow easily adding new parameters to ObjectBase in the future
(like an object generation).
Bug: dawn:1451
Change-Id: I4fc81384987cdd9c33e672d15fcd960dbf0367a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93144
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This reverts commit d51b47ac67.
Reason for revert: crbug.com/1335550
Original change's description:
> remove_files.py: Print warnings on removals
>
> This will make it easier to debug build issues happening because if this
> script in the future.
>
> Bug: chromium:1314527
> Change-Id: I5bbb4082ac816f98860e621917bc35b26ba7cb29
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87700
> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: chromium:1314527
Change-Id: I47e352f57becaa064b6c8ceb022dcbed9bd212d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93441
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Not implemented on any of the backends yet. The feature
has CTS coverage so tests can be enabled as implementation
is written.
Bug: dawn:1178
Change-Id: Ib0fa39346a42cbd996d3c42bf779767d159067e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93309
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This struct is no longer needed now that the adapter exposes
a way to query its features that works both in native and the
wire.
Change-Id: Ib0d865330f65473bb0363858a9284e630da52eb1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93340
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch fix two implicit type conversion to make Kokoro green.
Bug: tint:1473, tint:1502
Change-Id: I7f4d1d71e45a3d8e834625a9f71acc72a8816685
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93343
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL adds a DAWN_MAKE_CACHE_REQUEST X macro
which helps in building a CacheRequest struct.
A CacheRequest struct may be passed to LoadOrRun
which will generate a CacheKey from the struct and
load a result if there is a cache hit, or it will
call the provided cache miss function to compute a value.
The request struct helps enforce that precisely the
inputs that go into a computation are all also included
inside the CacheKey for that computation.
Bug: dawn:549
Change-Id: Id85eb95f1b944d5431f142162ffa9a384351be89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91063
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Suppresses failures found when switching from 11.5.2 to 12.4
on the Intel Mac Minis.
Bug: dawn:1461, dawn:1462, dawn:1463, chromium:1334335
Change-Id: Ie0d42a1b4aa81f457145a53eebb1501a5eb77fbe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93308
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@google.com>
Commit-Queue: Brian Sheedy <bsheedy@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
DXGI external images can now be imported with both fence and texture
shared handles. Fence wait and signal values can be specified for
ProduceTexture. Keyed mutex functionality is kept as is with no change.
The D3D12 resource wrapping tests now run in both keyed mutex and fence
modes.
Bug: dawn:576
Change-Id: Ic793bcc828e5a8850c1367ecffabedd1c67184d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78604
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
This patch
1. Add F16 literal support in WGSL lexer and parser for both decimal and
hex form. Also fix the f16::Quantize method to deal with subnormal cases
correctly.
2. Fix exactly-representable check for hex f32 literal to deal with
subnormal cases.
3. Implement and fix related unitests for f16 and f32.
Bug: tint:1473, tint:1502
Change-Id: Ia4a7c9144ef9323fb23b2200a64e1ca8afb6c334
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93100
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Commit-Queue: David Neto <dneto@google.com>