Commit Graph

383 Commits

Author SHA1 Message Date
Jiawei Shao 1b02102e2b Declare nextInChain as ChainedStructOut when extensible is out
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>
2022-09-10 01:38:59 +00:00
shrekshao 145337f309 Use SubstituteOverride transform to implement overrides
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>
2022-09-07 20:09:54 +00:00
Corentin Wallez 1105ec78fe Merge DAWN_FORMAT_VALIDATION_ERROR in DAWN_VALIDATION_ERROR.
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>
2022-08-30 13:39:47 +00:00
Corentin Wallez 1eb6d2dd02 Convert a few remaining DAWN_VALIDATION_ERROR.
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>
2022-08-30 13:33:37 +00:00
Brandon Jones 462f648896 Make adapter info device matching more flexible
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>
2022-08-02 22:14:35 +00:00
Austin Eng bc285fb573 Rename CacheKey-related files to Stream
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>
2022-07-29 00:36:21 +00:00
Austin Eng 79ab0d38bb Refactor [de]serialization functions out of CacheKey
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>
2022-07-28 23:04:31 +00:00
Corentin Wallez 1260a53018 Mark descriptor/options as optional for requestDevice/Adapter
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>
2022-07-26 17:36:44 +00:00
Corentin Wallez a45561bb8c dawn.json: Add the "chain roots" data for chained structs.
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>
2022-07-14 12:58:25 +00:00
Corentin Wallez 7a64127a41 api_cpp.h: Fix alignas declaration following ChainedStruct.
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>
2022-06-29 17:37:41 +00:00
Loko Kung 7223a5e7c9 Fix incorrect indentation in version generator script.
Bug: dawn:549
Change-Id: I6eaa61c8339114fc3692251f263dea65816b618e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94528
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-06-23 01:14:24 +00:00
Loko Kung 7d2b9d9e83 Add alternative method to use a version/git hash from a file.
- 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>
2022-06-22 04:19:43 +00:00
Ben Clayton a823ea10a0 dawn: Fix GCC warnings about functions not returning
Change-Id: Ia55a6549508a3259b97a35d2c06659a86633bc9e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94321
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-06-20 14:35:22 +00:00
Ben Clayton bf55236e13 dawn: Fix GCC build
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>
2022-06-20 13:45:21 +00:00
Corentin Wallez a55b29e0bd dawn::wire::client: Make ObjectTypeToTypeEnum a template variable.
Bug: dawn:1451
Change-Id: I21cba4b245b2b574104471da973000d552f1c7de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93604
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-06-19 19:19:11 +00:00
Corentin Wallez 0ebe86d1ca dawn::wire::client: Merge object allocators, add variadic Make.
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>
2022-06-17 21:21:39 +00:00
Corentin Wallez 0daef56b49 dawn::wire::client::ObjectBase: encapsulate remaining members.
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>
2022-06-14 16:13:26 +00:00
Corentin Wallez 0f97df8c53 dawn::wire::client: Track the object generation on the objects
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>
2022-06-14 14:55:46 +00:00
Corentin Wallez 87af04b769 dawn::wire: Separate ObjectHandle to its own header.
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>
2022-06-14 13:22:16 +00:00
Corentin Wallez ff2dc652f5 Revert "remove_files.py: Print warnings on removals"
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>
2022-06-14 00:04:55 +00:00
Corentin Wallez d428187d35 Add reflection APIs for wgpu::Buffer.
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>
2022-06-08 14:46:41 +00:00
Loko Kung af510d7c6a Use git hash as fingerprint for getting caching interfaces.
- 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>
2022-06-07 23:31:31 +00:00
Austin Eng 6a224fbd52 Remove custom serialization of device properties
Fixed: chromium:1315260
Change-Id: I1b4847289f34034a2a0bb5f5c8405ccf9d8e9c3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92120
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
2022-05-31 20:07:39 +00:00
Brandon Jones 8cb8c7add7 Begin auto generating GPUInfo utilities
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>
2022-05-26 23:47:39 +00:00
Austin Eng 20a4bd8377 Remove device-child wire hack and enable DeviceLifetimeTests on the wire
Bug: dawn:384, dawn:1164
Change-Id: I88a503513295900975819b56f60738218a1c23ac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90920
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-05-24 13:23:33 +00:00
Corentin Wallez 74771202c7 Add nullable annotations to webgpu.h
Bug: dawn:22
Change-Id: Ie14072e91bab3b69b8d98f15bcbdeaa6679ffcd7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91240
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-23 15:44:29 +00:00
Corentin Wallez f9f1c4b526 CMake: tweak third-party imports.
- 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>
2022-05-16 09:11:21 +00:00
dan sinclair a5ff0e9dc3 [warnings] Add Wsuggest-override and Wsuggest-destructor-override.
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>
2022-05-10 18:44:34 +00:00
Loko Kung 03ddfbb81f Wrap get_gitHash in try-catch to prevent failures in tarball builds.
Bug: chromium:1321370
Change-Id: If39d2236d1b4d965f7bd189f6bd1cdc70436c41d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88582
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-03 00:28:53 +00:00
Corentin Wallez d51b47ac67 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>
2022-04-22 12:13:41 +00:00
Aleksi Sapon 4e1c65d030 Fix dawn_version_generator.py on Windows when not using depot_tools
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>
2022-04-21 21:35:26 +00:00
dan sinclair fb5a492787 Fix inclusive language presubmit
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>
2022-04-19 22:25:45 +00:00
dan sinclair a12ddc6ec6 Updates to dawn_version_generator.
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>
2022-04-19 19:27:08 +00:00
dan sinclair d0fb4a36ac Convert all dawn includes to use non-system include syntax.
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>
2022-04-19 14:24:04 +00:00
Loko Kung c083d65a0c Adds device-side cache key generation.
- 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>
2022-04-12 23:50:56 +00:00
Corentin Wallez b2fdd6402d Rework dawn/native/ProcTable.cpp's template to better handle functions.
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>
2022-04-12 16:46:01 +00:00
dan sinclair 8c5cb62438 Remove extra CPPLINT.cfg files.
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>
2022-04-12 07:00:21 +00:00
dan sinclair 479dc6b7eb Enable build/header_guard
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>
2022-04-11 18:30:50 +00:00
dan sinclair fcf56791c1 Create more targeted CPPLINT.cfg files.
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>
2022-04-11 13:05:40 +00:00
Loko Kung 24ae176d91 Fix commit build rule to use empty hash (and not throw error) if git is not available.
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>
2022-04-05 20:11:43 +00:00
Loko Kung f57867264a Adds a generated file with the dawn git hash encoded at build time.
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>
2022-03-31 05:09:04 +00:00
Loko Kung 4d8352542a Adds strformat code-gen for helping auto-generate readable strings for structs.
- 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>
2022-03-19 00:21:48 +00:00
Corentin Wallez d450c6edc9 Fix -Wstrict-prototypes in webgpu.h
Bug: https://github.com/webgpu-native/webgpu-headers/issues/151
Change-Id: Ifb884478b45b9c069696b61ce95e56dbe53a96e1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83820
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-16 18:35:36 +00:00
Shrek Shao 1554a7d8f9 Fix dawn.json for upstream webgpu-headers
- Add disabled_tags 'dawn' to webgpu_headers_gen
- Rename WGPUSurfaceDescriptorFromXlib to sync with upstream
- Other sync with upstream: surface wayland and android enums

