Commit Graph

46 Commits

Author SHA1 Message Date
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
Jiawei Shao 76eeb828c8 Align offset to 512 when writing into depth stencil textures on some platforms
On the D3D12 platforms that don't support programmable sample positions,
the source box specifying a portion of the depth texture must all be 0,
or an error and a device lost will occur. This patch adds a workaround
for this issue by alignning the offset of internal staging buffer to 512
when calling Queue.WriteTexture() with depth stencil textures

Bug: dawn:727
Test: dawn_end2end_tests
Change-Id: I6bc5843d62d0aec3964ee5b544a06c0b2657031a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98601
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-08-10 05:12:16 +00:00
Austin Eng 79ab0d38bb Refactor [de]serialization functions out of CacheKey
Storing values into the cache will need to serialize and deserialize
values in addition to keys. This patch factors the serialization
utilities out of CacheKey into a more general "Stream" utility that
supports both input and output for serialization and deserialization.

Multiple files are not renamed to make parsing the diff easier. They
will be renamed in Change If61f0466d79e7759ed32c4ddf541ad0c17247996.

Bug: dawn:1480, dawn:1481
Change-Id: If7594c4ff7117454c1ab3d0afaeee5653120add8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96480
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-07-28 23:04:31 +00:00
Corentin Wallez 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
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
Austin Eng 1b4da5d28f Vulkan: Implement WGSL->SPIRV caching
Bug: dawn:1480
Change-Id: I77facc854ce9d5fe41c2332236113f266178470a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94660
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-07-08 21:30:25 +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
Loko Kung 7289bca018 Add dawn version hash to cache keys.
Motivation is to simplify cache evicting by reusing the LRU to evict stale entries from older Dawn versions since there isn't already a simple cache busting solution. The dawn version will just be pushed into the cache keys instead so old version entries will eventually be retired.

- Removes the fingerprint from the GetCachingInterface API on DawnNative.
- Adds the "fingerprint", which was just the hash, to the device;s cache key directly instead.

Bug: dawn:549
Change-Id: I573aa03a2bb96dfe044293b1176d3a7746725572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-06-24 23:39:49 +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
dan sinclair d574be5750 Convert @stage to short form
This CL converts remaining @stage instances in the dawn tree to use
the equivalent shorter variant.

Bug: tint:1503
Change-Id: I74594cd68544fbd692f77d4646991d9c27e218f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92484
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-06-07 15:57:35 +00:00
Austin Eng 1ad896df11 Rename CachedBlob -> Blob; move to own file
Bug: none
Change-Id: I4e0ad7fe321f6ff8d0ab1ad62de3f42daea50140
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92485
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-06-03 01:13:41 +00:00
shrekshao 4313dba514 Pipeline cache D3D12 backend impl
Add D3D12 pipeline caching impl: store cachedPSO blob in cached blob.
Record root signature ID3DBlob in cache key together with
D3D_SHADER_BYTECODE, D3D12_GRAPHICS_PIPELINE_STATE_DESC or
D3D12_COMPUTE_PIPELINE_STATE_DESC.

Shader caching is not added.

Add some pipeline caching negative tests.

Bug: dawn:549
Change-Id: Id1cb560b49f1cf495860e2e0bcf92d8d988c5379
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91180
Auto-Submit: Shrek Shao <shrekshao@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-06-02 15:16:20 +00:00
Jiawei Shao 57b93b4b6b Vulkan: Support feature chromium_experimental_dp4a
This patch adds the support of the experimental feature
chromium_experimental_dp4a on Vulkan. Currently this
feature is enabled on Vulkan backend only when DP4a
instructions are hardware-accelerated.

Bug: tint:1497
Test: dawn_end2end_tests
Change-Id: I5a63111a6b5972aa1934f0e7be984ebdb1e35080
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91520
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-27 00:38:55 +00:00
Austin Eng 2066522311 Move clearing DeviceBase::mQueue from Destroy() to WillDropLastExternalRef
This member should not be cleared after Destroy() since the application
may ask for it if it still has a reference to the device.
Instead, only clear the member after the application has dropped their
last reference to the device.

Bug: chromium:1327865
Change-Id: I282482fec5db11b4c75b91ba5995d7e2599b89a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91281
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2022-05-24 07:04:25 +00:00
Corentin Wallez 84e7f68366 Validate that the device is alive when creating an ExternalTexture
Fixed: dawn:1419
Change-Id: If536978889b9c2b41e63f0035183da4c2f8fe379
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91160
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-05-20 18:05:50 +00:00
Austin Eng a526167e33 Make child objects ref the device and add a mechanism to break cycles
Update child objects to ref the device. This allows them to outlive
the device, making the implementation more robust such that it is OK
to drop the device before other objects.

