Deprecates the computeStage member of the descriptor in favor of compute
as described by the spec. In order to support both variants without
breaking backwards compatibility some code had to be manually added to
the wire client to copy from the deprecated member to the new one and
visa versa.
Change-Id: I9d5c2fc9c446c927c5792c9af9ed56c90060b65b
Bug: dawn:800
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53884
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The change implements copy non-zero mip level for 3D textures
on D3D12 when the texture has multiple mip levels. The texture
size on level 0 can be either 256-byte aligned or 256-byte
unaligned(its size is non-power-of-two).
Bug: dawn:547
Change-Id: I8ed74fa587cfd814e7f526173dcb653d0a252a1e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51201
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
- Pipeline statistics query is not fully implemented, disallow its
creation as unsafe
- Add pipeline statistics creation in UnsafeAPIsTest, because it needs
enable extension, add a separate test class for it.
BUG: chromium:1177506
Change-Id: Ic77e04c9c854b396e7240674bd9deb0caf97a513
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53889
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
On macOS 10.15 on AMD GPU, WriteTimestamp cannot be called without any
copy commands on MTLBlitCommandEncoder, otherwise crash occurs. But this
issue is not reproduced on macOS 11.0, just disable timestamp query on
the bad version on AMD.
BUG: dawn:545
Change-Id: I69a012b2091b8ccd251d23ddb26b72e06c07492f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53581
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This allows the client to specify a different release key for the keyed
mutex than the default of acquire key + 1. If the release key is the
sentinel value of UINT64_MAX, it's set to acquire key + 1. Once Chromium
transitions to always specifying the release key, it will be made a
required parameter and the default behavior will be removed.
Bug: chromium:1213977
Change-Id: I327f7157bb7ff23cf216e43043568ce7c6f38a60
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53880
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Implements two basic binding tests requested in a previous review. Moves
ExternalTextureState enum to be private.
Bug: dawn:798
Change-Id: I9e5ac31a92bab26b7d68568802db1fa988e849a9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53700
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
If there is an empty row at the beginning of a copy region due to
alignment adjustment, this copy region split by 2D texture splitter
will be definitely incorrect for 3D textures because every depth
slice (except the first slice) will wrongly skip one row. We need
to recompute this copy region via modifying this copy region and
adding a couple more copy regions for the empty first row issue.
The idea of recomputation is:
- modify this copy region and don't copy the last row in order to
make its bufferSize.height not exceed rowsPerImage,
- use one more copy region to handle the last row of each depth
slice except the last depth slice,
- use another copy region to handle the last row of the last depth
slice.
Bug: dawn:547
Change-Id: Ib2f6019963ed29d62a9f13d7316b5f04801db8c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52341
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The unavailable queries are allowed in ResolveQuerySet and resolved to
0s, which has been fixed in
https://dawn-review.googlesource.com/c/dawn/+/48320.
BUG: dawn:434
Change-Id: I72b1f0b621fc22a7a0d30c407c7359e59d7b905c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53762
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Add a toggle named "dump_translated_shaders", and when this toggle
is enabled, translated HLSL shaders will be dumped and log via
Device::EmitLog in the kInfo logging level.
BUG: dawn:792
Change-Id: Ia5ccc96019c32b43aa315f080f80a26919b441e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53580
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
There have been some bugs seen with this on some platforms.
Bug: dawn:838
Change-Id: I29fa483eee3c299960d2c998fce90d918ac4dc9d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52560
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
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>