Commit Graph

398 Commits

Author SHA1 Message Date
Zhaoming Jiang 7ca82ac4d0 dawn: Refactor device creation and add shader-f16 feature
This CL modifies the way adapter creating devices, adds `shader-f16`
feature, and deprecates the `dawn-shader-float16` feature which is no
longer used.
Details:
1. Parse the toggles chained with device descriptor in
`adapter::CreateDeviceInternal`, which are then used to validate
features requirement within `CreateDeviceInternal` and passed to device
constructor as initializer.
2. When creating device, validate features requirement in
`CreateDeviceInternal` with toggles known, make sure to fail the device
creation if a required feature is not supported by adapter or is guarded
by certain toggles which were not enabled/disabled. Feature ShaderF16
and ChromiumExperimentalDp4a are validated in this way. Unittest is
added to check creating devices with toggles-guarded features required.
3. Add `shader-f16` feature, which allow `using f16;` in WGSL code.
End-to-end tests are added to test a trival f16 WGSL shader could be
used if and only if the device has `shader-f16` feature.
4. Deprecate the `dawn-shader-float16` feature, which will be completely
removed after cleaning up Blink code.

Bug: dawn:1510
Change-Id: I6cb2dcbe1ee584fdd6131c62df1ee850b881dbd2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100802
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-09-08 00:11:04 +00:00
Brandon Jones 567f06849b Add the "internal" error type
Currently only raised if Tint produces an Internal Compiler Error
(ICE). These were previously surfaced as validation errors.

Bug: dawn:1531
Change-Id: I9a10549b3e0bc2cbf962c99d157aa6dbe8032a3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101500
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-09-07 14:14:14 +00:00
Brandon Jones 2b0fce7071 Revert "Implement maxBindingsPerBindGroup limit"
This reverts commit 4d67a883b6.

Reason for revert: Seems to be causing MSAN issues with the Dawn/Chromium roll?

Original change's description:
> Implement maxBindingsPerBindGroup limit
>
> Bug: dawn:1523
> Change-Id: Ifcf83f6836a5d7ed447080ccb033e4163970432e
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100706
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Brandon Jones <bajones@chromium.org>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:1523
Change-Id: I757457089be6af18dfce7f64c0da5d310351cece
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101401
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-09-06 17:38:03 +00:00
Brandon Jones 4d67a883b6 Implement maxBindingsPerBindGroup limit
Bug: dawn:1523
Change-Id: Ifcf83f6836a5d7ed447080ccb033e4163970432e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100706
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-08-31 17:01:58 +00:00
Loko Kung 3a53edcf18 Promote LoseForTesting to ForceLoss device so that user agents can use.
Bug: chromium:1356738
Change-Id: I348837ad4224124d9adba1ecf69a05b2060760c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100566
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-08-29 22:33:50 +00:00
Austin Eng bf3243568c Add DeviceBase::APIGetAdapter
Adds a way to query the adapter from a device. Only valid in Dawn Native.
Returns a new reference to the caller. The caller is responsible for
releasing it.

This is needed so in Chrome, SharedImage can query the WGPUAdapter from
the WGPUDevice, and then WGPUAdapterProperties may be queried from the
WGPUAdapter.

Change-Id: I719a8728eff06ab7a22be3db5fb5cfd2ebb2f0f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99703
Reviewed-by: Zhenyao Mo <zmo@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-08-18 18:02:00 +00:00
Shrek Shao 9ec183ed9f Update VertexStepMode::VertexBufferNotUsed jsrepr to undefined
As suggested in an emscripten update,
VertexStepMode::VertexBufferNotUsed will be undefined in jsrepr
in generated files.

Bug: dawn:1000
Change-Id: I3ad96f66f2965d6aa589174225eee538ec97d060
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97900
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-08-01 23:03:14 +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 256e026f64 dawn: Add Device::CreateErrorTexture(desc)
This will be used by Blink to create error textures with correct
reflection information exposed to JavaScript.

