Commit Graph

3402 Commits

Author SHA1 Message Date
Corentin Wallez bb6997214d dawn.node: Update for attachment "value" renames.
This silences some deprecations warnings.

Bug: dawn:1123
Change-Id: Ic6c12c6ad7606a85be8a17177b55a53f61d1136d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85760
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-05 12:50:13 +00:00
Austin Eng e8498e7f04 Validate texture view format is supported
Fixed: chromium:1312780
Change-Id: I29f13a2df3ef1db6961a5760a6c1bb05ab3fa89b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85680
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-04 20:28:37 +00:00
Corentin Wallez 2787a4c64c Rely on Tint to validate shader IO and bindings have decorations.
This removes a little bit of noise from the reflection of shader
metadata in Dawn. Tests are added to make sure that Tint does the
correct validation (it does).

Bug: None
Change-Id: I334e7c23b723cf5b5985c9914cc9f8d79a7c0568
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85502
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-04 18:57:52 +00:00
Corentin Wallez 2f2977b728 dawn.node: Handle \0 in entryPoint names.
Bug: chromium:1215024
Change-Id: I88fd8b513fbda9b6c55575616afaa0c65882fc1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85505
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-04 16:21:32 +00:00
Corentin Wallez a2f7d02c5e Validate ShaderModule limits at pipeline creation time.
A list of errors, `infringingLimits`, is added to EntryPointMetadata.
During shader reflection, instead of directly bubbling limit errors up,
they are stored in this list and check only later during pipeline
creation.

Several ShaderModule tests are reworked to create a pipeline to check
for the validation of these limits. For the IO variable limits the tests
needed to be reworked to check for strings in the error messages because
since IO structs have to match between VS and FS, if one failed the
other failed too. (so it's no possible to target the validation of one
of these in particular)

Bug: dawn:986

Change-Id: I689e16454488d4a3c746ece53828555ed72ed561
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85501
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-04 16:11:42 +00:00
Corentin Wallez 8033af0947 dawn.node: Implement the [Clamp] and [EnforceRange] WebIDL attributes.
These are implemented by wrapping the integer types in transparent
ClampedInteger<> and EnforceRangeInteger<> structures.

Some parts of the core needed to be updated after this, either to
disambiguate conversions, or because of bugs (u32 vs u64).

To make the CTS tests checking for this pass, the errors returned when
conversion FromJS failed needed to be updated to TypeError and not just
the generic Napi::Error.

Bug: dawn:1123
Change-Id: Ife1d0baa7687e43d735a1814ec41883c49ae74a6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85640
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-04 14:46:12 +00:00
Corentin Wallez e56b5f1097 dawn.node: Check for OOB in setBindGroup's typed array variant.
Bug: dawn:1123
Change-Id: I9ded6c76d50183ff14158e573b2c1a36a1becb3a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85641
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2022-04-04 12:22:52 +00:00
Corentin Wallez e6359d6058 dawn.node: Implement writeBuffer up to spec.
Bug: dawn:1132
Change-Id: I5b088283c85305f8c8b662478a5a46169a0217fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85503
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-04 09:09:51 +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
Loko Kung c96ef43684 Updates remainder of references to old vulkan headers and removes them.
Change-Id: I7b0563a9bd3a98c08b81569be04a9c45dbb61f0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85420
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-02 03:02:40 +00:00
Yunchao He 2a87c84c56 Add end2end tests to expose buffer size error on D3D12
When we do B2T or T2B copy from/to a buffer with paddings,
D3D12 may wrongly calculate the required buffer size.

For example, if copySize = {1, 1, 2}, offset = 0, bytesPerRow =
256, and rowsPerImage = 2 (there is 1-row padding for every image),
and we are copying a non-compressed format like rgba8unorm,
the required minimum buffer size should be:
offset + bytesPerRow * rowsPerImage * (copySize.depthOrArrayLayers - 1)
+ bytesPerRow * (copySize.height - 1) + bytesPerBlock * copySize.width.
It is 0 + 256 * 2 * (2 - 1) + 256 * (1 - 1) + 4 * 1 = 516.

