Commit Graph

2963 Commits

Author SHA1 Message Date
shrekshao e99ad765ae Overridable constants vulkan implementation and tests
Add vulkan backend implementations and tests.
Disabled some tests that fail due to tint missing
features and issues.

Bug: dawn:1041, tint:1155
Change-Id: Iac161317450cff59627e08b1228bffde4cef71da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64981
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-28 20:15:52 +00:00
Ben Clayton 5d1613db8e dawn_node: Fix Converter<Napi::TypedArrayOf<T>>::FromJS
The conversion should only pass if the element type matches.

Bug: dawn:1123
Change-Id: I700a445e8d281afdc36d1b6f9be73767ca89d4ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65240
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 18:08:13 +00:00
Ben Clayton 5a18c2aab8 dawn_node: Add binding/GPURenderBundleEncoder.cpp
Bug: dawn:1123
Change-Id: Id2d8e77456869562a680a5bd7eb2056b1e319311
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64912
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-28 17:30:11 +00:00
Ben Clayton c6b786e0fc dawn_node: Add binding/GPUAdapter.cpp
Bug: dawn:1123
Change-Id: I5eee0036acf4db18dd103f863c4f07511a0cee25
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64917
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 16:56:31 +00:00
Ben Clayton ffcebe8c2c dawn_node: Add binding/GPUCommandEncoder.cpp
Bug: dawn:1123
Change-Id: Iadc53f1e5629fb58f12c5305cba965b1ef38ffea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64915
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 16:46:12 +00:00
Ben Clayton 334714b312 dawn_node: Add binding/GPUComputePassEncoder.cpp
Bug: dawn:1123
Change-Id: Ied735455b04f52ba214b3ef9ef41edb78d9ed6fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64914
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 16:16:41 +00:00
Ben Clayton c5d9650308 dawn_node: Add binding/GPU.cpp
Bug: dawn:1123
Change-Id: I9d962a149c4bbb0fc8749fdb77c6ad29c59f0111
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64916
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-28 16:14:21 +00:00
Ben Clayton 6104800416 dawn_node: Add binding/GPUQueue.cpp
Bug: dawn:1123
Change-Id: I629008de8b096da537737df18d7173e96d433394
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64913
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 16:07:32 +00:00
Ben Clayton c06b8132ec dawn_node: Add binding/GPURenderPassEncoder.cpp
Bug: dawn:1123
Change-Id: I0f288e1b3c19f0063f346e5801be7e07eaf1818a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64911
Reviewed-by: Corentin Wallez <cwallez@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-09-28 16:02:46 +00:00
Corentin Wallez 347a597f7d Only call WillBeginRenderPass when encoder is current
Fixes an ASSERT when a render pass is started while another pass is
already current.

Bug: chromium:1253090
Change-Id: I085c1de225f9ba30a7f368fad3b1d8a97ed92c63
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65241
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-09-28 15:55:42 +00:00
Loko Kung 8d195d511d Refactors dawn_native objects for list tracking and adds destroy skeleton API.
Adds generated headers in dawn_native for object type tracking similar to that used in dawn_wire. Splits ObjectBase into ObjectBase and ApiObjectBase for clearly differentiation, and adds virtual function to identify the type of ApiObjects. Updates error generation to utilize new object typing for generating messages.

Bug: dawn:628, dawn:840, dawn:563
Change-Id: Ia4f831fcbfb29a70ed5a35d47ed622921e744c84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64820
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-28 15:40:01 +00:00
Ben Clayton 7b04930aa0 dawn_node: Add binding/GPUShaderModule.cpp
Bug: dawn:1123
Change-Id: I0b0bd50314c656a527913d5dffa73032e6cdcdf2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64910
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 14:09:40 +00:00
Ben Clayton 05944b0f97 dawn_node: Add binding/GPUTexture.cpp
Bug: dawn:1123
Change-Id: I2858cc2b86aa9189a92a2f4a9f0988a9f7b36953
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64909
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 13:58:00 +00:00
Ben Clayton ca9bc676aa dawn_node: Add binding .cpp files for trivial types
All UNIMPLEMENTED()s are TODO.