Bug: chromium:1345736
Change-Id: I0bc3a72d602c1bb57dc76e90f4883951f86ef428
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96681
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-07-20 16:07:44 +00:00
Austin Eng 8d73198aca Remove depth-clamping and add depth-clip-control feature
Fixed: dawn:1178
Change-Id: I251a7e05fec9ecef44300d4f948b2d0611888109
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96320
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-07-18 20:38:05 +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
shrekshao a3f4a32022 Add clear alpha to one step to copy texture for browser
Bug: chromium:1331139
Change-Id: I69c31aea0320f302be686adf0167649a98db3414
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95682
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-07-11 18:11:14 +00:00
shrekshao c6cbcdb05b Add internal usage for copyTextureForBrowser
Add an internal usage option for copyTextureForBrowserOption
allowing internal calls from call to use canvas context
texture as source/destination.

Bug: chromium:1331139
Change-Id: Ida8421b3962a6434e8ef57c581c7a2e1d607954c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94985
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-07-11 18:11:14 +00:00
Takahiro 831296debc Implement RenderPassDescriptor.maxDrawCount
Bug: dawn:1465
Change-Id: I6b0aab25ec7a48a6521e4e7f52e42d6890ae2013
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94821
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
2022-06-30 04:19:42 +00:00
Yan,Shaobo 7ce3c2da35 Add Device.CreateErrorExternalTexture()
Creating GPUExternalTexture from destroyed device should return
an error external texture instead of a valid one. Adding this API
for such usage.

Bug: 1336713, 1338182
Change-Id: Ie7d13811a9c1e8890ba91045c88af63f3fb09687
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94534
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-06-27 02:57:40 +00:00
Brandon Jones 431c7a4f66 Add maxInterStageShaderVariables Limits
Will statically report the base limit of 16 for now. Important to note
that this is not validated properly within Tint at this point, and the
current constant associated with this limit is actually 15.

Bug: dawn:1448
Change-Id: I74a5815cc34439ccc3b6ff9cd0afbc56590148fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94661
Commit-Queue: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-06-24 17:30:29 +00:00
jchen10 ef62b58cf9 Skip Gamma and Gamut conversions for BT.709->SRGB
This introduces a new field 'doYuvToRgbConversionOnly' in
ExternalTextureParams to have the WGSL only do yuv->rgb conversion for
better performance. User studies shows that users don't really care
about the Gamma difference between 2.4 and 2.2.
https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/color_space.cc;l=1022;drc=a1dbb594a6741a400db35fe3678e77bad2504ea4

Bug: dawn:1082
Bug: dawn:1466
Change-Id: I61c0fe65c5969d8a61c267c202c8dd64c259ed8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92901
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
2022-06-22 03:14:26 +00:00
Brandon Jones 6d48f573af Remove support for depth24unorm-stencil8
It was removed from the spec after determining it didn't provide any
additional capabilities beyond depth24plus-stencil8.

Bug: dawn:1454
Change-Id: Ifba62f22cd38bea88866c849c8d1754a2aa683e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92963
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-06-14 22:48:31 +00:00
Austin Eng 51d13a4fa4 Add depth-clip-control feature enum
Not implemented on any of the backends yet. The feature
has CTS coverage so tests can be enabled as implementation
is written.

Bug: dawn:1178
Change-Id: Ib0fa39346a42cbd996d3c42bf779767d159067e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93309
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-06-13 19:18:55 +00:00
Austin Eng 1faf5921c6 Delete WGPUDeviceProperties
This struct is no longer needed now that the adapter exposes
a way to query its features that works both in native and the
wire.

Change-Id: Ib0d865330f65473bb0363858a9284e630da52eb1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93340
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-06-13 16:58:27 +00:00
Austin Eng cda3d7bfa8 Add maxColorAttachments limit
Bug: dawn:1455
Change-Id: I92ceb62df46cfb54a791d53a72921e99f46bca08
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93307
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-06-13 16:48:45 +00:00
Corentin Wallez 45820ae995 Add reflection APIs for wgpu::QuerySet.
Bug: dawn:1451
Change-Id: I8bce40e4fc0c7caca3c3a4b8c385ba8a393a3f1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92662
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-06-09 10:12:13 +00:00
Corentin Wallez 736e97c5e0 Add reflection APIs for wgpu::Texture.
This requires adding a custom implementation of DeviceCreateTexture and
the Texture object in the wire client.