Dropping the last external reference to the device is currently an
implicit device.destroy(). This destruction breaks possible ref cycles
where the device refs internal objects which have a back ref to the
device.

Bug: dawn:1164
Change-Id: I02d8e32a21dcc5f05e531bd690baac4a234b5f6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90360
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-05-20 16:57:01 +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
Austin Eng ba2b7fc9b1 Fix multiple device leaks in dawn_end2end_tests and dawn_unittests
Adds ForTesting APIs to the instance to track the number of devices.

Bug: dawn:1164
Change-Id: Ib743afb1e86ef16740d49613f43f9e2f009232bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/90583
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-05-18 13:28:21 +00:00
Corentin Wallez 4b6d3f4346 ShaderModule: Don't create an inspector just to reflect exts
Bug: tint:1472

Change-Id: Ifc170c3da531dd17015f0f36dfccfaa8e250b50c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89403
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-05-10 06:41:24 +00:00
Zhaoming Jiang d6b2501be2 dawn: Add shader module validation for WGSL extension
Tint has already implemented the enable directive for using WGSL
extension in the future, and using a WGSL extension that is not allowed
for the device should result in a shader creation error.
In this patch a WGSL extension allow list is added in DeviceBase, and
a validation is added in shader module base initialization to make sure
all extensions used in the WGSL program are in the allow list. This
patch also rename the `ValidateShaderModuleDescriptor` to
`ValidateAndParseShaderModule`, which is more descriptive for what it
actually does.

Bug: tint:1472
Change-Id: I4b039a3e37c25159b4fc6cfa37488aa817004ab2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88241
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2022-05-06 08:51:12 +00:00
Loko Kung 3b2b34f0ff Hide blob caching behind a toggle on the device for now.
Bug: dawn:549
Change-Id: If704e528166938ff9beb2b7f9f222b75fde8ec08
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88465
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-03 07:06:33 +00:00
Loko Kung d181a3cf55 Adds pipeline cache and implementation for Vulkan backend.
- Adds testing for Vulkan pipeline caching.
- Removed redundant VK_NULL_HANDLE and use explicit {} initialization for 0 handles when necessary.
- Adds some const qualifiers where applicable and useful.
- Removes overloaded GetCacheKey (const/non-const) versions and exposed the cache key member directly for modifiers in derived classes.

Bug: dawn:549
Change-Id: I5e8ab9716eebc916b813c9d032f8dc1f3f5261bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86581
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-03 00:33:33 +00:00
dan sinclair 41e4d9a34c Consistent formatting for Dawn/Tint.
This CL updates the clang format files to have a single shared format
between Dawn and Tint. The major changes are tabs are 4 spaces, lines
are 100 columns and namespaces are not indented.

Bug: dawn:1339
Change-Id: I4208742c95643998d9fd14e77a9cc558071ded39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87603
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-01 14:40:55 +00:00
Loko Kung 928a7d1e93 Fix freed memory access due to DestroyObjects.
- Use a while loop to pop the list instead of iterating it and deleting at the same time.
- Adds regression tests to verify that the fix works.

Bug: chromium:1318792
Change-Id: I84fb494c64b07d3e1bd2b5b3af7cb9f82eee28b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88043
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-28 02:54:43 +00:00
Brandon Jones d44e7b3b0a Surface D3D12 validation messages in WebGPU errors
This change ensures that when errors are raised from WebGPU, including
lost context errors, they can include any associated D3D12 validation
layer messages in the message text if backend validation is enabled.
This will allow these messages to be surfaced in places like when
running CTS tests on browser build infrastructure.

Also makes a minor adjustment to how HRESULT codes are reported so that
they're easier to read.

Bug: dawn:1396
Change-Id: Ib5c039157c57e6926bc82941a68be03e33e9084c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88044
Commit-Queue: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2022-04-28 01:06:53 +00:00
Loko Kung f92040a3d9 Remove PersistentCache and suppress shader cache tests.
- Removed to allow for easier development changes to caching interface as it is implemented for pipeline caching without having to keep supporting this incomplete feature.

Bug: dawn:549, dawn:1341
Change-Id: Id27deca45ac5607a4a6a7a016b19e3d60693ed72
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87610
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-04-27 01:25:12 +00:00
Enrico Galli 45ec7c3528 D3D12: Duplicate first/baseVertex on Draw[Indexed]Indirect
Adds support for non-zero first/baseVertex on Draw[Indexed]Indirect by
duplicating the first/baseVertex indirect parameter onto a root
constant in the indirect buffer.

