Commit Graph

3884 Commits

Author SHA1 Message Date
Austin Eng 8411a12ab1 Add a mechanism for finding the best tier for a set of limits
Multiple groups of limits may be defined via macros.
ApplyLimitTiers degrades the incoming limits such that
each limit value within a group is clamped to the
best possible tier. A device may be in Tier 2 for one
limit group, but Tier 1 for another limit group.

Also adds equality operators to dawn_native generated structs
for comparison of expected limits in the test.

Bug: dawn:685
Change-Id: Ibdf947f2ccd44f70d66f48bed472ff5681230633
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-09-28 01:04:10 +00:00
Dawn Autoroller f04d9d6618 Roll Tint from b9a2f5946e to 231b50baab (4 revisions)
https://dawn.googlesource.com/tint.git/+log/b9a2f5946e0c..231b50baab51

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC cwallez@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: cwallez@google.com
Change-Id: I105d4cb7545d8080dc5b85c4db61bc291df00249
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65200
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-27 23:46:50 +00:00
Ben Clayton dc890d6915 DEPS: Add NodeJS binding dependencies
These are behind the new `dawn_node` flag, which can be enabled by using the new `scripts/standalone-with-node.gclient` file.

Bug: dawn:1123
Change-Id: Ia7ca715808e46b17f91338f56ffc6794d0104fd7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64900
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-27 22:55:39 +00:00
Ben Clayton a3c387a6a2 dawn_node: Add utils/Debug.h
Contains macros used for logging and marking code as unimplemented.

Bug: dawn:1123
Change-Id: I861348b0cc53eb1dc80ed5b477ab33af45d1acd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64747
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-27 21:56:19 +00:00
Ben Clayton cea792f971 dawn_node: Add idlgen tool
A go WebIDL parser and template generator tool.
Will be used to generate the NodeJS bindings for Dawn.

We may wish to reimplement this in Python some day. Not today.

Bug: dawn:1123
Change-Id: I31c868efcd8ba00084a6c25a1fc0e3ad774dfa53
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64746
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-27 20:41:15 +00:00
Michael Tang 029d67f2c8 D3D12: implement WGSL pipeline cache key generation
Since spirv_to_dxil does not generate HLSL, to support pipeline caching,
we need to generate a cache key from the WGSL instead.

A new type, ShaderCompilationRequest, is added to isolate the
compilation inputs to help ensure that the cache key contains all
relevant information.

Bug: dawn:1103
Change-Id: Ic2f09326dc3ac254cecf35098dcfe95aa396796f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61160
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
2021-09-27 17:15:09 +00:00
Dawn Autoroller 4420ecc71e Roll Tint from 594e010cfb to b9a2f5946e (1 revision)
https://dawn.googlesource.com/tint.git/+log/594e010cfb67..b9a2f5946e0c

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: kainino@google.com
Change-Id: I480010359f5e9987994b6a86d675ff5b5eacb528
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65060
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-24 19:41:57 +00:00
Ben Clayton 30eeac7578 CMake: Simplify overriding of options / settings
Outer projects can just set() the option / setting before calling add_subdirectory() on Dawn.

Also provide a build directory for Dawn's third_party dependencies. Allows the outer project to specify a third_party directory that's out of the dawn tree.

Change-Id: I04c5f12b362ee9c9488b7b78a6aa5fa6f55dec98
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64743
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-24 10:38:18 +00:00
Jiawei Shao 0e3aa3c8d0 Metal: Support creating render pipeline asynchronously
This patch implements the asynchronous path of creating render
pipeline on Metal backend.

BUG=dawn:529
TEST=dawn_end2end_tests

Change-Id: I3f40949f35f6cbc340bebf481bd4e204b12d86c2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64880
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2021-09-24 00:40:59 +00:00
Jiawei Shao 525039ddc6 Vulkan: Support creating render pipeline asynchronously
This patch implements the asynchronous path of creating render
pipeline on Vulkan backend. This patch also makes the access to
the member mCache of Vulkan::RenderPassCache thread-safe as it
can be accessed in different threads simultaneously.