The required minimum buffer on D3D12 (including WARP) size is:
offset + bytesPerRow * rowsPerImage * (copySize.depthOrArrayLayers - 1)
+ bytesPerRow * (rowsPerImage - 1) + bytesPerBlock * copySize.width.
Or offset + bytesPerRow * rowsPerImage * copySize.depthOrArrayLayers
+ bytesPerBlock * copySize.width - bytesPerRow.
It is 0 + 256 * 2 * (2 - 1) + 256 * (2 - 1) + 4 * 1 = 772.

It looks like D3D12 requires unnecessary buffer storage for
rowsPerImagePadding in the last image. It does respect
bytesPerRowPadding in the last row and doesn't require storage for
that part, though.

You can verify the buffer size requirement on D3D12 backend with the
new tests via --enable-backend-validation. The validation layer
says that D3D12 requires 772 bytes but we only provide a 516-bytes
buffer, and leads to E_INVALIDARG (Error code 0x80070057) when run
mD3d12CommandList->Close() in CommandRecordingContext::ExecuteCommandList
and causes device lost.

Bug: dawn:1278, dawn:1288, dawn:1289
Change-Id: Icfb792dec60ff7444cb20b3c283709cdb165f80a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85341
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2022-04-02 00:18:00 +00:00
Austin Eng 42e76ba82a TextureView defaults and validation updates
Spec PR: https://github.com/gpuweb/gpuweb/pull/2687

Fixed: dawn:682
Bug: dawn:1276
Change-Id: Ifa8f94fa4c1a27fb40d0ccfb9f032ca4a28ed24e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84520
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-01 23:04:50 +00:00
Corentin Wallez 595e20085d Separate entry point reflection in its own function.
This allows adding as an error context the name of the entry point, and
dedents the code a little bit.

Bug: dawn:563
Change-Id: I1ea9760fc1aca506826ca7ef5a65d40f8370136d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85500
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-04-01 22:04:30 +00:00
Corentin Wallez d1cdb61aa1 dawn.node: make popErrorScope reject on validation errors.
The semantic of popErrorScope was changed from raising an exception on
validation errors to instead reject the promise.

Bug: dawn:1123
Bug: dawn:1324
Change-Id: I34322d8293e112eb2d1bfea784e2b2d6be33b604
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85506
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-04-01 18:18:22 +00:00
Corentin Wallez 359b82da43 dawn.node: Make run-cts disable disallow_unsafe_apis
Bug: dawn:1123
Change-Id: I2696dedf8249f5cfd8fe0138b7ee43e567a4ddf5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85504
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-01 17:14:56 +00:00
Corentin Wallez 60e5ab281c dawn.node: Do not expose non-WebGPU interfaces at global scope.
This remove some interfaces like OffscreenCanvas from the global scope
because dawn.node is not capable to usefully create them. The CTS
uses the absence of these interfaces to skip tests when needed.

Bug: dawn:1123
Change-Id: I6d57600ba6b41be58c541d1f8091e7e88781f04f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85364
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-01 13:11:58 +00:00
Corentin Wallez 63fe6e11cd dawn.node: Make GPUDevice.lost [SameObject]
Previously a new promise was created and new promises were never
resolved on creation, only on loss/destruction of the device. This made
the following code wait forever:

  device.destroy();
  await device.lost();

Bug: dawn:1123
Change-Id: I1e31cf9ccd466672eed4cad464c38cb9f8b3d724
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85362
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-01 12:22:36 +00:00
Corentin Wallez ecc3fe6f0f dawn_node: Implement the [SameObject] IDL attribute
This is done by moving the set up of these attributes to the place where
the wrapper objects are created, by doing:

  jsObject.DefineProperty("foo", impl->getOnceFoo());

