The end to end texture tests with the binary information for the textures are generated using the open source astc-encoder tool.
Also: Refactors end2end compressed texture tests to allow for non-4x4 texel compression formats (ASTC formats are not all 4x4).
Bug: dawn:955
Change-Id: I5311a5aa7bd017de72300bf7c87fba6c869b1db5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63121
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch fixes a use-after-free issue in FlatComputePipelineDescriptor
by always making its pointer members point to its own members.
BUG=dawn:529, chromium:1246158, chromium:1246748
TEST=dawn_end2end_tests
Change-Id: I49b98357444edcdb1b225e961d1e4d6e5b11e978
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63366
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
ID2D12CommandQueue::GetTimestampFrequency returns an error HRESULT
when there are bugs in Windows container and vGPU implementations.
To workaround, we check the return value during adapter creation
and disable the timestamp query extension upon failure.
Device creation is still allowed to succeed when the method returns
failure.
Change-Id: Ie71f8712fc9f4f50e4ce26ecfec929b5b1a126d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63225
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
This was missed in a previous CL.
Bug: dawn:1092
Change-Id: I1915371c6a049d8c3b503c72194e568eb7fde95c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63384
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Fixes a crash found while fuzzing by returning early when SetDebugName
is called with an empty D3D12/Vulkan object or when the device is lost.
Adds tests.
Bug: chromium:1245720
Change-Id: Ie443f690cf5635d017295a13e21c33dd2e97dc46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63363
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
Adds labels for Pipelines and ShaderModule. Includes tests. Backend
functionality is implemented for Pipelines, and completed to best effort
for ShaderModule.
Bug: dawn:840
Change-Id: I55024a83f66d9fc2fc0e8b79e4b9a7ebc6f3cf1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62860
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
When ErrorInjector injects a device loss, it is fake and commands are
still running on the device and we need to wait for them before we start
to deallocate stuff.
When handling the error in the frontend, call WaitForIdleForDestruction
so that all the commands are finished. In the Vulkan backend
WaitForIdleForDestruction have a special code path to no allow error
injection on vkWaitForFences in this specific case, as double error
injection would make the problem appear again.
Bug: chromium:1244408
Change-Id: I710fccbb40b4b14d84f5787be5e002b469e6e2e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63101
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
The D3D12 and Metal backends no longer support any other
shading language translator, so the suffix is superfluous.
Bug: dawn:1099
Change-Id: I6a1a249a80d59dbf9cabf5d4ea917f852745e78e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This patch implements the struct FlatComputePipelineDescriptor to
save all the pointer members of ComputePipelineDescriptor in
CreateComputePipelineAsyncTask to better simplify the orignal code
path.
We will also implement FlatRenderPipelineDescriptor in the next
patch, which is more important for CreateRenderPipelineAsync as
there are many more pointer members in RenderPipelineDescriptor
than those in ComputePipelineDescriptor.
BUG=dawn:529
Change-Id: I69ab0dc898f0a6dcc9886d827729e6fd7308bd2d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63280
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Prevents bind group layouts created by a default pipeline layout from
being reusable with any other pipelines or layouts, as detailed in
https://github.com/gpuweb/gpuweb/pull/2068
Change-Id: Ic398eb6c6e089ac63ce6650f125dd20a9dfc8862
Bug: dawn:1094
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63220
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This helper helps ensure correct handling of request maps by:
- Forcing erasing to happen immediately when acquiring a request. This
prevents some cases of iterator invalidation if we later change the
container type.
- Implements correct closure of all callbacks, including if the
callbacks themselves add more callbacks.
Bug: dawn:1092
Change-Id: Ia0ba9f050bbf3f0dee846f537910523bebb3bf1b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63003
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Some tests to make sure new requests inside user callback
is okay.
Bug: dawn:1091
Change-Id: I4c53d7fb6637f77e5af6fd0a78d879a2431d4ac8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63041
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
This patch removes the redundant code in CreateRenderPipeline so
that we can better share the common code in both CreateRenderPipeline
and CreateRenderPipelineAsync.
BUG=dawn:529
Change-Id: Ic2a7781525e5594da3d51a42b231df63c0c09339
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62880
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
The end to end texture tests with the binary information for the textures are generated with a combination of the open source etc2comp tool and manual crafting of the data based on the specification in the Kronos Data Format Specifications (https://www.khronos.org/registry/DataFormat/specs/1.1/dataformat.1.1.pdf) for the compressed formats.
Also: Refactors end2end compressed texture tests and some utilities so that we can use parameterized tests for easier new format additions.
Bug: dawn:955
Change-Id: I91686f26a693a85cb076ef0eca3029111a64c50f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62740
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
There might still be fences and commands marked as in-flight in
ShutdownImpl if the device was lost. Delete them anyway because since
the device was lost, it means that all objects are no longer in the
"pending" state (from the Vulkan spec point of view)
Bug: chromium:1244454
Change-Id: I905a9a8e5174591bf93e3cdac3cdcb349d75a581
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63102
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Currently we use gpu family to determine whether a query extension is
supported. The official document provides a way to check the feature
support by GPU counter. Update checking following the official guide.
Bug: dawn:996
Change-Id: I09cf51ed8a8209642eed71c9e4592f6eab82bfa5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60360
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
These are needed for the VulkanDeviceInfo and VulkanFunctions structs.
Change-Id: I1d18e59cd923e5fd702ac65d505793519b3a42b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62920
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Previously device loss would produce an assert when shutting down where
the frontend though not all commands where finished.
Bug: chromium:1242195
Change-Id: I90fe626b6930859b3fd98b660882fb11b6a9ff8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62542
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch refactors the implementation of APICreateRenderPipelineAsync
as a preparation of the async path of the creation of render pipeline.
Now the code path of APICreateRenderPipelineAsync() includes the
following 3 parts:
- When an error occurs in the front-end validations, the callback will
be called at once in the main thread.
- When we can find a proper render pipeline object in the cache, the
callback will be called at once in the main thread.
- When we cannot find the proper render pipeline object in the cache,
the newly-created pipeline object, the callback and userdata will be
saved into the CreatePipelineAsyncTracker, and the callback will be
called in device.Tick(). All the logic mentioned in this section has
been put into one function CreateRenderPipelineAsyncImpl(), which will
be overridden by its asynchronous version on all the backends that
support creating pipeline objects asynchronously.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I5706224092588a8c042a952aef2591696072592d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62781
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
In this patch OOB validation in draw and drawIndexed is added for vertex
buffer with zero array stride. For such case, both vertex step and
instance step mode buffer can be validated for both draw and drawIndexed,
as we don't care about actual vertex count and instance count for buffer
with zero array stride.
Related unit test is also added. Also fix the DrawIndexedVertexBufferOOB
unit test.
Bug: dawn:1065
Change-Id: Id302dc0c443dec965347c8ae9f3f4d73aeddc38c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62200
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Compatible Vulkan backends should now enable ETC2/ASTC but no functional
changes because no TextureFormat in ETC2 or ASTC have been added yet.
Bug: dawn:955
Change-Id: I56e8ff73f931a12253fe6d21f3f4b91e3459ef13
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62701
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
We should use D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT
if the usage *contains* Uniform usage, not if it is exactly
equal.
Fixed: dawn:1085
Change-Id: I540081e550c9e88efeb08169cecdc40b68d36d14
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62242
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Adds the LabelNotImplemented tag param to the main constructor of
ObjectBase to document objects that still require labels.
Bug: dawn:840
Change-Id: Idd19664e797e4d622401e28e5d278331acefb7a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62461
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
This fixes the issue where a standalone checkout of Dawn could not build
the |all| target because ANGLE was missing sub-dependencies. The
|:default| target still builds fine before this change.
Change-Id: Icf6582068837053909d9efd1cffd3a0d3c0836cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61380
Commit-Queue: Michael Tang <tangm@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Adds a generic SetDebugName utility for D3D12 and Vulkan. Passes down
debug label set by user for buffers and textures to be labeled by the
appropriate backend method.
Bug: dawn:840
Change-Id: I7158b537a6e37fdf733645e6830dc33833ee683e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61588
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
Buffer allocations in Dawn may be padded. This padding
could be visible, depending on how the backend
implements robust vertex buffer access. This commit
updates buffer creation to clear all padding bytes
immediately after creation.
It is not counted as a lazy clear.
And, add a test which reads off the end of a padded
vertex buffer to check that the padding bytes are also
initialized.
Also: Update Metal buffers to always allocate enough
space for Tint's vertex pulling, and pass the full
allocated size to Tint. While writing the test in this
commit, a bug was found where Tint assumes there is at
least 4 bytes in the vertex pulling buffer. The WebGPU
API currently allows zero-sized bindings, so Dawn needs
to always allocate enough space for one element.
Also: Update Vulkan vertex/index buffers to allocate
at least one more byte than requested because
vkCmdSetVertexBuffers and vkCmdSetIndexBuffer disallow
the offset to be equal to the buffer size. We need
at least one more byte to make zero-sized bindings
as the end of the buffer valid.
Lastly: Update helper so that a T2B copy of a single
row that touches all bytes in a buffer updates the
buffer state to be fully initialized. This is a small
optimization that is necessary to write the test.
Bug: dawn:837
Change-Id: I829f4764509c4ec784c5aeaaf40b6dcbd4be6866
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62161
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Currently, the bind group layout tightly packs the shader registers for
each of the sampler and non-sampler descriptors sets. This reduces the
max shader register used and helps targeting shader model 5.0, which has
a relatively low max slot count per resource. It is safe in D3D, since a
shader register collision can be valid if the descriptor types differ.
To support Mesa's SPIR-V to DXIL compiler, we need to avoid possible
collisions between resources' shader registers because it uses SPIR-V as
an intermediate representation (which does not namespace bindings by
type). This change re-works BindGroupLayoutD3D12 to not assume the
resulting shader registers will be tightly packed and group per
descriptor type.
Change-Id: I0bb51106c4683bfe02ce15ecad71716734b7a91f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60764
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>