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>
These sources need to be generated in Dawn's source tree
so that Chromium's //third_party/webgpu-cts DEP can be
removed.
Bug: chromium:1333969
Change-Id: I03c8cba691bcbfac00839f0cdd40fab6198ec83f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91060
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Adds an "-aggregate" flags to ./tools/run/cts time to report results
aggregated by test
Change-Id: Id8d15188846b3bff79ac4c65a09e5d6740acde73
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93300
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Only try to use `glfwGetPlatform()` to distinguish X11 and Wayland if
GLFW 3.4 is present. This fixes the build with older GLFW versions.
Change-Id: Ia986933eeb3f049336bcd06c71b326f92a1da284
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93262
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This change attempts to better classify devices with a Metal backend
that aren't currently reporting vendor/device ID. In practice this
mostly means Apple-produced GPUs, like the M1 series.
Bug: dawn:1443
Change-Id: I9e8467a50c9f8eeccc00863f6dee32c0f91380dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92123
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
We were missing an include for uint32_t, and a forward declaration.
Change-Id: I4a2eed757364e335e12d14aaeda18fc7aafb2886
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93261
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
This CL removes build files left over from the tint/dawn merge.
Bug: dawn:1275
Change-Id: I7fc4def4d2634368ea247a268a41c8c4913fed23
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93260
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
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 patch clamps clearStencilValue into the range of the stencil
format to align with the latest change in WebGPU SPEC.
Bug: dawn:1453
Test: dawn_end2end_tests
Change-Id: I37fab5fd4826a608cb972eed74308114002c7930
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92750
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Change #if DAWN_PLATFORM_XXX to #if DAWN_PLATFORM_IS(XXX)
To prevent #ifdef usage and reference without including
dawn/common/Platform.h
Also change #if DAWN_COMPILER_XXX to # if DAWN_COMPILER_IS(XXX)
Bug: dawn:1447
Change-Id: If6c9dab15fd2676f9a087507f5efcceeff468d33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92625
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This requires adding a custom implementation of DeviceCreateTexture and
the Texture object in the wire client.
In dawn::native this requires the format enum separately from mFormat
which is a `const Format&` so that garbage format values can be
reflected correctly for error textures.
Bug: dawn:1451
Change-Id: I75b5635f36647f6f04dae54e92154f2b552beb64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92661
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Other drivers don't have MSAN instrumentation, so MSAN produces
many false positives since it can't track changes to memory
from uninstrumented libraries.
Also, implement AllocNoThrow for MSAN to return nullptr on large
allocations. Local fuzzing found MSAN didn't implement std::nothrow.
Fixed: chromium:1333180
Change-Id: I4f3d2c04496a25ba6ebe414d6d5c3c5850a70fec
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92820
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Headers exposing functionality from the core Tint library should be
included via include/tint/tint.h.
This fixes the google3 build.
Change-Id: I82a9d0105b3b44fb4c4c89b59e9282290dd49c61
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93120
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Changes dawn::native procs to correctly convert C++ enum and bitmask
returns values.
Bug: dawn:1451
Change-Id: I39a8d218f76e25b178a83eeb99d653222d39d040
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92440
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>