Three alternatives that weren't chosen are:

 - Caching a weak reference to the member's Napi::Value on the wrapper
   struct, and recreate it only as needed. This is good because it
   doesn't risk using the value after it is GCed, but it can result in
   multiple calls to the getters, which could be unexpected (for example
   for GPUDevice.lost in a follow-up CL).
 - Caching a persistent reference to the member's Napi::Value on the
   wrapper struct. This calls the getter once and doesn't risk using the
   value after it is GCed. However if Javascript does something like
   `myGPUDevice.limits.device = myGPUDevice`, a cycle is created that
   the GC doesn't have visibility into, and that can't be collected.
   (the origin of the edge of the reference graph that persistent
   references make is unknown to the GC).
 - Caching the member on a hidden variable of the JS object. I didn't
   find a way to do this. The closest would have been to do
   jsObject[Symbol(...)] = cachedValue but even symbols can be retrieved
   with Object.getOwnPropertySymbols.

Bug: dawn:1123
Fixed: dawn:1144
Change-Id: I1bc82dd9d10be95bf2bdca73bdfb843bc556d2df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85361
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-01 11:39:26 +00:00
Corentin Wallez f880b2e8d5 dawn.node: Fix astc-12x10-unrom-srgb
Bug: dawn:1123
Change-Id: Ib1f278d0e74283e20ec77bd44aa802309904057e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85363
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-01 07:55:07 +00:00
Corentin Wallez 5234f46a37 Add instructions for debugging dawn.node with gdb/lldb
Bug: dawn:1123
Change-Id: I25dd0b724903a6dcce276bd7744fd12a21a9137e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85360
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-04-01 07:46:37 +00:00
Loko Kung 09100b79d0 Try to use the vulkan-headers from vulkan-deps instead of third_party/khronos.
Change-Id: Ic4af5ec86e4ea2ec404a6e32e49068fc5993d55a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-01 05:22:55 +00:00
Loko Kung c53bc6f698 Fixes cache key generation to handle binary data.
Bug: dawn:549
Change-Id: Ie6b3ceb610b362adfed96a0982d7541002660809
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84920
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-01 00:44:35 +00:00
Jiawei Shao eab5300e87 Set depthWriteEnabled to default in ExpectAttachmentDepthStencilTestData
This patch sets depthWriteEnabled to its default value (false) in the
helper function DawnTest::ExpectAttachmentDepthStencilTestData() as all
the tests can pass with depthWriteEnabled == false on the Linux Intel
bots now.

Note that previously using depthWriteEnabled == false and writing into
FragDepth will cause Linux Intel Mesa driver crash on Mesa 19.0.2.

BUG=dawn:821
TEST=dawn_end2end_tests
Change-Id: I22cc0dcdb8521fd8eae436d99a7c06167af89b09

Change-Id: Id0dd1c31099c6aafad175bde038ba9662b02a160
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85322
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-03-31 23:37:05 +00:00
Ryan Harrison 9d76aa7424 Add proxies for Tint targets used by Chromium
This will ease rolling Dawn into Chromium, once Tint is merged in

BUG=dawn:1343

Change-Id: I53fa7b82a001ab3351f5366e8e045090c0fdb49b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85380
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-03-31 19:54:15 +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
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
Austin Eng 10ec4ee7ef Disallow creating a 2D-array view on a multisampled texture
Spec issue: https://github.com/gpuweb/gpuweb/issues/2715
Spec PR: https://github.com/gpuweb/gpuweb/pull/2716

This is invalid in the Metal API because MTLTextureType2DArray is
imcompatible with MTLTextureType2DMultisample, even if the layer
count is 1.

MTLTextureType2DMultisampleArray is not supported until macOS 10.14
and iOS 14.0.