BUG=dawn:529
TEST=dawn_end2end_tests

Change-Id: I74c799935ef46405275585cb5dccfcb552a48aa4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64840
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2021-09-24 00:40:57 +00:00
Brandon Jones ba66295033 Improve validation errors, Part 1
Begin's using Abseil's string formatting and new error context tracking
to dramatically improve the usefulness of validation messages. In
addition to putting in place several utilities to enable better messages
this change also updates the BindGroup buffers bindings validation
messages as a test for the new mechanisms.

Bug: dawn:563
Change-Id: Ie5bf5ffb24a9013cebd67745dc4172dfbc901e9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64201
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-23 21:26:33 +00:00
Brandon Jones a04663c13d Added Abseil as a third-party dependency (Take 2)
Another attempt at https://dawn-review.googlesource.com/c/dawn/+/63780
Depends on https://skia-review.googlesource.com/c/skia/+/451638

This version of the CL fixes the Cmake and Skia compatibility issues
from the previous CL.

Bug: dawn:563
Change-Id: I41a7ee0aef1924df08a9be41e94effb7cd0025df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64600
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-23 20:36:03 +00:00
Ben Clayton 0ecd67a3fa CMake: Fix build when DAWN_BUILD_EXAMPLES=0
glfw is used by several `src/utils/*.cpp` files, regardless of whether examples are being built or not.

Change-Id: Iba90fbf96e254979c72acf792af3cb86d889f5db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64742
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-23 20:13:53 +00:00
Dawn Autoroller 37126dd679 Roll Tint from 5e6d4577fd to 594e010cfb (1 revision)
https://dawn.googlesource.com/tint.git/+log/5e6d4577fdc6..594e010cfb67

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: kainino@google.com
Change-Id: I9e3adf216ebe3386989297f292057de85d669690
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64960
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-23 19:43:13 +00:00
Ben Clayton c19329c832 CMake: Only require SPIRV-Cross when enabling OpenGL backend
Change-Id: Ie6be1301c3f2f9877a9dfb04ab5025559b90d926
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64741
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-23 19:24:43 +00:00
Ben Clayton 999cc24209 Fix all GCC 10 warnings
Change-Id: Ibabab265e734a4a421a38ab586e7e11905fa5da1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64740
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-23 17:34:53 +00:00
Ben Clayton e0da9ffedd .gitignore: Prefix ignored root directories with '/'
If this prefix is omitted, then any subdirectory that matches the pattern will also be ignored.

Change-Id: I09b2629156416c26f885d765f88e69be236b7d3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64745
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-23 10:48:19 +00:00
Ken Rockot ebf183bde4 Implement drawIndexedIndirect validation
Every render pass which invokes DrawIndexedIndirect, either directly or
through a RenderBundle execution, is now preceded immediately by at
least one validation pass.

All indirect buffer offests used with DII are validated, and their
validated values are copied into a separate scratch buffer (or zeroed
out there, in the case of validation failure). All encoded DII commands
are rewritten to use the validated parameters instead of the original
ones.

Bug: dawn:809
Change-Id: I5eead937f19536f84f89e2c8e6fed7f18f0aee9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63461
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-23 00:15:19 +00:00
Dawn Autoroller 95cfd263ab Roll Tint from a617d0f0fc to 5e6d4577fd (1 revision)
https://dawn.googlesource.com/tint.git/+log/a617d0f0fccc..5e6d4577fdc6

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: kainino@google.com
Change-Id: I5dcf13f5127be2af9842fd4198a1369d867722bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64861
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-22 20:44:01 +00:00
Dawn Autoroller da7756cc3d Roll Tint from 28d6763ef8 to a617d0f0fc (1 revision)
https://dawn.googlesource.com/tint.git/+log/28d6763ef8e3..a617d0f0fccc

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: kainino@google.com
Change-Id: I548f7d006426853264d8cf0d5886f7e9e44cd7cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64860
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-22 15:32:20 +00:00
Austin Eng 1bca15969e Add dawn_native unittests for Limits
Adds some unittests for Limits to dawn_unittests.
Statically links dawn_unittests against dawn_native
to access the internals. Additional tests for dawn_native
can now be added to dawn_unittests as well.

