When we are copying data, we need to offset "rowsPerImage" rows
for each depth slice, even though this is a partial copy whose
copy height is less than rowsPerImage.
In addition, when we copy the original data into expected buffer
for comparison, we don't pack data for T2B copy and T2T copy. We
don't remove paddings during copy. So I renames PackTextureData
to CopyTextureData. For B2T copy, we do pack data. Right now we
name it CopyXXXX and we pack the data during some copies, it is
understandable. But if we name it PackXXXX but don't pack data
sometimes, it is weird. In addition, for B2T copy, we pack the
data, so I shorten the buffer size we allocated for comparison.
This change also renames "slice" to "layer" if it includes multiple
depth slices and actually means a layer, but keep slice as slice if
it means an array layer or a depth slice for different cases.
Bug: dawn:547
Change-Id: I6d82e6c25f50bd4c988b1f65f85b24ad1c191d01
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53501
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
BUG=dawn:734
Change-Id: I37c1d2d9d468c8a3b715b30b3a6fde7e85205af9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53601
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Add timestamp query back in Metal supported extensions, and calculate
the timestamp period based on CPU timestamps and GPU timestamps sampled
on device.
There is a crash issue (dawn:545) on macOS 10.15 on AMD devices, but
cannot be reproduced on macOS 11.0+, we can just disable it on AMD with
macOS 10.15 in the following CL.
Bug: dawn:434
Change-Id: Icb4823e7c3115776e64c6a41fd0aea0f6536ccdf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51720
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
If we are copying a partial of rows, the buffer size doesn't need
to be that large of the entire image which has "rowsPerImage" rows.
There was a bug in texture copy splitter. And this workaround was
introduced at https://dawn-review.googlesource.com/c/dawn/+/30741
in order to workaround that bug. D3D12 validation is actually correct.
Now that we have fixed the bug at
https://dawn-review.googlesource.com/c/dawn/+/52680/. The workaround
is not needed.
Bug: dawn:547, dawn:520
Change-Id: I92292c71dc5479fc2ba863eb9f897516bd1a96a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53360
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Details:
- Add the logging level type WGPULoggingType, including levels verbose,
info, warning, and error,
- Add the API SetLoggingCallback, which bind the callback to deal with
logging string,
- Add the return command DeviceLoggingCallback and related code,
- Add DeviceBase::EmitLog(WGPULoggingType, const char*) , and
DeviceBase::EmitLog(const char*) use WGPULoggingType_info as default,
to post logging from native or server device to bound callback
via CallbackTaskManager.
BUG: dawn:792
Change-Id: I107b9134ff8567a46fa452509799e10b6862b8d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52200
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This patch implements the asynchronous path of CreateComputePipelineAsync
on D3D12 backend with the basic framework of the dawn_unittest
AsyncTaskTest.Basic.
1. Call the constructor of dawn_native::d3d12::ComputePipeline in the main
thread.
2. Execute dawn_native::ComputePipelineBase::Initialize() (a virtual function)
asynchronously.
3. Ensure every operation in dawn_native::d3d12::ComputePipeline::Initialize()
is thread-safe (PersistentCache).
4. Save all the return values (pipeline object or error message, userdata, etc)
in a CreateComputePipelineAsyncWaitableCallbackTask object and insert this
callback task into CallbackTaskManager.
5. In Callback.Finish():
- Insert the pipeline object into the pipeline cache if necessary
- Call WGPUCreateComputePipelineAsyncCallback
Note that as we always handle the front-end pipeline cache in the main thread,
we don't need to make it thread-safe right now.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I7eba2ce550b32439a94b2a4d1aa7f1b3383aa514
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47900
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is blocking the Tint roll which adds validation that
textureSampleCompare cannot be used in the compute stage.
Simply disabling this test for now since WGSL discussions seem to
indicate there may be a builtin added with a different name and
semantics.
Change-Id: Iaecf5865c9fb38aea3231c3ae823d783a665984d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This does no remove the existing configs, since there is a chrome
infrastructure change that needs to occur to point LUCI at the new
configs.
BUG=dawn:734
Change-Id: I33608165d27be2d61eff5ff7155386df84379fa3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53181
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This reverts commit fec575ca7b.
Reason for revert: Need to change external configs before removing old *.cfg files
Original change's description:
> Convert Dawn to use Starlark script to generate configs
>
> BUG=dawn:734
>
> Change-Id: I293d04a7b585f5ffd6e91813607ff20b1935af58
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52981
> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
TBR=cwallez@chromium.org,enga@chromium.org,rharrison@chromium.org,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I4321b1caa2a1137a8f4f9fcaa3ffd88b690345a4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:734
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53260
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
In every copy region, its bufferSize.height minus rowsPerImage
can be texture format's blockInfo.height (it is 1 for uncompressed
formats) at most, and it appears only if bytesPerRow is 256 and
copySize on height is a full copy.
This change will benefit 3D texture copy splitter via removing
unwanted empty rows issues. Because empty rows in 3D copy splitter
may lead to recompute/modify copy regions and there might be new
copy regions added.
The removed empty row situations are:
1) Partial copy on height: copySize.height < rowsPerImage *
blockInfo.height
2) bytesPerRow is greater than 512. For example, if bytesPerRow
is 512 and data in one row straddles two rows and there is no
empty row at the first part. The second part will have a fake
empty row if we don't recompute its alignedOffset.
3) There are two empty rows in a copy region. For example:
if data in one row straddles two rows and there is an empty row
in the first copy region. Then there will be two empty rows in
the copy region of the second part if we don't recompute the
alignedOffset.
This change also fixes an issue found by Corentin that copy related
argument "rowsPerImage" should not take effect when we are copying
one single depth or array slice.
Bug: dawn:547
Change-Id: I603291d559de1d05e420e5ed1f4cabf53de5a93f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52680
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Tests are based on the IOSurfaceWrappingTests.
Sampling tests are not implemented, since they would require
support for the samplerExternalOES sampler type in WGSL.
Bug: chromium:1205155
Change-Id: Icc114eaf6efaee93f1b8486e615f0fd307f23080
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50201
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Instead of having it as a decoration.
The old style is now deprecated and will be removed soon.
See https://github.com/gpuweb/gpuweb/pull/1735 for the WGSL spec change.
Bug: tint:846
Change-Id: Id2fa681ddf7b97cd3fa41d7b5538029d96db7e28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53082
Reviewed-by: Corentin Wallez <cwallez@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This toggle will be used by Chromium to disallow the unsecured SPIR-V
path such that a renderer process can only use WGSL.
This new toggle will be covered by a test in Chromium that ensures that
in the default configuration SPIR-V is disallowed.
Bug: chromium:1214923
Change-Id: Ia67e0c7466044e1086399d995dc841426fe604c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52781
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This patch removes the function declarations which don't have their
function bodies.
BUG=None
Change-Id: Id16c2a225319331cdbc3a827ebbabf58c16e1dfd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch re-enables the T2T copy workaroudn on Intel Gen9 and Gen
9.5 GPUs because the latest released Intel D3D driver still cannot
handle some copies correctly in some copy shapes.
BUG=chromium:1161355
Change-Id: Ia96fe05c3e027f56a734331de03fe42745754cc3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52960
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
These configs match the output of the new Starlark generated configs
that are being worked on. Landing these in advance to a) confirm that
they working, and b) make the patch using Starlark a no-op from the
config contents perspective.
BUG=dawn:734
Change-Id: Ifa8018cf88f0d9a6e025d3a2009e9f8ed84dd22d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52980
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
And fix a bug where the Metal backend hit an ASSERT when
clearing combined depth/stencil textures by copy.
Bug: dawn:780
Change-Id: Idf3061570f63d0abd3e8a41d0c251db4f6dc7e0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51840
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Expand coverage for these tests by using combinatorial test
parameterization. Covers more cases and expands coverage to
compressed textures. This caught a bug on Vulkan where only the
first region for multi-layer compressed texture copies was cleared.
It also caught a driver bug on some Intel platforms, where clearing
the non-zero mip of a depth texture does not work.
Bug: dawn:780
Change-Id: Ic601bae111c1c2dd150f569d7e02759ca765201e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51680
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This change mainly is a preparation for 3D texture copy splitter,
which will be based on 2D texture copy splitter and then revise
or recompute incorrect copy regions if needed.
The change itself mainly rename some variables and comments and
distiguish 3D texture copies from 2D (array) texture copies. For
example, term slice is changed to layer if it only refers to layer
slices in 2D textures and it is not shared by depth slices in 3D
textures.
Bug: dawn:547
Change-Id: I6f84134a4fbcb90708901a1059b60e78e1a25ca5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This is a header-only utility so it can be easily included and
used anyhere. Include it in DawnTest.h to automatically pick up
definitions to print test parameters.
Also, work around bot limitations for very-long test names.
Bug: none
Change-Id: I940263ab0a4cc415b06fa04749694f16ff08335c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51841
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Also mention that the Bug: tag should be at the bottom of the commit
message.
Bug: dawn:23
Change-Id: Ib4e6b3c3db2f97af94c7e8240af90f85add5547f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52780
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>