Further, the view type must match between the API and the shader.
a 2D view array requires texture2d_array in MSL.
It would be inconsistent to allow 1-layer 2D arrays which internally
get translated as (non-array) MTLTextureType2DMultisample. You would
expect to need to use texture2d_ms_array in the shader.

Change-Id: Ib9268c1276d3d31e90d6c61118e27fa2afd0617d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85200
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-31 01:26:49 +00:00
Antonio Maiorano e5474a4efc run-cts : default "cts" arg to third_party/webgpu-cts if found
Change-Id: Ia052e92d17be5ce2068a14d74b5cdc2c43cf625f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85160
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-03-30 18:42:19 +00:00
Stephen White 9be06c8d23 GL: fix clear-on-init of depth/stencil textures.
Disable the scissor test during clear.

Change-Id: Ia6945304c257867ed5cb6a6ae0c2c49998a33ca7
Bug: dawn:1340
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85143
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-03-30 10:26:44 +00:00
Brandon Jones bf0f2c1849 Stencil8 support fixups
Addressing issues that showed up after the initial stencil8 CL landed.

D3D12:
 - Selecting the `all` aspect of a `stencil8` texture was ASSERTing

Metal:
 - Using the `stencil` aspect of a `stencil8` texture was hitting an
   UNREACHABLE().

Bug: dawn:666
Change-Id: Ic2931dbb915e109727ca24e3216a661fba84e508
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85021
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-03-29 23:01:54 +00:00
Corentin Wallez 982188ac16 Rename Surface::Type::Xlib to XlibWindow for consistency.
Bug: None
Change-Id: I2750c2fc86cc893d6f124cf7d539a85458bd4105
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84761
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-29 19:32:23 +00:00
Stephen White fd41f30c0b OpenGL: refactor FramebufferTexture* calls.
Change-Id: Iee67027431d791d6425e0cc502f6b6a23bc160d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85141
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-03-29 18:52:23 +00:00
AlexVestin 1e627e23f3 Android: Fix incorrect variable name
Bug: dawn:286

Change-Id: I2ad301a243112db1cc11ef83e241eab0812a197f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85062
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-29 18:10:13 +00:00
Stephen White b5c5df50ab Implement support for depth24stencil8 on OpenGL.
Covered by existing tests.

Change-Id: Ibb6daf8cd195474560a306e830d69c484579ae1c
Bug: dawn:1338
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-03-29 16:34:23 +00:00
Corentin Wallez dad225a896 Fix last reantrant object creation.
Fixed: dawn:723
Change-Id: I9697686a3a8a8d31539c04cd3e6073744152ff68
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85120
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-29 16:13:53 +00:00
Stephen White f32ae5b680 GLES: fix texture-to-texture copy with offset src or dest region.
glBlitFramebuffer() takes min and max coordinates, not min and size.

Bug: dawn:1084

Change-Id: I7b8b53ecd9c5ade20d4d7a909bd134c13a2d960b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85081
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-03-29 16:11:34 +00:00
Stephen White 3c44ba8376 OpenGL: refactor texture allocation.
Move texture allocation in an AllocateTexture() local.

Use the GL target to determine the choice of allocation call, not
the Dawn TextureDimension. This leaves TargetForTexture() and
TargetForTextureViewDimension() as the authorities on Dawn -> GL
conversion.

Change-Id: Ia31fbba9a8e71a9ce8dd9c89676dbc51d8848bb5
Bug: dawn:593
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-03-29 12:24:16 +00:00
Corentin Wallez e690a6654a Make SwapChain use a CreateView() instead of APICreateView()
This simplifies reference management and make the swapchain's reentrant
code avoid APIEntryPoints.

Bug: dawn:723
Change-Id: I6c456b9ec349c73d783dbb12a284f322d0be4e1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84763
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-29 09:35:53 +00:00
Shaobo 8e414a140b Release D3D11on12Resource Cache after Texture::Destroy() has been called
On D3D12 backend, external texture holds mD3D11on12Resource which caches
D3D11on12Resources and guarding by refptr. The texture will released this ref
until destructor works.