Bug: dawn:685, dawn:1105
Change-Id: I1e67c2f673e43d0e07693f3a50920129f135440e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64780
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-09-22 14:50:30 +00:00
Jiawei Shao f84e7b4eda Remove prefix 'm' on mCreateInfo in ComputeVertexInputDesc
This patch removes the prefix 'm' on the local variable 'mCreateInfo'
in Vulkan::RenderPipeline::ConputeVertexInputDesc() in case we may
misunderstand that it is a member of Vulkan::RenderPipeline.

BUG=dawn:529

Change-Id: Ifa3302a58a88f9628f09787977b5157fb55f9c55
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64841
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-22 09:25:05 +00:00
Li Hao a10f5331f2 Update destinationOffset alignment to 256 in resolveQuerySet
From macOS 11+, Metal requires the minimum buffer offset alignment to be
256 bytes. We have updated the destinationOffset alignment of
resolveQuerySet to 256 in SPEC. This PR is changing the implementation.

Bug: dawn:940
Change-Id: Ie3c69d6a90adb76038dbac95ae2158a38da583f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63762
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-22 02:51:20 +00:00
Dawn Autoroller c9c366e825 Roll Tint from 1d81f83704 to 28d6763ef8 (5 revisions)
https://dawn.googlesource.com/tint.git/+log/1d81f8370458..28d6763ef8e3

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: dawn:1041
Tbr: kainino@google.com
Change-Id: I7284a4c983434cff88be146d19aaa8d2973c4960
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64800
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-21 22:42:16 +00:00
Peter Kasting a928047b89 Force -Wno-shadow to avoid variable shadowing warnings.
Long term, ideally, these would be fixed and this flag can be removed.
For now, this is an expedient way to allow enabling -Wshadow in
Chromium.

Bug: chromium:794619
Change-Id: Idd3b6eaf61cc6e2a32eecf94d6cc6a41afb5f4eb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64761
Auto-Submit: Peter Kasting <pkasting@google.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-09-21 18:08:10 +00:00
Kai Ninomiya 7d174a1eff dawn.json changes to match upstream webgpu.h
Bug: dawn:1080
Change-Id: Icc77f8ccd5a07162d0e7795d7160d936f9c33e49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64620
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2021-09-21 17:36:27 +00:00
Dawn Autoroller edeb54abf3 Roll Tint from d1c6f83341 to 1d81f83704 (1 revision)
https://dawn.googlesource.com/tint.git/+log/d1c6f8334168..1d81f8370458

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: kainino@google.com
Change-Id: Idf57a2ae759fc7e5234c5cbfcdaf6a558a8091b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64760
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-21 15:59:53 +00:00
Kai Ninomiya 92d6e53e6d Fix CMake build failures after recent changes
- https://dawn-review.googlesource.com/c/dawn/+/62580
  Don't add_library for targets that just generate files.
- https://dawn-review.googlesource.com/c/dawn/+/64420
  Add missing file.

Build tested locally, on macOS (only).

Bug: dawn:1080, dawn:809
Change-Id: Ia07d040dd5d3f57aa422765270c961ea6e79e3cd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64702
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-21 01:07:35 +00:00
Austin Eng 73d7c841fd Default initialize DeviceDescriptor in DawnTest.cpp
Bug: dawn:1120
Change-Id: I6cd2e9072e3579891793d2a352421a14d5ed0b89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64662
Auto-Submit: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2021-09-20 23:47:55 +00:00
Dawn Autoroller 72c5c026f0 Roll Tint from ddc9eb2b85 to d1c6f83341 (2 revisions)
https://dawn.googlesource.com/tint.git/+log/ddc9eb2b859e..d1c6f8334168

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: kainino@google.com
Change-Id: Ie354de26fbf37123764a99e3816d671313bc0d5d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64666
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-20 21:08:45 +00:00
Austin Eng 1c85de6888 Clamp limits to the defaults if they are worse than the defaults
Bug: dawn:685
Change-Id: Ibae70390fae1d9bde2b625edf7de17e6aafb9cda
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64603
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-20 20:58:46 +00:00
Ken Rockot 44d729fc8c Introduce BufferLocation
This is a simple RefCounted holder of a Buffer ref and offset. Encoded
commands can store a ref to this object instead of directly storing an
inline Buffer ref and offset, allowing other commands to dynamically
patch in a different buffer+offset as needed, in a memory-safe way;
as opposed to e.g. retaining an unmanaged pointer to the encoded
command itself and modifying it in-place.