Change-Id: I280149065179806d3e57b07f1a396f9e2e4e8fcb
Bug: dawn:548
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84240
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Enrico Galli <enrico.galli@intel.com>
Auto-Submit: Enrico Galli <enrico.galli@intel.com>
2022-04-21 02:25:35 +00:00
Loko Kung 6d9b322958 Adds new BlobCache "re-declaration" of PersistentCache.
- Note: goal is to merge the two into the same class, but to avoid breaking/fixing the current D3D12 shader caching, introducing a new one, and will merge the old one later on.
- Adds instance of BlobCache to the Instance, and passthrough for the Device to get to it. (We want the cache to be at the Instance so that eventually different devices can still use the cache (assuming same isolation key)).

Bug: dawn:549
Change-Id: Ib7c82a439f32b306f0cccd3db424fb0e427a90a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86400
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-20 23:56:25 +00:00
dan sinclair 13e9699b1c Fix build/include_what_you_use
This CL adds the needed headers to pass the include what you use lint
check.

Bug: dawn:1339
Change-Id: Ib8df68e51b2c3711169b400e84768d4804568580
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86941
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-20 00:58:34 +00:00
dan sinclair fb5a492787 Fix inclusive language presubmit
The current presubmit has the filter inverted so it would only attempt
to match the filtered files. The file name also has to be converted to
`LocalPath` otherwise it's attempting to compare a python object to a
string and always fails to match.

Bug: dawn:1339
Change-Id: Ie7712dee60f6b9df2cb78c9feab11769f7ea1f02
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 22:25:45 +00:00
dan sinclair b02535557e Fixup build/include_order issues in src/dawn.
This Cl moves the cpp includes to above the project includes fixing up
the build/include_order issues and enabling the lint check.

A couple includes are marked as NOLINT as the c header has to come after
the project header due to setting defines.

Bug: dawn:1339
Change-Id: Ia47499c94fff99106397b83f6c5c7fe100c44a0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86513
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-19 20:38:44 +00:00
Shaobo e4c799071b Add Debug Tracing in Dawn
Add more trace event in Dawn to better understand workflow in Dawn.
These trace events focus on tick() and MapAsync() related in flight
task.

Bug: dawn:1335
Change-Id: Iac35959f315c221c8539137efbf35039458a6f77
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86620
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-04-19 00:25:34 +00:00
Loko Kung c083d65a0c Adds device-side cache key generation.
- Note that the device-side cache key will be prepended to object cache keys to prevent incompatible adapter/device cache clashes.
- Adds a new template file to auto=generate these cache serializers based on arguments.

Bug: dawn:549
Change-Id: I24b9d11eb38c579acfcc173a5dced9e1b649cf2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86081
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-04-12 23:50:56 +00:00
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
Austin Eng f02bf9e76d Make texture view default format robust against invalid aspects
Computation of the default depends on the aspect, but the aspect
may be invalid. Make the default computation robust such that it
picks some valid aspect if a valid one is not provided. This will
make computing the default OK, but still fail validation of the
aspect later.

Bug: chromium:1314049
Change-Id: I2dcfe7962c7e30ac627605b6d0f1c269b3a6af6e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86020
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-04-07 20:20:14 +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 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
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
Austin Eng cbdde604b8 Fix ForceSetToggle to only warn when an overriden toggle is forced
The condition was partially wrong, causing lots of spurious warning
messages when the default toggle (not user override) was forced to
another value by the backend.

Change-Id: Ie69e275fa3d4ceaeb7c3379dfdc8d8cbb91cf04a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84601
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-24 16:01:55 +00:00
Loko Kung a9386f3060 Fixes popErrorScope to match the specs.
- Prepares for removal of unnecessary bool return, and just call callbacks appropriately. For now always returns true until all users are updated.
- Removes PushErrorScope from handwritten commands now that we no longer need to do anything special.
- Updates tests to reflect the change and make sure to set EXPECTs before calling functions to make tests easier to follow.

Bug: dawn:1324, dawn:526
Change-Id: I90b09c54f9adbf2d6d50ad20dcedf68b5ed0b1fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83942
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-22 14:45:34 +00:00
Brandon Jones c86f28cb84 De-duplicate ExternalTexture Dummy Textures
Avoid recreating 1x1x1 dummy textures for single-plane external texture
by just caching one and reusing it.

Bug: dawn:1082
Change-Id: Ia1fc3520a1b503d4491a256353277400ba90f344
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80462
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-03-21 19:02:53 +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
Ben Clayton 818001d32e tint->dawn: Move src/dawn_native -> src/dawn/native
Bug: dawn:1275
Change-Id: Ic60a00107a015bc677ff929c492f1085ffc38482
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79083
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-02-04 17:07:46 +00:00