This model leaks the gpu memory if client fails to release all the ref to
the texture.

Instead, external texture also provides a method called "Destroy". It is
called more eagerly and means the external texture is in the end of lifecycle.

So thid CL moves the ref reset of D3D11on12Resource into Destroy(). This prevents
unexpected gpu memory leak caused by client missing ref release call.

Bug: 1308405
Change-Id: I253e1eda192256e4bd1c470e26dcc6af3c234447
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-03-29 08:14:53 +00:00
Corentin Wallez e055ae5b52 Make reeantrant creation calls returning Ref for command encoding.
Fixed: dawn:723
Change-Id: I953e0aa7d663f68e15c021448a90ecf799fef891
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84766
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-29 08:10:03 +00:00
Corentin Wallez 46d5480d20 Metal: Add ASTC and ETC2 texture compression support.
Fixed: dawn:1176

Change-Id: I7655ef98151a1bb78d23be0357a68cdd90e5078a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84481
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-29 07:58:23 +00:00
Corentin Wallez fc1a2ae904 dawn_node: Implement requesting limits
And reject the device creation promise with an error that looks like an
OperationError to make the CTS happy.

Bug: dawn:1242
Change-Id: I43ec3ebc030cb4178520c9174e164a42b94f6bf8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85060
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2022-03-29 07:45:03 +00:00
Loko Kung b8a4f34ed9 Enables device.destroy API now that CTS tests have been implemented.
Bug: dawn:628
Change-Id: I52e9c2d04c605b64a5fd80762891fc44e2c2c53a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84921
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-29 01:23:22 +00:00
Brandon Jones 8fa1eaf840 Better errors for incompatible attachment states
Now the message will report the details of both the expected and
incompatible attachment states, helping developers see what the source
of the error was.

Bug: dawn:563
Change-Id: I58eea166cb2da634f0295fb4660c982f96c62a2d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84940
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-03-28 20:07:16 +00:00
Ben Clayton 6f8ff744da dawn/node: Fetch and use node 16.13
Fixed: dawn:1329
Change-Id: Ifbc97961f1cafa804908d24d61da72ce0f59dae0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85061
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-03-28 19:55:42 +00:00
Corentin Wallez ac0f60c307 Fix one APICreateBuffer use in CommandBufferVk.
Bug: dawn:723
Change-Id: I48c1c2594ee8b86dfe11b5dcaedcdd8170868def
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84765
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
2022-03-28 18:47:02 +00:00
Corentin Wallez 45b4893326 Remove TODOs that BGLD3D/Vk need updates for external textures
External textures are handled purely in the frontend so there is no need
to update the backend BGL to handle them. The TODOs can just be removed.

Bug: dawn:728
Change-Id: I319cf2a79bdc06a1457f3ec5746b07b5d05eef62
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84767
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
2022-03-28 18:38:14 +00:00
Shaobo 0a6c2b0f99 Wrap multiplanar iosurface in wgpuTexture
This CL supports wrapping multiplanar iosurface in wgpuTexture.
It also provides mechanism to create TextureView on each planes.

Bug:1307194

Change-Id: I5e82f47944fdea542abba097240c880628b1181f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81482
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-03-28 06:59:22 +00:00
Brandon Jones 2977100ee1 Format texture sample types and aspects in errors
Should help make a couple of previously ambiguous error messages clearer
for developers.

Bug: dawn:1259
Change-Id: I09a4598153d3340407c5a318dcf6be6d03efd2bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84780
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-26 01:44:16 +00:00
Stephen White 57b7db9c74 OpenGL: refactor texture-to-texture copies into UtilsGL.
Change-Id: I6210b192c0676dacecc0d0b1026905b31e869d72
Bug: dawn:593
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84440
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-03-25 17:29:57 +00:00