Bug: dawn:1123
Change-Id: Ie51b807d8a2a2ba376416d77de383dd627d04a07
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64908
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 13:56:01 +00:00
Ben Clayton 118d2dd19e dawn_node: Add binding/Converter.[cpp,h]
The interop -> Dawn conversion utility class.

Bug: dawn:1123
Change-Id: I8a2a352eb730a4a528f6a0262d5b21e08d85b413
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64907
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 13:18:40 +00:00
Ben Clayton 3e5848a4de dawn_node: Add all the headers for the binding classes
Nothing includes these yet.

Bug: dawn:1123
Change-Id: Ia2178d4bc9bf2c8f8f586493568b2864063d3fc7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64906
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 13:09:30 +00:00
Ben Clayton a35156b732 dawn_node: Add binding/AsyncRunner
Used to poll a wgpu::Device with calls to Tick() while there are asynchronous tasks in flight.

Bug: dawn:1123
Change-Id: Ieee75b983df836a6df09ae4ff81f7382f4be4995
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64905
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 13:01:41 +00:00
Ben Clayton af48bbc460 dawn_node: Add binding/Errors.[cpp,h]
Errors contains static helper methods for creating DOMException error messages as documented at:
https://heycam.github.io/webidl/#idl-DOMException-error-names

Bug: dawn:1123
Change-Id: I5fcf4e146c91cde37f5514d8a4a426b17de6a701
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64904
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 11:59:10 +00:00
Kai Ninomiya 51791e0409 Add 'reason' argument to device lost callback
Breaking change, but it should only require small changes in any project
that relies on it, so just doing this instead of a two-stage deprecation.
Will require a manual roll into (at least) Chromium.

Bug: dawn:1080, chromium:1253721
Change-Id: I6699e0629c3b2fe63e7f9d5ba0a928f00316a588
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64520
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-28 11:52:17 +00:00
Ben Clayton affb7a3ab9 dawn_node: Begin working on the CMake rules
This is enough to compile the interop code. This doesn't do anything as we need to emit the NodeJS module entry point, and actually hook up the interop to the Dawn bindings.
This comes next.

Bug: dawn:1123
Change-Id: I754b4bcb0532c8446031622d8e8e64e2faaff585
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64903
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-28 11:14:42 +00:00
Ben Clayton 897cdeeb61 dawn_node: Add template files
Templates used to generate the NodeJS interop classes for the WebGPU IDL.

Also includes a stub `Browser.idl` file that provides stub definitions for browser IDL declarations referenced by the WebGPU IDL.

Bug: dawn:1123
Change-Id: I4067cb186f63436a502c3516a879ed1c5cd30731
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64902
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 10:01:02 +00:00
Ben Clayton 6d8a03e707 dawn_node: Add interop/Core.[h,cpp]
Core hand-written interop classes, which the template-generated code makes heavy use of.

There's currently no build rules for these files.
These will come in a followup change.

Bug: dawn:1123
Change-Id: Id56f96533070acc8ee581d6f44f83b5374662215
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64901
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-09-28 09:58:41 +00:00
Zhaoming Jiang 2be4b8483c Deprecate size=0 for default in setIndexBuffer and setVertexBuffer
For size parameter in setIndexBuffer and setVertexBuffer, use
wgpu::kWholeSize rather than 0 to indicate using the default
size, i.e. remaining buffer size after offset. Using size=0 is still
avaliable but will cause a deprecation warning.

Bug: dawn:1058
Change-Id: I4c4f6ca6fc7346c225815bdcd607fed110ce2b9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65020
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-09-28 02:05:00 +00:00
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
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
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 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
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
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
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 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
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
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