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>
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>
- Also changes to use string_view for the constexpr hash.
Bug: dawn:549
Change-Id: I1ded4994d501f0378d3fa8f5c16d07e3c566270f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92962
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This change moves the bulk of the existing GPUInfo functionality into an autogenerated source built from a JSON file that describes the GPU
vendor and device IDs, with device IDs broken down by GPU architecture.
Also adds the fields needed to implement GPUAdapterInfo in Blink to the AdapterProperties.
Bug: dawn:1427
Change-Id: I6a8b1fa7a63ec8d71556fc5bb3ae12cfe5abf28b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90962
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
- Match indentation in the whole third_party/CMakeLists.txt file
- Import glslang after SPIRV-Tools to avoid a warning that HLSL code
might be invalid.
- Disable installs for glslang.
- Fix casing of one "using Foo"
Change-Id: Ia7b32501cb84e0fe2df9cde0762cee774ef65581
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90245
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL adds the `-Wsuggest-override` and
`-Wsuggest-destructor-override` warnings and fixes up the identified
issues.
Change-Id: I0ec1303a822abc258ce34d3bf1900e37ade6a8dc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89561
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
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>
Find git using shutil.which() so extensions are resolved according to PATHEXT.
Remove the "print(e)" that is breaking the expected output.
Bug: dawn:1383
Change-Id: If299b744add0797036598129e08ba7d8c64002e1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87481
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
The current presubmit has the filter inverted so it would only attempt
to match the filtered files. The file name also has to be converted to
`LocalPath` otherwise it's attempting to compare a python object to a
string and always fails to match.
Bug: dawn:1339
Change-Id: Ie7712dee60f6b9df2cb78c9feab11769f7ea1f02
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This CL fixes the incorrect `path` variable used when the HEAD lookup
fails, the proper path is now emitted.
The call to `get_gitResolvedHead` is wrapped in a try/except and an
exception is treated as if we are not in a git directory. This allows
the build to continue if `refs/head/main` doesn't exist in the local
check.
Change-Id: I49ae66cc5eac99d43387b58d28d356282b8f6783
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87100
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This CL changes several includes which were using the system include
syntax to the local syntax. This causes GN check to verify that the
headers are specified correctly in the dependencies.
Two missing dependencies are added to the BUILD.gn file for the
Dawn tests.
Bug: dawn:1373
Change-Id: I7afd5ab48f4f2e2ddaf1839058c6bbeec2b97fd0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86940
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
- Note that the device-side cache key will be prepended to object cache keys to prevent incompatible adapter/device cache clashes.
- Adds a new template file to auto=generate these cache serializers based on arguments.
Bug: dawn:549
Change-Id: I24b9d11eb38c579acfcc173a5dced9e1b649cf2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86081
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This is a small rework to try to make the template better handle
functions that aren't associated with an object, when during an
unrelated patch I got confused that APICreateInstance didn't appear in
dawn::native.
Change-Id: If5a2aa3f9e348d1847e48fec4e90e5966ddd489d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86530
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>
The generator/template folder has a CPPLINT.cfg which covers the
templates already so the generator one isn't required.
Change-Id: Ie1212475cd3a18daaf8a2425f3589c1f1b98b962
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86441
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This CL enables the build/header_guard lint check. The existing headers
which failed the check were updated, missing headers added. An exclusion
file for the generator templates was added as well.
Bug: dawn:1339
Change-Id: If572e460179ad501293d5d6cf01e0ea900daa979
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86207
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL moves the filters out of the PRESUBMIT.py file and into specific
folder CPPLINT.cfg files. This allows having all the lints enabled in
the Tint code and specifically disabling in Dawn code as needed.
Bug: dawn:1339
Change-Id: Ieb0178b0aac0ea67c52cc5547984ea5696eef5a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86208
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Bug: dawn:549
Change-Id: I75ab6eb0273ddcb2dc571d5c91d35422793fdffc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85745
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Bug: dawn:549
Change-Id: I5d6306f33b7ad2247ee75a0c5387a2bc6fac0497
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83901
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
- Adds generator infra for absl::StrFormat for bind group structs and types.
- Uses absl::ParsedFormat to avoid multiple parsing for format strings.
Bug: dawn:549
Change-Id: Ida4ca65eb85c4474c492161c8ae34f53bd692a3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81944
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Renames multiple attachment clear values to match their new names in the
spec, deprecating the old ones.
- GPURenderPassColorAttachment.clearColor -> clearValue
- GPURenderPassDepthStencilAttachment.clearDepth -> depthClearValue
- GPURenderPassDepthStencilAttachment.clearStencil -> stencilClearValue
Additionally, the old names are marked as deprecated with appropriate
warnings if they are used during the deprecation period.
Bug: dawn:1269
Change-Id: I6649184d65578118942c1f51a41f350719665272
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80941
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This could avoid including dawn's version of webgpu headers
and confusion at runtime when build with emscripten.
Emscripten's system/include/webgpu headers should be used.
Bug: None
Change-Id: Ie8c6ebc23f28a56b1cb887ae7f11d3f738151aec
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79740
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
- Fix power preference undefined value
- Remove 'upstream' tagged content from emscripten-bits generation
explicitly tag 'emscripten' to things still needed
Bug: None
Change-Id: If575823ff1d99237d7c2cb0e784c24a7299b4a31
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79220
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Also remove stuttering from the target names by dropping the 'dawn_' prefix.
Bug: dawn:1275
Change-Id: Iac79f9927010b8e5edeb7e0949092b34431d54dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79061
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
But keep a namespace alias to avoid breaking project that depend on the
previous namespace name while they get updated.
Done with through the following steps:
- git grep -l dawn_native:: | xargs sed -i "" "s/dawn_native::/dawn::native::/g"
- git grep -l "namespace dawn_native" | xargs sed -i "" "s/namespace dawn_native/namespace dawn::native/g"
- git cl format
- Manual fixups in generator/templates (and the addition of
namespace_case in dawn_json_generator.py).
- The addition of the namespace alias in DawnNative.h
Bug: dawn:824
Change-Id: I676cc4e3ced2e0e4bab32a0d66d7eaf9537e3f09
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75982
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
But keep a namespace alias to avoid breaking project that depend on the
previous namespace name while they get updated.
Bug: dawn:824
Change-Id: I1e99c4d0d2acf7644a225a88d07806d1a64478e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75540
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>