In dawn::native this requires the format enum separately from mFormat
which is a `const Format&` so that garbage format values can be
reflected correctly for error textures.

Bug: dawn:1451
Change-Id: I75b5635f36647f6f04dae54e92154f2b552beb64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92661
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-06-08 18:14:02 +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
Corentin Wallez 139d9c276a Remove wgpu::ExternalTextureDescriptor::colorSpace
Fixed: dawn:1445
Change-Id: I33ea40b371f9f72a36205df58f1964e083e0bf4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92247
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-06-02 13:20:40 +00:00
Enrico Galli 1ee244b3d3 dawn/native: Add support for feature "indirect-first-instance"
Bug: dawn:1197
Change-Id: I9042b2dc178dfc01201bff55a2f5e43de28d335e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90526
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Enrico Galli <enrico.galli@intel.com>
2022-06-01 06:14:07 +00:00
Takahiro f3cf19fdb2 Change wgpu::VertexStepMode::VertexBufferNotUsed enum value
When wgpu::VertexStepMode::VertexBufferNotUsed enum that must
be set to empty vertex buffer slots was introduced its value
was temporarily set to zero to pass some CTS tests by making
the use of zero-initialization without any change in Blink.

We applied a patch to Blink to explicitly set
wgpu::VertexStepMode::VertexBufferNotUsed to empty vertex
buffer slots so we can set the enum value to non-zero.

("Undefined") Zero enum value should be used as the
default as specified in JS" so the APIs match more closely.
The default vertex step mode in VertexBufferLayout is
"vertex" then wgpu::VertexStepMode::VertexBufferNotUsed enum
value shouldn't be zero.

Bug: dawn:1000
Change-Id: Iffbc96d4c4e032673faa37894998e4e9944c3ba8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91920
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-31 17:24:49 +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
Takahiro d42a809e8c Record zero-attribute vertex buffer when creating render pipeline
Currently Dawn ignores all zero-attribute vertex buffer in the given
pipeline descriptor when creating RenderPipelineBase because
zero-attribute vertex buffer is treated as unused slot, however the spec
doesn't state that zero-attribute vertex buffer should be ignored.

To support zero-attribute vertex buffer, this commit has the following
changes.

1. Add VertexBufferNotUsed enum value to wgpu::VertexStepMode to
   represent unused slots
2. Ignore VertexBufferNotUsed  step mode buffers when creating
   RenderPipelineBase and add tests to check it
3. Record zero-attribute vertex buffers when creating RenderPipelineBase
   and add tests to check it
4. Fix VertexStateTest::LastAllowedVertexBuffer broken by the above
   changes

Temporarily we set the enum value of
wgpu::VertexStepMode::VertexBufferNotUsed to 0 to pass the CTS tests
because currently empty vertex buffer slots step mode can be
zero-initialized. We will make a CL to Blink to explicitly set
wgpu::VertexStepMode::VertexBufferNotUsed for empty slots and change
the enum value to 2.

Bug: dawn:1000
Change-Id: Ibd4ab87f2c922e8e460f2311547f13d58f1d5611
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89340
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Takahiro <hogehoge@gachapin.jp>
2022-05-26 01:26:34 +00:00
Brandon Jones 136a0a4269 Change External Texture YUV-To-RGB Matrix To Be Optional
Changes the yuv-to-rgb constant matrix to be optional during external
texture creation because it is not necessary for single-plane scenarios.