Validation commands will use this to rewrite buffer references in
encoded commands, so that they execute over validated inputs rather
than over their original client-provided inputs.

No net functional changes in this CL, just some groundwork for indirect
draw/dispatch validation.

Bug: dawn:809
Change-Id: I0570521a610fe3ea08190a525b4904749d7b7f24
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64420
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
2021-09-20 20:39:15 +00:00
Ken Rockot 6237c8a121 Introduce WriteBuffer command
This command copies data from host memory into a GPU buffer. It's
analogous to Queue::WriteBuffer, but executed in the context of a
command buffer, sequenced with other encoded commands. This is useful
for supporting a notion of a shared scratch buffer, with a single
allocation whose contents may need to be overwritten with new data
before each pass that uses it.

Bug: dawn:809
Change-Id: If58d49c52a41127e2980dd626fd687eb1c91fe28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64001
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
2021-09-20 19:25:05 +00:00
Austin Eng 1a965ab7f8 Update dawn.json to new schema for newly added structs
extensible: true -> extensible: "in"
Change-Id: I2aa63df0bcbfb61c4844f871606a57a90192b270
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64661
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-09-20 18:19:55 +00:00
Dawn Autoroller 3075c681ec Roll Tint from 871570bc7b to ddc9eb2b85 (1 revision)
https://dawn.googlesource.com/tint.git/+log/871570bc7b7d..ddc9eb2b859e

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: kainino@google.com
Change-Id: I6964ecf99e1d528ae0823aff1577fae2566f31dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64640
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-20 16:11:55 +00:00
Austin Eng 0c82405aca dawn.json: chained/extensible must be "in" or "out" or false
Bug: dawn:685
Change-Id: I0e63f6f8bfb3edb8e727670ecc2453841f3da513
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64602
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-09-20 16:07:25 +00:00
Kai Ninomiya 39046f36d7 Tweak JavaScript formatting of compressed formats
Fixes the library_webgpu_enum_tables.js generation for the BC formats.
ETC2 and ASTC are not in the spec yet, so I took a guess at how those
would be formatted.

Bug: dawn:501
Change-Id: Icee5f1db039c1b401082676dab3020dda21da8bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64525
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-17 23:12:55 +00:00
Kai Ninomiya 4e37accdbb Add new items for Emscripten/webgpu-headers
Generates the exact upstream headers, except for a few Dawn and upstream
changes that have landed since I started this CL, and the "_TODO"s about
extensibility of compilation info/message.

Bug: dawn:1080
Change-Id: I2a6128a3e78cfef7b9f8feae84b7c7c207eb2826
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62861
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-17 21:13:33 +00:00
Kai Ninomiya 930e9186a6 Generate multiple variants of webgpu.h header
Adds a "tag" system so that entries of dawn.json can be conditionally
emitted in different configurations. With a few more dawn.json changes,
this will enable generating the exact upstream header.

Bug: dawn:1080
Change-Id: I3506dadd485e31786578a3a64c3603c964c5354f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62580
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-17 19:44:43 +00:00
Michael Tang 0a4cb8d859 D3D12: Move transform/FirstIndexOffset outside of TranslateToHLSL
This is a minor refactor that runs transform/FirstIndexOffset in a
separate pass, outside of TranslateToHLSL. It should be functionally the
same as what currently exists.

This is to prepare for creating pipeline cache keys based on the WGSL.

Bug: dawn:1103
Change-Id: Ifc516079bafe2449d422f8bd8485b2459cd3d181
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63224
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
2021-09-17 19:23:33 +00:00
Kai Ninomiya fa9ca4482a Stub out depth16unorm texture format
Allows us to match the upstream header's format list more closely.