Bug: dawn:269
Change-Id: I5ca5c5362c54018f9d217af6a6ab4e3e84a5d780
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83000
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-08 20:56:10 +00:00
Brandon Jones 6e8c473fa5 Updating names of attachment clear values
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>
2022-02-19 00:44:12 +00:00
Shrek Shao 71a363bcf9 Add error directives for api.h/api_cpp.h #ifdef __EMSCRIPTEN__
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>
2022-02-09 19:42:51 +00:00
Shrek Shao ee50bc060a dawn.json changes for the upstream webgpu.h
- 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>
2022-02-08 20:21:40 +00:00
Ben Clayton 9fb7a5146a tint->dawn: Move src/include -> include
Also simplify the target names.

Bug: dawn:1275
Change-Id: I2929b70897f64903b91b693b48c2e8dd7c11d07b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79102
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 18:18:18 +00:00
Ben Clayton 35940f9b83 gn: Trim target prefixes from src/dawn targets
Removes stuttering.

Bug: dawn:1275
Change-Id: Ie32929e0b0ca579d7eef13a43fd2d1c648140276
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79101
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-04 17:15:16 +00:00
Ben Clayton 818001d32e tint->dawn: Move src/dawn_native -> src/dawn/native
Bug: dawn:1275
Change-Id: Ic60a00107a015bc677ff929c492f1085ffc38482
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79083
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-02-04 17:07:46 +00:00