Bug: dawn:1082
Change-Id: I543f4009e58f1571b0be80abb6b464b2b8c9d749
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91280
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2022-05-24 01:41:43 +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
Jiawei Shao 9ebba367e8 D3D12: Support feature chromium_experimental_dp4a
Bug: tint:1497
Test: dawn_end2end_tests
Change-Id: I57d5c06c15c0c366c7cc239426e5eee3a7237101
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90028
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-05-20 08:21:00 +00:00
Brandon Jones e61a390b31 Make External Texture ColorSpace Conversion Configurable
Changes external texture creation to use constants provided by Chromium
instead of hardcoded values.

Bug: dawn:1082
Change-Id: Icfe58f5585732b1e66d2faa50d3aee4a8c53bf84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89703
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-19 17:44:29 +00:00
Brandon Jones cf4a85e249 Add External Texture Conversion Constant Params
Adds parameters to ExternalTextureDescriptor for configurable source
and destination transfer functions, gamut conversion matrices and
yuv-to-rgb conversion matrices.

Bug: dawn:1082
Change-Id: I3b329d645fe113af512b5afb958e271b9bfc4ec4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88403
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-02 20:37:28 +00:00
Shrek Shao 573713ab15 Add LoadOp back to emscripten gen bits headers
Change-Id: Iacfceb9785ff04f3b4774cc3eeb4d4c4d1f46591
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88466
Auto-Submit: Shrek Shao <shrekshao@google.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-04-30 00:12:25 +00:00
Shrek Shao 286061d810 Update default value for map range size to WGPU_WHOLE_MAP_SIZE
Bug exposed by emscripten webgpu binding issue.

It seems the spec updated after the last code updates. Update the
validation part a bit (introduce rangeSize).

Bug: dawn:1400
Change-Id: I0ddefd5c1a0976cc34102a44514bccd70f7a1ac0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88080
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-04-29 18:12:17 +00:00
Brandon Jones 3daebe896f Deprecate dispatch* in favor of dispatchWorkgroups*
In https://github.com/gpuweb/gpuweb/pull/2689 both dispatch and
dispatchIndirect were renamed to dispatchWorkgroups and
dispatchWorkgroupsIndirect in order to clarify the meaning of the
arguments.

Change-Id: Iadb9d8b60c43445a69f9c569fba2340b5dca95a9
Bug: dawn:22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88364
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-04-29 17:51:54 +00:00
Brandon Jones 8085367233 Enable Queue, Device labels to be set. (Take 2)
Queue labels can be set by the defaultQueue.label member of the device
descriptor or the setQueue method.

Device labels can be set label member of the device
descriptor or the setQueue method.

D3D12 and VK backend label support included.

Bug: dawn:1323
Change-Id: Ic44f1fac268c20d5338220eaf959d949a5f66536
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85843
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-04-12 03:28:40 +00:00
Ryan Harrison 8d9d132f7c Revert "Enable Queue, Device labels to be set."
This reverts commit 0126761de8.

Reason for revert:
Causing Dawn->Chromium roll to fail

BUG=dawn:1346

Original change's description:
> Enable Queue, Device labels to be set.
>
> Queue labels can be set by the defaultQueue.label member of the device
> descriptor or the setQueue method.
>
> Device labels can be set label member of the device
> descriptor or the setQueue method.
>
> D3D12 and VK backend label support included.
>
> Change-Id: Id12dd6e1fc8f1519c55e4efb35e1ead67c085e46
> Bug: dawn:1323
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85540
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Brandon Jones <bajones@chromium.org>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:1323
Change-Id: I62e4b508d2c55fd89f2f4c5cbe5d04d22681aeef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85700
Reviewed-by: Brandon Jones <bajones@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-05 22:09:43 +00:00
Brandon Jones 0126761de8 Enable Queue, Device labels to be set.
Queue labels can be set by the defaultQueue.label member of the device
descriptor or the setQueue method.

Device labels can be set label member of the device
descriptor or the setQueue method.

D3D12 and VK backend label support included.