Bug: dawn:570
Change-Id: Iee5c6c0e45ab81fa335c3d8e63d8b2c5c455d26c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64522
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2021-09-17 18:25:53 +00:00
Austin Eng 2e48f011b0 Add an option for the Adapter to use tiered limits
Does nothing right now since Dawn always exposes the default limits.
In the future, setting useTieredLimits to true will bucket the
exposed adapter limits to minimize fingerprinting surface.

Disabled by default for native applications, but Chrome will always
enable it.

Bug: dawn:685
Change-Id: I0ecfefc93f7a554f8f8be7906cef9fa8d4745ac2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64524
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-09-17 17:24:44 +00:00
Corentin Wallez c389182758 Remove readonly storage textures
Bug: dawn:1025

Change-Id: I1759639142589470e278b4906d9cad5cb485f9a5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63743
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
2021-09-17 17:07:43 +00:00
Yunchao He a6394ddc07 Fix a few comments in RenderPassDescriptorValidationTests.cpp
Note that all validation rules for RenderPassDescriptor (including
color attachments and depth/stencil attachemt) in the spec have
already been covered in the validation tests.

Bug: dawn:485

Change-Id: I8741b53677876515fe0f90f5db1e05728ef1a452
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64521
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2021-09-17 16:40:13 +00:00
Corentin Wallez bd04e15890 Remove deprecated APIs
Bug: None
Change-Id: I77ac6660318bef1f9a245b3aee06a8e89a67e518
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64540
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-09-17 16:05:40 +00:00
Dawn Autoroller 92de2f0851 Roll Tint from dad26395d8 to 871570bc7b (1 revision)
https://dawn.googlesource.com/tint.git/+log/dad26395d829..871570bc7b7d

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC shrekshao@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: shrekshao@google.com
Change-Id: I0f3e26a654f4fbe553251bb33ce325dc343f41d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64560
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-17 15:51:02 +00:00
Austin Eng bffc966f17 Add wgpuDeviceGetLimits. Split Required/Supported limit structs
Bug: dawn:685
Change-Id: Ibb5dd0479f5e887d4b2ca864c014ebaafb674dba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64443
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-09-17 15:36:00 +00:00
Jiawei Shao 4ecfc58777 D3D12: Support creating render pipeline asynchronously
This patch implements the asynchronous path of CreateRenderPipelineAsync
on D3D12 backend.
1. Call the constructor of dawn_native::d3d12::RenderPipeline in main
   thread.
2. Execute dawn_native::RenderPipelineBase::Initialize() (a virtual function)
   asynchronously.
3. Ensure every operation in dawn_native::d3d12::RenderPipeline::Initialize()
   is thread-safe.
4. Save all the return values (pipeline object or error message, userdata, etc)
   in a CreateRenderPipelineAsyncWaitableCallbackTask object and insert this
   callback task into CallbackTaskManager.
5. In Callback.Finish():
- Insert the pipeline object into the pipeline cache if necessary
- Call WGPUCreateRenderPipelineAsyncCallback

This patch also removes FlatRenderPipelineDescriptor as it is not needed
right now.

BUG=dawn:529
TEST=dawn_end2end_tests

Change-Id: I7fd30339ab7bea599c483dea4bd1100359982409
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64440
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-17 07:39:00 +00:00
Shrek Shao 110cac1d09 Add buffer_mapping.md in docs
Make a md doc placeholder for buffer mapping.
Linking the google doc now.

Change-Id: I085e10474148fdb2a710655cc5115f8fc2b4b5b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64523
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2021-09-17 01:50:00 +00:00
Dawn Autoroller 9a827cbe7e Roll Tint from d1d99bc7de to dad26395d8 (1 revision)
https://dawn.googlesource.com/tint.git/+log/d1d99bc7dec1..dad26395d829

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/tint-dawn
Please CC shrekshao@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Tbr: shrekshao@google.com
Change-Id: If68a171d3e3699c84234cbd9461506fa3bb3cd52
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64441
Reviewed-by: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Dawn Autoroller <dawn-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-16 14:35:16 +00:00