See https://github.com/webgpu-native/webgpu-headers/issues/179
Also changes WGPU_NULLABLE instead of /* nullable */ and make a couple
formatting fixes.
Bug: None
Change-Id: Ieb4315cddd3c806144892221fba11888171f072f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133102
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Only Constants.h remains in no namespace; but it may be addressed
in the future as well.
Bug: dawn:302
Change-Id: Ib9b9ab4b974ad1de1bb9f2302f4d24d8216f55e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132841
Kokoro: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This change updates the Device descriptor to allow a device lost
callback to be passed in at device creation time. This will be
important for allowing the API to return devices which have
already been lost in a future CL, which is the behavior required
by the spec.
This change does not yet deprecate the old method for setting the
callback, as there's still some tricky scenarios that will need to
be worked around to enable that and this CL is already fairly
large. (The uses in question pass the device or a value created
from the device as the userdata.)
Bug: chromium:1234617
Change-Id: I1adea5ceffdfdcfedff9fff4960f12303abba29c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121041
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Notes:
- Separates ChainedStruct to be reusable without cpp header. (Also
updates native structs to directly use it.)
- Manually implements the descriptor in DawnNative.
- Reworks ChainUtils with mapping from struct to STypes.
- Updates the tests to use either SetPlatformForTesting which is still
required because DawnTest uses a "global" instance for all tests and
some tests require setting (and cleaning up) a test specific platform.
Bug: dawn:1374
Change-Id: I078c78f22c5137030cf3cf0e8358fe4373ee9c6c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132268
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Add custom C++ serializer for methods that need to be handwritten
Bug: chromium:1374747
Change-Id: I438db05b6fd6d1a1542d847c4b40f22b9143b0d5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114721
Commit-Queue: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Implements C++ serializer implementation that translates protobuf
objects into Dawn serial data.
1) A generator that builds a fuzzing harness that converts LPM structured data
into serialized bytes, that are then sent to Dawn Wire Server.
2) Object store for dawn objects that are allocated and
freed.
Bug: chromium:1374747
Change-Id: I09c1be6cdc2eccf4a91de808f19494d97d01b3d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114720
Commit-Queue: Brendon Tiszka <tiszka@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
- Adds a deprecation warning for the incorrect usage.
- Adds test to verify that the warning is emitted and that the results
are equal.
- Fixes all existing tests to use the newer code path.
Change-Id: I01bf85137ad1c66966e1aa0259ae03fc5247ba25
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/130320
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Add ability to define custom protobuf structures for commands that
need to be hand written.
Bug: chromium:1374747
Change-Id: I69d5c55d69c3544835a23e4e0360900b991ccbd3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114643
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brendon Tiszka <tiszka@chromium.org>
Change-Id: I77044ee7f0ce1b066dd8c8a1ee1b34e07f5e9766
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128660
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Change-Id: I0df2677cfd454a2f38e580acd08089694486f6ac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128680
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This CL updates the configuration to allow providing the markupsafe
folder in the CMake configuration. The generator is updated in order to
in set the folder into the path so `jinja2` can find markupsafe.
Change-Id: I3b79deba0d8c2af9c751ddb63c4febc542e904df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126661
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
1. Auto-generate mutex locking code in DawnNative's ProcTable's
functions. Using a mutex owned by the related Device.
- Unless the function/class has "no autolock" attribute (new) in
dawn.json. In which cases, no locking code will be auto-generated.
- Currently Instance, Adapter, Surface, Encoder classes and
Reference/Release method have "no autolock".
2. Added Feature::ImplicitDeviceSynchronization to enable Device's
mutex.
- If this feature is disabled, lock/unlock Device's mutex is no-op.
Auto-generated locking code will have no effect. This is the default.
- This approach is used instead of generating two sets of ProcTable
because it's cleaner and the internal code doesn't need to care about
whether there is a mutex being locked or not. Furthermore, if there
were two sets of ProcTable, and user used dawnProcSetProcs() to set
global ProcTable, it would affect all other modules using different
Devices. Even though those modules don't need thread safety.
Bug: dawn:1662
Change-Id: I75f0d28959f333318e4159916b259131581f79f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119940
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Add generators for protobuf files.
This CL contains the basic logic required to generate the protobuf
files from dawn.json and the newly added dawn_lpm.json for
libprotobuf-mutator.
Bug: chromium:1374747
Change-Id: I5dd207ed94ecdac365306c26e79b6cc18d3978f6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114640
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brendon Tiszka <tiszka@chromium.org>
Only load extension entry points if the extension is supported.
From the eglGetProcAddress manpage:
"A non-NULL return value does not guarantee that an extension function
is actually supported at runtime. The client must also make a
corresponding query, such as glGetString(GL_EXTENSIONS) for OpenGL and
OpenGL ES extensions [...] to determine if a function is supported by
EGL or a specific client API context."
This required moving extension initialization from OpenGLFunctions
into OpenGLFunctionsBase.
Change-Id: Ib4e8360ba455818701990b4476689b651d097ca8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121760
Commit-Queue: Stephen White <senorblanco@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Note that the objects do not have them added in this change because
they are a bit more complicated w.r.t whether we should add a refcount
or not.
Change-Id: Ie832e8923821d06d0dfcbd6a5bfdc9b2cb89dab5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119820
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
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>
The generator_lib.py processing of file renders would check that the
output directory doesn't exist and if needed, would create it. However
by default makedirs errors if the path already exists. This caused
issues when multiple generator_lib.py generators with the same output
dir would run in parallel in builds, because there can be a race where:
- GeneratorA: Check os.path.exists -> returns False
- GeneratorB: Check os.path.exists -> returns False
- GeneratorB: os.makedirs -> Ok
- GeneratorA: os.makedirs -> Exception, fails the build.
Instead use os.makedirs(exist_ok=True) inconditionally to remove this
racy behavior.
Bug: None
Change-Id: I5cb401a1df11a3640faeea94c15cb54236edc05a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114521
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Pads serialized wire command buffers to 8 bytes so that we don't have
misaligned write/reads which can cause SIGILL depending on platform and
compilation mode, i.e. -c dbg in google3 builds.
- Adds helpers for aligning sizeof calls.
- Adds constant for wire padding (8u).
- Modifies BufferConsumer to allocate according to padding. This
guarantees that when we [de]serialize stuff, the padding should be
equal on both sides.
- Modifies extra byte serialization code (adding CommandExtension
struct). This makes it clearer that each extension needs to be
padded independently. Otherwise, before in wire/client/Buffer.cpp,
since the read/write handle sizes were being passed as a sum, but
read out separately from the BufferConsumer, we corrupt our pointers.
- Adds some simple unit tests.
Bug: dawn:1334
Change-Id: Id80e7c01a34b9f01c3f02b3e6c04c3bb3ad0eff9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110501
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This reverts commit 6c5db2afa6.
Reason for revert: Ran into issues integrating into all the required build environments.
Original change's description:
> Scaffolding for generation of intrinsics files.
>
> This CL sets up the basis for the intrinsic file generation. All of
> the GN and CMake pieces are setup, but they aren't hooked into the
> main build yet. That will be a followup which just enables the
> generation in order to allow easy reverting.
>
> Change-Id: Iccac59377076ed6ac66eeaf0be965be2f49bc738
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107981
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: If289cd2769faea6466bcae68c3c58cf416b3567a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108421
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL sets up the basis for the intrinsic file generation. All of
the GN and CMake pieces are setup, but they aren't hooked into the
main build yet. That will be a followup which just enables the
generation in order to allow easy reverting.
Change-Id: Iccac59377076ed6ac66eeaf0be965be2f49bc738
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107981
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This patch adds DawnAdapterPropertiesPowerPreferenceDescriptor for
querying adapter power preference which is useful to distinguish
different logical adapters created on same physical device but with
different power preferences.
Bug: dawn:1516
Test: dawn_unittests
Change-Id: I12ed6e370f8b57c860520154565765f0ee894831
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102780
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Previously when moving around directories for generated files, Dawn ran
into an issue where stale files where #included instead of the new ones,
causing compilation failures. To get around this a
remove_stale_autogen_files mechanism was added that scans the gen/
directory for files not in an allow-list of directories.
This mechanism is now causing problems for bringing up Dawn standalone
tests on Android as these test also generate files in Dawn's gen/
directories, and their files get deleted by remove_stale_autogen_files.
We are not foresseing any additional shuffling of directories and it's
safe to expect that all stale files have been removed from CI builder
caches at this time. So remove_stale_autogen_files can go. This is what
this CL does.
Fixed: dawn:1543
Change-Id: I7dbf1eae6c55b7659f3837b6d4a565052001ce57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103040
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This removes a serialization optimization where structs could be
memcpy'ed. memcpy is still used for deserialization of structs.
Structs may contain padding bytes which when copied can leak
uninitialized data across a trusted boundary. In Chrome, this
means previously-written or uninitialized bytes in the GPU process
could leak into the Renderer process.
In the future, we may be able to bring this back by introducing
a concept of safe-to-memcpy structs, or by forking the code so
that Renderer->GPU process uses the unsafe memcpy, and
GPU->Renderer uses to the safe member-by-member version.
An alternative might be to ensure that everything returned from
the WebGPU API has initialized padding, but this invariant is not
trivial to guarantee.
Fixed: chromium:1359098
Change-Id: I91151251d1ab999e0f5552e1efccc472e451cc10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102461
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch changes the type of the structure member nextInChain in
AdapterProperties and SupportedLimits as "ChainedStructOut *" instead
of "ChainedStruct * const" as all members of these structures should
be writable when they are used as the outputs of Dawn APIs.
Bug: dawn:1516
Change-Id: I185a0b5846ac6009717ac722df67bf7170354947
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101802
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Remove the old backend specific implementation for
overrides. Use tint SubstituteOverride transform to replace
overrides with const expressions and use the updated program
at pipeline creation time.
This CL also adds support for overrides used as workgroup size
and related tests. Workgroup size validation now happens
in backend code and at compute pipeline creation time.
Bug: dawn:1504
Change-Id: I7df1fe9c3e358caa23235eacd6d13ba0b2998aec
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99821
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Done with changes to Error.h and the following command:
git grep -l DAWN_FORMAT_VALIDATION_ERROR | xargs sed -i "" "s/DAWN_FORMAT_VALIDATION_ERROR/DAWN_VALIDATION_ERROR/"
then fixing compilation errors in ErrorTests.cpp, Pipeline.cpp and
CommandEncoder.cpp.
Bug: dawn:563
Change-Id: I081a514d662e81f4842b6d7fadfcea67c12720d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100468
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
There are still DAWN_VALIDATION_ERROR occurences left but they don't use
any format string so it is fine to merge DAWN_FORMAT_VALIDATION_ERROR
into DAWN_VALIDATION_ERROR in follow-up CLs.
Bug: dawn:563
Change-Id: Ic1ba1de44216b36ef6a972712b957685e0ee193e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100467
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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>
Bug: dawn:1480, dawn:1481
Change-Id: If61f0466d79e7759ed32c4ddf541ad0c17247996
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96904
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Storing values into the cache will need to serialize and deserialize
values in addition to keys. This patch factors the serialization
utilities out of CacheKey into a more general "Stream" utility that
supports both input and output for serialization and deserialization.
Multiple files are not renamed to make parsing the diff easier. They
will be renamed in Change If61f0466d79e7759ed32c4ddf541ad0c17247996.
Bug: dawn:1480, dawn:1481
Change-Id: If7594c4ff7117454c1ab3d0afaeee5653120add8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96480
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
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>
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>
On 32bit Windows clang warns that alignas(ChainedStruct) uint64_t
forces the uint64_t to have a smaller alignment than it naturally has.
Fix this by making the alignas decoration take the max of
alignof(ChainedStruct) and alignof(first member).
Bug: dawn:1465
Change-Id: Ia5b73fc1be1fa56f36c5c360e719ef2a1dff7dd1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94940
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Takahiro <hogehoge@gachapin.jp>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
- This is necessary for Chromium builds from tarballs where git is no longer available. This gives Chromium another option to create the version file when creating the tarball to accomplish the same thing.
Bug: dawn:549
Change-Id: Iffb4bf694b0df1306dd92939353422e5115346a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94043
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
It's not valid for an explicit template specialization to declare a storage class (`static`). GCC correctly catches this, while Clang is too relaxed.
Use C++17's 'inline' instead. The alternative is to push the initializers and values into the cpp file.
This breakage was introduced in: https://dawn-review.googlesource.com/c/dawn/+/93604
Bug: dawn:1451
Change-Id: Ib3e61d233e16fd7828f8a2ae0909eedbd24ee52e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94320
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit changes all the [Object]Allocators from the Client into a
PerType<ObjectStore> member that contains a bunch of ObjectStore acting
on ObjectBase.
Adds a new (template) member functions to the client, Make/Get/Free that
act on any object type, and update all the uses of previous
[Object]Allocator to use these new methods.
Also removes generated code that was generated per object type in favor
of using the type-generic ObjectAllocator.
Bug: dawn:1451
Change-Id: I6463b2fc4a827e3000c2a666abf08aa1a71c3b3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93141
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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 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>