Change-Id: Id12dd6e1fc8f1519c55e4efb35e1ead67c085e46
Bug: dawn:1323
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85540
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-04-02 04:45:41 +00:00
Austin Eng 8e02ebf6c6 Implement WGPUTextureDescriptor.viewFormats and sampling reinterpretation
Reinterpretation for render/resolve attachments not yet implemented.

Bug: dawn:1276
Change-Id: I43d73ce5c943c4ba49df06c6865867f378f2de25
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84280
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-31 03:53:04 +00:00
Corentin Wallez aa0731d21c Updates for upstream webgpu.h
- Adds SurfaceDescriptorFromXcbWindow
 - Adds ShaderModuleCompilationHint (and ShaderModuleDescriptor::hints)

Bug: dawn:22
Change-Id: I68089801f59c0eeff4ba7fcf513044196ca9e51c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84201
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-21 17:11:53 +00:00
Corentin Wallez eee3449499 dawn.json: Update with recent WebIDL changes for upstream headers
Under the tag "upstream" this commit:

 - Adds TextureDescriptor::viewFormats
 - Adds MipmapFilterMode and uses it in SamplerDescriptor
 - Adds DeviceDescriptor::defaultQueue that's a newly introduced
   QueueDescriptor.
 - Rmove signalValue from Queue::OnSubmittedWorkDone

Bug: dawn:1322
Bug: dawn:1323
Bug: dawn:1276
Change-Id: I6c2923a0672f16c8dc06f927405042f2c80f00fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83821
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-16 18:44:16 +00:00
Shrek Shao 5b9b9867cd Rename SurfaceDescriptorFromXlib -> SurfaceDescriptorFromXlibWindow
As suggested by
https://github.com/webgpu-native/webgpu-headers/pull/150#discussion_r822311773

Bug: none
Change-Id: I4f611a1c345eb644168cf923c6c0c1672114b9d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83201
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-09 19:04:21 +00:00
Austin Eng 74d4e53fc6 Make loapOp/storeOp undefined valid
It is valid for depth/stencil attachment if the attachments are
readonly. It is not valid for color attachments. Make the enum valid,
and update validation.

Caught in CTS roll
https://chromium-review.googlesource.com/c/chromium/src/+/3499286

Bug: dawn:1269
Change-Id: Ib849ed757ccca145f85cadea6f92a1f2a5082d49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82540
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 18:43:51 +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
Shrek Shao b0987d6e46 Deprecate clearColor, clearDepth, and clearStencil in dawn.json
Need to mark them as deprecated to remove from webgpu headers.

Bug: dawn:1269
Change-Id: I332e7e4f6a27efd05f4e97240044efb65644cc77
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82940
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-07 19:29:54 +00:00
Shrek Shao 6d205fcb5d Allow sparse color attachments
Add implementations and related tests reflecting the spec update.

Bug: dawn:1294
Change-Id: I2c20af313259e1d6d6049189cb8adebe4c2436af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81922
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-05 01:34:02 +00:00
Li Hao 131c422489 Add timestampWrites on render/compute passes
The timestampWrites in render/compute pass descriptor store the
timestamps at the beginning and end of passes, this requires validating
all timestampWrite members in BeginXxxPass and inserting the
timestampWrite cmd as close as possible to the BeginXxxPass and
EndXxxPass. To do that, we first record only the querySets and
queryIndexes that need to be used in BeginXxxPassCmd and EndXxxPassCmd,
then insert timestampWrite cmd after the native BeginXxxPass and before
the native EndXxxPass in backends.

This CL adds timestampWrites in render/compute pass descriptor
including the validation and tests first.

Implement timestampWrites in backends in following CL.

Bug: dawn:1250

Change-Id: I39b50975aa03cc1afe7a736c3b39df284f54d163
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82100
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2022-03-05 01:22:52 +00:00
Loko Kung 44f039d3c2 Adds new chained struct for device creation to specify cache options.
- Adds isolation key option, DawnNative support, and relevant unit tests.

Bug: dawn:549
Change-Id: I16344581c7956ce8576c0a4c14655fbdb4e15a54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81920
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-01 22:59:40 +00:00