Defaulting to the 0'th adapter can silently use the Null adapter, which is no fun for anyone.
Bug tint:1354
Change-Id: I14e2379175cb90a48753bd81d096391d15d2dc22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75070
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Fix the use of DawnTogglesDeviceDescriptor.
The dawn.node GPUAdaptor binindg code is already in the wgpu namespace
so use DawnTogglesDeviceDescriptor directly instead of prefixing
it with wgpu::
Bug: dawn:160
Change-Id: I01ab76983aabe150df5769764735d90e4f1e73bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/74840
Auto-Submit: David Neto <dneto@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Move the manually parts to src/dawn_native/webgpu_absl_format.cpp/h.
Rename the template webgpu_absl_format.cpp/h to api_absl_format.cpp.h .
BUG=dawn:1201, dawn:563
Change-Id: Ibbeea43227f4fcf7f1d6b1d0bc3927226e79e6c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/74300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Junwei Fu <junwei.fu@intel.com>
This CL implements RequestDevice and also has changes for
Dawn to internally use wgpu::FeatureName enums, instead of
strings. Some of the string handling is kept for now to
support the deprecated creation path. GetFeatureInfo is added
to the instance to get a name and description of the feature,
for reporting in about://gpu.
Dawn device toggles are now passed in an extension struct off
of the device descriptor. This is only supported in dawn_native,
and not dawn_wire, for now, since dawn_wire doesn't have a way
to serialize lists of null-terminated const char*.
To enable the client to check whether the toggle descriptor is
supported, a `dawn-native` feature is added which is supported
all the time with dawn_native, but not supported with dawn_wire.
Feature `dawn-native` also enables a synchronous version of
CreateDevice for convenience.
Bug: dawn:160
Change-Id: Ifc195e7ea808c6c319021528ef4b36bd65583bff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72020
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This is a reland of 1a57ee9d4e
Original change's description:
> Bump maxUniformBindingSize to 2^16 from 2^14
>
> This was upped in https://github.com/gpuweb/gpuweb/pull/2159
>
> Bug: dawn:1173
> Change-Id: I98d46b9b5a339280d21ddcb2ab039ce7ebce4ec3
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71608
> Commit-Queue: Brandon Jones <bajones@chromium.org>
> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Brandon Jones <bajones@chromium.org>
Bug: dawn:1173
Change-Id: Id86c6432e792a44bb231ae7778df1d38f4084f5b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/74302
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This change add a couple end2end tests when readonly depth/stencil
attahcment is enabled in render pass and the pipeline doesn't
sample from the depth/stencil attachment. The pipeline only do
depth/stencil test.
This situation may not be useful in real world applications. But
it is possible that developers do it in this way. And it impacts
the implementation on some backend like Vulkan.
Bug: dawn:485
Change-Id: I8a81330659295cd4a2f00591b6ead719538babd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71441
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
For unknown reasons formatting of a error context message fails in
RenderEncoderBase::APISetBindGroup fails if the bind group is printed
as a string in the message. This despite the exact same code working as
intended in ComputePassEncoder::APISetBindGroup. Replacing it with a
static "[BindGroup]" to allow the rest of the message to format
correctly until the reason for the failure can be determined.
Bug: dawn:1190
Change-Id: I31105acff4d08849a34e406c6b8e85fab28f17b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/73280
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
CopyTextureForBrowserOptions deprecated AlphaOp after supporting
color space conversion. AlphaMode for src and dst is the replacement.
Bug: dawn:1140
Change-Id: Id507bd7525d74be8a12d212b92cc22f0c7bc94b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/73141
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Bug: dawn:689
Change-Id: I032cfcba755be241126dfa8447a38625d7183334
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71523
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This implements requestAdapter and requestDevice by
forwarding commands the the server and relaying back
replies. After an adapter or device is created,
limits/properties/features are queried and also sent
back to the client.
Bug: dawn:689
Change-Id: Ie0c2984b8ebb661efb0c284a14ae8b74ae4af2ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71522
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This has been removed from WGSL and is now deprecated in Tint.
Bug: tint:1324
Change-Id: Ic187ce3c5ce0723db6f3ca6483e9f5e73ce27acc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72880
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Rename mock_webgpu to mock_api and define the function "GetProcTableAndDevice" to "GetProcTable" for removing the special arguments "WGPUDevice* device" that can be got with "GetNewDevice()".
BUG=dawn:1201
Change-Id: I4fc47e4497ba4b6d280cc8af8605f1d93f43497e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72761
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Junwei Fu <junwei.fu@intel.com>
Struct member defined in dawn.json could have a 'length' attribute
defines the length of the member if it is an array.
In previous, the 'length' could only be 'strlen' or other variable
which has 'uint32_t' types. It cannot support constant length.
CopyTextureForBrowserOptions transfers conversion parameters and
conversion matrix with a constant length. This CL adds this ability
to meet such requirements.
Bug: dawn:1140
Change-Id: I6eeabbc55cc3853fe15e33bdd44060b16f6096bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72580
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
This enum value was removed.
Bug: dawn:1206
Change-Id: Ifebceb01e817a29daec6629434d4dd792f343f74
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72940
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This is so we can implement the adapter/device APIs fully
on dawn_wire.
Bug: dawn:689
Change-Id: I47f68157d081f359f871e0efe0d974dfe53de7d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71521
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Adds upstream instance/adapter APIs. In dawn_native, the basic APIs
to get limits and properties are implemented, but requestAdapter and
requestDevice are not. In dawn_wire, nothing is implemented, but the
stub definitions are put in place, as well the mechanism to inject
WGPUInstance into the wire.
There is a lifetime concern with WGPUInstance and WGPUAdapter on the
wire in that we need to ensure that the client cannot free the
instance or adapter while they are in use. In the near term, this is
not a problem because Chromium will always hold ownership of the
instance and adapters outside of the wire - i.e. it won't inject and
then release ownership.
Bug: dawn:160, dawn:689
Change-Id: Id904272983f23babc9177bc163d78c4fa1044da0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71520
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This CL add color space conversion bases for CopyTextureForBrowser.
Theoretically, it could support any color space conversion. But
test cases only cover (Srgb, DisplayP3) to (Srgb).
It could be expanded to more color spaces conversions.
Bug: dawn:1140
Change-Id: I332e6d1f7cf2424fd5f5af83c71fa45c98d2d8ac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70780
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Also fix a gn check failure with the new GN.
Bug: None
Change-Id: I0686dd5de7fc5804fbbe79f19db413cc67fa0aae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72484
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
On Intel platforms, all planes in fact have same dma-buf, so the
DISJOINT bit shouldn't be used to create the vkimage.
For multi-planar formats, VkImageDrmFormatModifierListCreateInfoEXT
has to be used instead of
VkImageDrmFormatModifierExplicitCreateInfoEXT.
Bug: chromium:1258986
Change-Id: I25306a438e7ba9fd981848e63068e486bbddf11d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68961
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
This will hopefully help catch issues early when people forget to set
pNext before creating the PNextChainBuilder.
Bug: dawn:1223
Change-Id: Ic6b9704aeaa20731e4f7de4d1ac0207d4110c720
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71762
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
In RenderPipelineDescriptor.DepthStencilState, if depth test or depth
write is enabled, the texture format must have depth aspect. Likewise,
if stencil test or stencil write is enabled, the texture format must
have stencil aspect.
Bug: dawn:1226
Change-Id: I9d7efb25675ff2c90704fa45703fb542bab6f1f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72101
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
It requires to revise quite a few flags in order to implement
readonly depth/stencil attachment on Vulkan. For example:
- VkAccessFlags,
- VkPipelineStageFlags,
- VkImageUsageFlags,
- and the most important: VkImageLayout.
These revised flags need to be applied to many Vulkan objects.
For examples:
- VkImageMemoryBarriers,
- IMAGE_LAYOUT revisions in descriptor set (bindings),
render pass, and subpass,
- and loadOp/storeOp revisions in render pass and subpass.
This change also does some workarounds in order to make Vulkan
validation layers happy. For example:
- use DEPTH_STENCIL_READ_ONLY image layout for binding a
depth/stencil texture,
- add DEPTH_STENCIL_ATTACHMENT_BIT image usage for binding a
depth/stencil texture.
Note that STORE_OP_STORE is used for depth/stencil's storeOp for
readonly attachment. It leads to Vulkan validation error. This
change igores that error and let it proceeds and it works well.
Bug: dawn:485
Change-Id: Ie247c9cbffbd837984b0933a905632ab5ad8862d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70280
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This library binds directly to dawn_native and implements
webgpu.h. It may be built as a single library so it can
be easily used in other projects.
Bug: dawn:1220
Change-Id: I73be8c6455922fa526efd1600446cc46b07e82ed
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53887
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Bug was a result of an external BGL reference that lingered after device was destroyed leading to a bad read on the device's FencedDeleter when the BGL reference was finally released. Fix just makes sure that the previous code path runs during the device destruction instead of afterwards.
- Removes passthrough call in BGL to the allocator and instead has the device keep track of the allocator directly so that the list can be used to both deallocate bind groups and bind group layouts at the end.
- Makes the allocator an ObjectBase so that we can have an explicit copy of the device since getting it from the layout can be dangerous now that the allocator may outlive the layout.
Bug: chromium:1276928
Change-Id: Ibca5e3c313fc0c0980ecaaa9ad2c871e204ac153
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71860
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Updates validation logic to match the recent changes in
https://github.com/gpuweb/gpuweb/pull/2385 that allows stripIndexFormat
to be undefined at pipeline creation time, even for strip topologies.
Non indexed draw calls are valid with such pipelines. Indexed draw calls
fail validation at draw time.
Bug: dawn:1224
Change-Id: I28ff78eac726d46f99a099ffb2338b5da81a4a88
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
The EnumClassBitmasks is used by dawn/api_cpp.h that needs to be common.
Define a macro to export the operators from dawn to other various namespace.
BUG=dawn:1201
Change-Id: I20badd54e844fead6ecf12546a2c9e0afa2fd83f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Junwei Fu <junwei.fu@intel.com>
Remove wgpu::ErrorFilter::None from Dawn as it is removed from the
specification.
Bug: dawn:1206
Change-Id: If8ec2722cf1b2bad380011f191f296f0e591646d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71607
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This patch fixes a bug in the allocation of internal staging buffer
for Queue::WriteTexture() that we must ensure the buffer offset to
be 4 bytes when calling Queue::WriteTexture() on depth stencil
textures as is restricted by Vulkan SPEC.
BUG=dawn:1213
TEST=dawn_end2end_tests
Change-Id: Ia2d073ef12d48baff42fca97005c1185c9560f1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71605
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This reverts commit 1a57ee9d4e.
Reason for revert: Swiftshader does not support 2^16 at the moment, and this is causing all Swiftshader tests to be skipped silently.
Original change's description:
> Bump maxUniformBindingSize to 2^16 from 2^14
>
> This was upped in https://github.com/gpuweb/gpuweb/pull/2159
>
> Bug: dawn:1173
> Change-Id: I98d46b9b5a339280d21ddcb2ab039ce7ebce4ec3
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71608
> Commit-Queue: Brandon Jones <bajones@chromium.org>
> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Brandon Jones <bajones@chromium.org>
TBR=cwallez@chromium.org,enga@chromium.org,bajones@chromium.org,bajones@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Ib7d6023adac3f99b8e7238035eed2a16f2ced6d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:1173
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71840
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
D3D12, OpenGL, and OpenGLES have their own backend-specific
AdapterDiscoveryOptions. Add the same for Vulkan and Metal so we can
selectively discover just Vulkan or Metal adapters.
The Vulkan options include a boolean forceSwiftShader to force
Dawn to discover only SwiftShader on the Vulkan backend.
Also, refactor D3D12's DiscoverDefaultAdapters to simply call
DiscoverAdapters to match the other backends.
Bug: chromium:1266550
Change-Id: I137f94b40084b2d0ddeda39b6b7ef20f033d8a4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69522
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
This will allow the Vulkan backend connection to be initialized, and
then selectively discover adapters on just one of the instances.
This is needed so that discovery of the fallback WebGPU adapter can
avoid initializing any adapters other than SwiftShader.
Bug: chromium:1266550
Change-Id: Ia8b31c0239da89a41aa89f1c09a66e9e56e10d95
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69980
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This brings more type safety to the code and is marginally more
readable.
Bug: None
Change-Id: I0330a8a8e95cd9b8b531af266acd8fdc50c50460
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71606
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Also delete vulkan.hpp that we don't use, and vulkan_fuchsia_extras that
have since then been upstreamed.
Also updates the fuchsia external import code to use the non-temp
extension.
Bug: dawn:221
Change-Id: I23e1bfedc5a18731be1e58d0bae1bddf6b0f45fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71601
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Changes several DAWN_TEST_UNSUPPORTED_IF macros that were erroneously
used to DAWN_SUPPRESS_TEST_IF.
Bug: dawn:1216, dawn:1217
Change-Id: Iaa0d7eb1b3aad8c0b11ff395cebaff0f15631beb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71524
Commit-Queue: Brian Sheedy <bsheedy@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Change backend connection in Instance.cpp to store a bitset of
backends that have been connected. This lets us only connect to a
single backend if AdapterDiscoveryOptions are passed explicitly,
and track which connections have/have not been made. Later, we can
connect to the rest of the backends if more are requested.
This is part of some improvements to the existing code so we can
selectively discover adapters and control discovery of the
high-performance, low-power, and fallback WebGPU adapters.
Bug: chromium:1266550
Change-Id: Iceb0d3f71751f5aac6218996ace3cf89deda8a29
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69521
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Validate the storage texture views have a miplevel of 1 when creating
bind group. This validation is added in
https://github.com/gpuweb/gpuweb/pull/2285.
Also fix a bug in unittest BindGroupValidationTest.TextureBindingType.
Bug: dawn:1212
Change-Id: If32400ed1e4f3049b8b8979e6e6133bada36b45c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71380
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
- Update block size of depth/stencil formats in TextureUtils.h
- Allow to copy depth aspect for Depth32FloatStencil8 and disallow it
for Depth24UnormStencil8 in copyTextureToBuffer()
- Add Depth24UnormStencil8, Depth32FloatStencil8 and other depth/stencil
formats in CopyCommandsValidationTests.
Bug=dawn:690
Change-Id: I3f645b838b8a8cdafe0880bbd1e4e8d17d994510
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
Suppresses several failures in Dawn's C++ tests that were found on
Windows machines with GTX 1660s.
Bug: dawn:1216, dawn:1217
Change-Id: I1b9feddd742837d0f91118803103eecbaa9effc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71560
Commit-Queue: Brian Sheedy <bsheedy@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
- Fixes all class and implementations to call upwards when necessary.
- Makes DestroyImpl full virtual at ApiObjectBase.
- Fixes mock classes to call default DestroyImpl upwards on mock calls.
- Adds back D3D12 optimization for buffer destruction.
Bug: dawn:628, dawn:1189
Change-Id: Id2c2c6483dc7ed93daf8e4648af26ac1307e3d90
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71243
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
When setting a buffer to zero now uses copies from a previously
allocated, zeroed out buffer to perform the clear rather than making new
allocations every time.
Bug: dawn:1160
Change-Id: I0c8e7e56b2afcb5961723e352d8bbdf276f4557c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70760
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Dynamic storage buffer sizes are loaded from a uniform buffer
which is bound to a set of root constants in the D3D12 root
signature.
Bug: dawn:429
Change-Id: I3bf0d9bbdb7a5b0a8c0f624f18081c6bf8d45fca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68960
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
- Only suppressing for Linux/Vulkan/Nvidia platforms for now as those are the reproducable ones. The issue could be larger though.
Bug: dawn:1214
Change-Id: I56f29fdef912b0857b33bb81d391a82702750b47
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71360
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
VulkanImageWrappingTestsOpaqueFD already has the same fixes, but
sadly didn't get applied to VulkanImageWrappingTestsDmaBuf.
DawnTest::Setup() and TearDown() are missing so the device isn't
initialized.
The expected values in CopyTextureToBufferSrcSync are wrong.
Bug: dawn:1210
Change-Id: I3810a626d840573ab7c1fa75ba7ca239e7288c3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71245
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
To help debug a suspect crash in these functions.
Also, change some of the counter checks to use more
Objective-C style checks instead of std::find.
Bug: dawn:1102
Change-Id: I693d1f2489116200b2c0608ca60bc3eb8ddb8571
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71242
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Hao Li <hao.x.li@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
The Depth16Unorm format has been implemented at
https://dawn-review.googlesource.com/c/dawn/+/62420, we can add it to
kAllTextureFormats and kDepthFormats in utils/TextureUtils.h.
Bug=dawn:570
Change-Id: I5abf845341debc1d6881c639bc400c40b14fc3bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70900
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This reverts commit 610f184fd9.
Reason for revert: Crashes still happen even with this guard.
Testing shows that counterSets being null does not cause crashes.
Original change's description:
> Add a guard for MTLDevice.counterSets being null.
>
> This is a tentative fix for a segfault that's happening on
> metal::Adapter initialization on some systems.
>
> Bug: dawn:1102
> Change-Id: Iff31e46420e60cd76ecbbfa92bd5b5906ca89cf4
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69340
> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:1102
Change-Id: Ia7d7428acee552a107425c774ba15e97bf170e38
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71241
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
All of these root constants are set when a bind group holding
dynamic storage buffers is applied. This could be improved by
using reflection data to only set constants that are needed
in the shader. This will require adding a way to store the
reflection information in the blob cache.
Bug: dawn:429
Change-Id: I3afce6b781ec5a82d5d0bafb6720d368b82c1b00
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68600
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Add undef Bool for xlib_with_undefs.h
Also fix a link in perf_tests/README.md
Change-Id: I83718b2014b6fe2bdfbd82b248d358abbd463abb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65223
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
- Adds system utility to get the module directory for dawn native.
- Updates Vulkan backend to use the module directory to find loader.
- Test ran on NVIDIA GTX 1660 here: https://chromium-swarm.appspot.com/task?id=576d77991add7c10.
Bug: dawn:1191
Change-Id: I7c577008b5252ac94f38c8cdb56f7e8d8a0aa956
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70860
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
FXC sometimes miscompiles code when optimizing (/O2), and there is no
discernable workaround. This change sets the optimization level to /O0
when compiling shaders with FXC.
Also, no longer default to enabling EmitHLSLDebugSymbols in Debug
builds, which disabled optimizations (/Od). This confused me a few
times, and is not necessary since we can set this toggle via command
line.
Bug: dawn:1203
Bug: tint:1175
Bug: tint:1112
Change-Id: Ide9e6ecd45adeca951b8836dee91a8367eca3769
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70700
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
The depth240unorm-stencil8 and depth32float-stencil8 are optional
features. Enable them and add validation tests for texture creation
and texture view creation.
They are unimplmented on backends, skip their end2end tests.
TODO: add validtion for copy commands.
BUG=dawn:690
Change-Id: I980631d2f3fa6397a6125221a76980a15c8cb2f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
- Turns internal cache into a pointer so that we can deallocate it earlier for the destroy.
Bug: dawn:628
Change-Id: I69fd1e4be5ed5d8b7a28efebd9c2852bab3224b9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70182
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Previously we would only discover 1.0 or 1.1, meaning that extensions
promoted to core in 1.2 wouldn't be properly discovered.
Bug: chromium:1269882
Change-Id: I38bc211a3358158ba5eccd6b361e4b1173e047fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70640
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This Dawn-internal struct is used to send Adapter information from
the GPU to Renderer process. We need adapterType to determine the
isFallbackAdapter property of GPUAdapter in Chromium.
Bug: chromium:1266550
Change-Id: Ia0457119f45a165e7bdb5b85c43c120391c7001b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70580
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
This is preventing supporting DeviceDescriptor from upstream
webgpu.h because the name conflicts with the existing struct.
A typedef using the original name DeviceDescriptor is added
until all embedders of Dawn are updated to use the new name.
Bug: dawn:160, dawn:689
Change-Id: Ib9cb7443b7e46e3ffe29d2ec109f2f1a831754e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70581
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
For example, a non-Debug build will now output:
1: /* FXC compile flags */
D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
D3DCOMPILE_OPTIMIZATION_LEVEL1
While a Debug build would output:
1: /* FXC compile flags */
D3DCOMPILE_DEBUG
D3DCOMPILE_SKIP_OPTIMIZATION
D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
D3DCOMPILE_OPTIMIZATION_LEVEL1
This will be useful when using the CLI (fxc.exe) to make sure we pass it
the right flags.
Bug: dawn:1162
Change-Id: Ifffa2a0d1d0ccbb67ee7f5e1d0608d5946235bc5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70680
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Current implementation of CopyTextureForBrowser() uses sampler to
load and store values in shader to *-srgb format textures. This is
the wrong implementation because it cannot reserve the origin bytes.
This CL remove *-srgb formats from supporting lists.
This CL also refactor CopyTextureForBrowserTest to reduce duplication
and prepare for color space conversion test case.
Bug: dawn:1195
Change-Id: Ib00d863e99bde8c7bf86fbb8ff93f0c799babe23
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70040
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Adds label tracking for:
- CommandBuffer
- CommandEncoder
- ComputePassEncoder
- RenderBundleEncoder
- RenderPassEncoder
It's not clear to me if these structures have labelable equivalents in
D3D12 or Vulkan, so no changes were made to the individual backends.
Bug: dawn:840
Change-Id: Ib1786ab45466a3d13fbd4c772f8e8af4cc1786af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70400
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch add the size parameter check in buffer mapAsync in dawn
wire server to make sure that it is not WGPU_WHOLE_MAP_SIZE. Together
with validation in mapAsync in dawn native, we can ensure that the
size parameter deserialized in wire server is a valid actual size.
When using default size with dawn wire, the actual size is computed
by wire client, and WGPU_WHOLE_MAP_SIZE shall never be passed to server.
Bug: chromium:1270819
Change-Id: Ic0fe52efed15860bcc519a3881f0f649f7455435
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70260
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This patch adds the object label to the trace events for the creation
of pipeline and shader module so that we can easily know which shader
module or pipeline creation task the trace event belongs to.
BUG=dawn:1167
Change-Id: Ic2de4542d0167437eea2fd600d0f0be3bdd225f9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70041
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch fixes a shader compilation warning in FirstIndexOffsetTests
by adding "flat" interpolation types to the user-defined unsigned
integer vertex outputs and fragment inputs.
This patch also enables FirstIndexOffsetTests on Vulkan backends as
we have already correctly supported "flat" interpolation in WGSL.
BUG=tint:451
TEST=dawn_end2end_tests
Change-Id: I965572c8460494e3eaec5dcf83e2dc67c0771250
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70025
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Instead of using template functions, generate define string pairs
in std::string. For DXC path, convert them to std::wstring. It is
okay since shader generation is already expensive.
By the way generalize it to all kinds of defines in
ShaderCompilationRequest.
Bug: dawn:1137
Change-Id: I5518e992b56497e28c8ac7e818bf19b4853dee4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70120
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Adds label tracking for:
- BindGroup
- BindGroupLayout
- PipelineLayout
- TextureView
- ExternalTexture
- Sampler
- QuerySet
Labels are passed to Vulkan and D3D12 where applicable, though many of
the related structures don't appear to be labelable objects in D3D12.
Bug: dawn:840
Change-Id: Ic7073dc9c02c9fb05bb46f2f8a84e575d5ba5c16
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70180
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
D3D12 doesn't have native pipeline constants feature.
This is done by using #define. Add some new tests to make
sure these define approaches work as expected.
Also makes duplicate pipeline constant entries an invalid
case.
Bug: dawn:1137
Change-Id: Iefed44a749625b535bbafbb39f42699f0b42e06a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68860
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Failures in the following tests are preventing Dawn from rolling into
Chromium due to errors when run against D3D12_NVIDIA_Quadro_P400
ComputeDispatchTests.IndirectBasic
ComputeDispatchTests.IndirectOffset
ComputeDispatchTests.MaxWorkgroups
Bug: dawn:1196
Change-Id: Ie7188384656307ede0f467ead6fba9289d9db655
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69920
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This patch supports [[num_workgroups]] on D3D12 for DispatchIndirect
by appending the values of [[num_workgroups]] at the end of the
scratch buffer for indirect dispatch validation and setting them as
the root constants in the command signature.
With this patch, for every DispatchIndirect call:
- On D3D12:
1. Validation enabled, [[num_workgroups]] is used
The dispatch indirect buffer needs to be validated, duplicated and
be written into a scratch buffer (size: 6 * uint32_t).
2. Validation enabled, [[num_workgroups]] isn't used
The dispatch indirect buffer needs to be validated and be written
into a scratch buffer (size: 3 * uint32_t).
3. Validation disabled, [[num_workgroups]] is used
The dispatch indirect buffer needs to be duplicated and be written
into a scratch buffer (size: 6 * uint32_t).
4. Validation disabled, [[num_workgroups]] isn't used
Neither transformations or scratch buffers are needed for the dispatch
call.
- On the other backends:
1. Validation enabled,
The dispatch indirect buffer needs to be validated and be written
into a scratch buffer (size: 3 * uint32_t).
2. Validation disabled,
Neither transformations or scratch buffers are needed for the dispatch
call.
BUG=dawn:839
TEST=dawn_end2end_tests
Change-Id: I4105f1b2e3c12f6df6e487ed535a627fbb342344
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68843
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch fixes a bug in the generation of expected data in CopyTests.
In function GetExpectedTextureData() we intend to initialize every byte
of the expected texture data, so we need to calculate the index of the
expected texture data with "bytesPerRow" instead of "texelBlocksPerRow".
BUG=chromium:1161355
TEST=dawn_end2end_tests
Change-Id: I05bcab629fc961c7425c10fcd534c451af199712
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69600
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Found while investigating Swiftshader support. Some Vulkan loaders
fail to create an instance if VK_ICD_FILENAMES is empty string
rather than entirely absent. It was set to empty string because
Dawn did not distinguish between nonexistent environment variables
and the empty string. This CL adds distinguishing between the two,
including tests for the behavior.
Bug: chromium:1266550
Change-Id: I1680a281f62e6b340009e01da65db9d485e2975e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69520
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
- Renames ProgrammablePassEncoder to just ProgrammableEncoder since it is also used in RenderBundleEncoder which is not a "pass"
- Adds testing infrastructure to further test device errors
- Ensures AttachmentStates are de-reffed when encoder objects are destroyed for proper cleanup
- Makes sure that both encoded and partial encoded commands are freed at destruction
Bug: dawn:628
Change-Id: Id62ab02d54461c4da266963035e8666799f61e9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68461
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This adds overloads for WireCmd [De]serialization that don't take the
object id provider/resolvers and produce a fatal error as soon as an
object is encountered.
Bug: dawn:1186
Change-Id: I13e796a5d8f59c26279b9079d4496390506c739a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68941
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
The new test can pass without further implementation changes on
D3D12 because:
- stencil aspect shares the same resource state with depth:
D3D12_RESOURCE_STATE_DEPTH_READ.
- stencil flag (D3D12_DSV_FLAG_READ_ONLY_STENCIL) for readonly
DepthStencilView descriptor has already been added into Dawn
in previous patch.
Bug: dawn:485
Change-Id: I87aaaac0f01744d3533f2d97f987ee23ad0a1f53
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69300
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
To help diagnose issues where Dawn fails to create or initialize
an adapter.
Bug: none
Change-Id: I0c757f99596e9b4ac0e559807654ffaf9cb03feb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69420
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This is a tentative fix for a segfault that's happening on
metal::Adapter initialization on some systems.
Bug: dawn:1102
Change-Id: Iff31e46420e60cd76ecbbfa92bd5b5906ca89cf4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69340
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Remove deprecated usage of size=0 as default size in setIndexBuffer and
setVertexBuffer. Using size=0 now result in a zero-size binding instead
of default size.
Bug: dawn:1058
Change-Id: I2ef0afc8d8826aa87a17c037d4dd1baf14e09f89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67744
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
In this patch the deprecated usage of size=0 as default size is removed.
Using size=0 in buffer.mapAsync now result in a zero size mapping,
instead of the default size.
Bug: dawn:1159
Change-Id: Ie8badc5eb7440980d0df3d3d27867e710e77f44b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67743
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
These tests are partially disabled while bounds clamping is
unimplemented on D3D12 for dynamic storage buffers.
Bug: dawn:429
Change-Id: Ia8b3ad3e3703b784cd51813c92ff1f2c731b7519
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68460
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
- Also updates and adds tests for CommandBuffer since it is the last object with a Destroy name clash.
Bug: dawn:628
Change-Id: I028e0101a91a785aa90d2b656556d48fe0d6e736
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68101
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Bug: dawn:628
Change-Id: Iaaa62507592e12a724673a0226783c0425b04f35
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67601
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
- Ensures that the D3D12 buffer destruction implementation no longer handles unmapping as that is now handled in the frontend.
- Moves around when the frontend buffer state is set to MappedAtCreation so that it only happens when the staging buffer (when necessary) is created successfully. Note that if the staging buffer was not created successfully, we will never return that buffer and would instead return an error buffer anyways. We need the state to be Unmapped though since it needs to be properly destroyed.
Bug: chromium:1265923, dawn:628
Change-Id: I62f98f0f1379a9cf0af565adfb8256ffe592b1ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68880
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
In all three modes, this cancels the current operations as soon as
possible. For tests that hang, this ensures we can Ctrl+C the process
and get the stdout from those tests.
Bug: dawn:1163
Change-Id: Ib3e45b533adaf510e1f9454a59ef1e821fc3eccd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68300
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Same as passing in "--flag=dawn-backend=<name>".
Also, if VK_ICD_FILENAMES env var is set, force backend=vulkan.
Bug: dawn:1163
Change-Id: If2def47e1af2a1eba7fbf897c8ed1ebf92ae4a15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68183
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
WebGPU community has decided how to handle color space conversion.
This also add more supported dst color format for
copyExternalImageToTexture.
This CL update the supported dst texture formats to align with
WebGPU spec. This is also the preparation for color space conversion.
Bug: dawn:1140
Change-Id: Ibf4386d5cec4acb086e111229dd8bba36a5f6bcd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67620
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
- Updates error message formatting to ensure they end with a newline to
prevent errors from running together.
- Updated all encoder/device context messages to normalize their format
and include more information.
- Update Abseil formatter to make objects indicate if they are an error
object in the formatted string. (ie: [Invalid BindGroup])
- Added fallback code in case a context message doesn't format
correctly to aid in debugging.
Bug: dawn:1154
Change-Id: Id27b11305cf8efcca343597f90489dde5552c775
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68200
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This change also makes sure that all three modes (serial, isolated
parallel, and server) all output stdout of tests only if verbose mode is
enabled.
Bug: dawn:1163
Change-Id: I9e9efcfa4b73571adac15179d2792fb745255fb8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68182
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This change adds a end2end test for readonly depth/stencil
attachment and implements it on D3D12.
This change focuses on depth. If it is OK, I will add test(s) for
stencil.
The key points are:
- Set DEPTH_READ transition barrier to replace DEPTH_WRITE barrier
if it is readonly depth/stencil attachment.
- Set appropriate D3D12_DEPTH_STENCIL_DESC (which is already correct)
and D3D12_DEPTH_STENCIL_VIEW_DESC (which needs some particular
flags). Otherwise, the underlying driver (validation layer) may
think we still need DEPTH_WRITE transition barrier.
Bug: dawn:485
Change-Id: I64d30426ed8042a98b3fef084bb90b125320a6f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67742
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Instead of using BufferLocation as another layer of indirection,
the indirectBuffer can be set directly on the indirect command.
This makes the indirect validation a bit simpler, but introduces
additional lifetime dependencies in that the indirect draw validation
MUST be encoded while the DrawIndexedIndirectCmds it references
are still valid.
Bug: dawn:809
Change-Id: I1ef084622d8737ad5ec1b0247bf9062712e35008
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67241
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Improves various error messages that have received feeback indicating
that they were too confusing or poorly worded.
Bug: dawn:1152
Bug: dawn:1157
Change-Id: If740300f31278ab04d4493887c03918a09cf0f86
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68100
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
These flags are forwarded to the cts cmdline/server to configure dawn.node.
I also documented this in the README, along with examples.
Bug: dawn:1163
Change-Id: I6e213f1bd64700564c2e54dcd4edcf219ef2e829
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68060
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This will help with review load and finding an owner once mandatory
owner review is enabled.
Change-Id: I1a90b83fed68f062c1406552aec218bf9c2092ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67821
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch adds trace events on the creation of shader module,
render pipeline and compute pipeline so that we can measure how
expensive these tasks are in chrome://tracing
BUG=dawn:1167
Change-Id: Iffc37adea49d7e04b9f757bc8b3679769085a428
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67880
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
If the texture attachment doesn't have a stencil aspect, we can
set stencilReadOnly flag in RenderPassDepthStencilAttachment as
we want. And it is totally ignored and it doesn't impact whether
the depth/stencil attachment is readonly or not.
That's true for depthReadOnly flag upon a stecil-only format like
stencil8, but we haven't support stencil8 yet.
Bug: dawn:485
Change-Id: If0a21250ce7cc7a1ad9cc17a05ecf64d05342cd0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67962
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
The changes should pass through the destroy changes such that when the device is destroyed, the respective destroy functionality currently existing in the backends should be called.
For buffers, destroy no longer causes validation errors since even error buffers may need to be destroyed in the case of mappedAtCreation.
Bug: dawn:628, dawn:1002
Change-Id: I42a475af5d67cc60f86d95ac53c2b377a9fd2e82
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65863
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Rebuild if the `out-node` directory is missing.
Actually check the server's status code.
Fix error handling for bad statuses.
Change-Id: I2164bba528036d39f10852f4ffd8ace76f145dba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67780
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This is a reland of 9901c710d1
Original change's description:
> Adds destroy handling for simple objects without new backend changes yet.
>
> Simple objects are defined here as objects that do not already have a destroy or destroy-like API available. They include:
> - BindGroups
> - ComputePipelines
> - PipelineLayouts
> - RenderPipelines
> - Samplers
> - ShaderModules
> - SwapChains
>
> Changes include:
> - Adds necessary constructors for testing and caching
> - Adding mock objects, mock constructors, and tests
>
> Bug: dawn:628
> Change-Id: I26a5e37bc5580b9064db299a75ef1243521b266a
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65864
> Commit-Queue: Loko Kung <lokokung@google.com>
> Reviewed-by: Austin Eng <enga@chromium.org>
Bug: dawn:628
Change-Id: I19492ad6b1660e205d123b2d1fdf53c772564cfe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67961
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This reverts commit 9901c710d1.
Reason for revert: Breaking dawn roll due to include in ShaderMock
Original change's description:
> Adds destroy handling for simple objects without new backend changes yet.
>
> Simple objects are defined here as objects that do not already have a destroy or destroy-like API available. They include:
> - BindGroups
> - ComputePipelines
> - PipelineLayouts
> - RenderPipelines
> - Samplers
> - ShaderModules
> - SwapChains
>
> Changes include:
> - Adds necessary constructors for testing and caching
> - Adding mock objects, mock constructors, and tests
>
> Bug: dawn:628
> Change-Id: I26a5e37bc5580b9064db299a75ef1243521b266a
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65864
> Commit-Queue: Loko Kung <lokokung@google.com>
> Reviewed-by: Austin Eng <enga@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:628
Change-Id: Ic727106f3dc701dc25418adf9824fbc5397aa656
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67960
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
We now always use Tint.
Bug: dawn:571
Change-Id: Ic65669a9e00493292ed60cde00af6fa3f6e55ec2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65665
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This patch implements the template class ConcurrentCache which will
be used to implement all the thread-safe object caches in Dawn (e.g.
PipelineLayout, ComputePipeline and RenderPipeline).
BUG=dawn:529
TEST=dawn_unittests
Change-Id: Ia6f75191110a93285bdb23fdc1d275444d1ee866
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67760
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Simple objects are defined here as objects that do not already have a destroy or destroy-like API available. They include:
- BindGroups
- ComputePipelines
- PipelineLayouts
- RenderPipelines
- Samplers
- ShaderModules
- SwapChains
Changes include:
- Adds necessary constructors for testing and caching
- Adding mock objects, mock constructors, and tests
Bug: dawn:628
Change-Id: I26a5e37bc5580b9064db299a75ef1243521b266a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65864
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
by clamping the binding size for uniform buffers and using
a dynamically sized array for storage buffers
Bug: dawn:685, dawn:1172
Change-Id: I2222b98d7c2a67cdb420441837e2acfaa8185c73
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67566
Auto-Submit: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Improves the validation messages in ComputePassEncoder.cpp,
ProgrammablePassEncoder.cpp, RenderBundleEncoder.cpp, and
EncodingContext.cpp/h to give them more contextual information.
Bug: dawn:563
Change-Id: I3807c30fb0de8e766fbc35b98ef9c059f9d441ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67603
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Now an overridable constant need to be initialized, either via value specified
in shader, or via constant entry from pipeline stage. Otherwise it is invalid.
Together fix the bool 32bit initialize problem on vulkan and re-enable the
overridable constants shader test, and use assigning to _ instead of
ignore() in tests.
Bug: dawn:1041
Change-Id: I49e7885c8d6134647b09926ceb15234ac21ee35d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67560
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Helps to avoid explicitly using reinterpret_cast
Change-Id: I4df0e7094c7d8460385c6f23dac529ace9df9bdc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67605
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This is a reland of 167d299916
It skips MaxLimitTests.MaxBufferBindingSize on 32-bit Windows
until we have a way to test more reliably on that platform, or
until Dawn no longer allocates enormous staging buffers for zero
initialization.
Original change's description:
> Reland "Populate some D3D12 limits from the backend"
>
> This is a reland of aa8fcfc64b
> It changes MaxLimitTests to use at most a 512MB buffer on 32-bit
> platforms.
>
> Original change's description:
> > Populate some D3D12 limits from the backend
> >
> > Also bumps the required D3D feature level to 11.1
> >
> > Bug: dawn:685
> > Change-Id: I40bc3a162e0aee596d61118ba0dfe0bf9cb60d93
> > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65120
> > Commit-Queue: Austin Eng <enga@chromium.org>
> > Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> > Reviewed-by: Corentin Wallez <cwallez@chromium.org>
>
> Bug: dawn:685
> Change-Id: I2e1df5f7ac0c9bbb6476ca2e1964a9af4afd89b6
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67145
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> Commit-Queue: Austin Eng <enga@chromium.org>
Bug: dawn:685
Change-Id: Ie20a58d73ebfcd64a8c5e58d29d7fb35ee9fba0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67565
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This reverts commit 167d299916.
Reason for revert: Still failing the roll because of OOM on x86.
Original change's description:
> Reland "Populate some D3D12 limits from the backend"
>
> This is a reland of aa8fcfc64b
> It changes MaxLimitTests to use at most a 512MB buffer on 32-bit
> platforms.
>
> Original change's description:
> > Populate some D3D12 limits from the backend
> >
> > Also bumps the required D3D feature level to 11.1
> >
> > Bug: dawn:685
> > Change-Id: I40bc3a162e0aee596d61118ba0dfe0bf9cb60d93
> > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65120
> > Commit-Queue: Austin Eng <enga@chromium.org>
> > Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> > Reviewed-by: Corentin Wallez <cwallez@chromium.org>
>
> Bug: dawn:685
> Change-Id: I2e1df5f7ac0c9bbb6476ca2e1964a9af4afd89b6
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67145
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> Commit-Queue: Austin Eng <enga@chromium.org>
TBR=cwallez@chromium.org,enga@chromium.org,rafael.cintron@microsoft.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Ibad5ac7f28015da6a7334ba074aa975198591318
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:685
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67564
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This is a reland of aa8fcfc64b
It changes MaxLimitTests to use at most a 512MB buffer on 32-bit
platforms.
Original change's description:
> Populate some D3D12 limits from the backend
>
> Also bumps the required D3D feature level to 11.1
>
> Bug: dawn:685
> Change-Id: I40bc3a162e0aee596d61118ba0dfe0bf9cb60d93
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65120
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Bug: dawn:685
Change-Id: I2e1df5f7ac0c9bbb6476ca2e1964a9af4afd89b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67145
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Commit-Queue: Austin Eng <enga@chromium.org>
dawn:
* Zero-initialize the SpecializationDataEntry. For booleans, the first
byte may be initialized, while the 3 other bytes may contain garbage.
This can cause boolean specializations to be 'true' when 'false' was
specified.
dawn_node:
* Implement conversion of GPUProgrammableStage's constants.
* Fix Napi::Object -> unordered_map conversion.
* Fix member name in error messages generated by
'DictionaryMembersFromJS'
Bug: dawn:1041
Change-Id: I016ec4916fc73226dfe1bd8e7dc52a1e88e46a6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67383
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Until all backend implementations are done.
Bug: dawn:1169
Change-Id: I16d184bec03bbc9a255ad33cf11aa615b1986389
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67422
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This reverts commit d84d7f1ea3.
Reason for revert: CTS tests for this are now enabled.
Original change's description:
> Disable DrawIndexedIndirect
>
> Not passing CTS yet
>
> Bug: dawn:809
> Change-Id: Ib7c240372a8fdbd45803230292c374e2957c8d15
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65601
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:809
Change-Id: I3018fec67c278343956a6da68041bc6ec24d55f4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67420
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
A call-statement can now be made on a function that returns a value.
Bug: tint:1256
Change-Id: I9a3cc4e330f7441e09dc408bdc1cfa515adac392
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67382
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The rules have been relaxed about function values always needing to be
consumed, so a bunch of these phony-assignments can be replaced with the
RHS, but this will be done as a follow-up.
Bug: tint:1213
Change-Id: Ie7c4280f87b4ad7e5a429994b0b88ac22c2f3a9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67300
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This reverts commit c7e6bb0d8d.
Reason for revert: clusterfuzz identified issue https://bugs.chromium.org/p/chromium/issues/detail?id=1262112
Original change's description:
> Improve validation errors for encoders
>
> Improves the validation messages in ComputePassEncoder.cpp,
> ProgrammablePassEncoder.cpp, RenderBundleEncoder.cpp, and
> EncodingContext.cpp/h to give them more contextual information.
>
> Bug: dawn:563
> Change-Id: I87c46c4bfda1375809fae93239029ea4e3b9c0a2
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67000
> Commit-Queue: Brandon Jones <bajones@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:563
Change-Id: I259ccde1735c4201ff2736562cfe4689e9a22f62
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67321
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Same as Chrome's args, this allows us to set the
DeviceDescriptor::forceEnabledToggles and forceDisabledToggles when
creating the GPUDevice.
Example: node cmdline.ts ... --gpu-provider-flag=enable-dawn-features=dump_shaders ...
Bug: dawn:1163
Change-Id: Ib5db71355f72e5d08f8fe87313c5e3d63ee236c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66963
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Only used on Windows builds for now, this flag adds the input path to
the DLL search paths. The main purpose is to ensure we load the right
version of D3D dlls, such as d3dcompiler_47.dll from the Chrome output
dir, rather than the default one in the Systems directory.
Bug: dawn:1163
Change-Id: I8e696dd877ec715e1e54d8589af8275e62c90937
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66962
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
As an alternative to setting the "DAWNNODE_BACKEND" env var.
Bug: dawn:1163
Change-Id: I33ace14e7603b97caf7286a109a31160853f62e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66961
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This change replaces the ".gpu" export with ".create()" function that
accepts an array of flags. These will be used by cmdline.ts to set flags
such as what dawn backend to use. We currenly environment variables, but
this will be more flexible.
Bug: dawn:1163
Change-Id: If2fb35811cac45e16121fbd828f997ef3d795f36
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66960
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Prevent reusing offsets from a previous direct draw.
Update test to verify that values are updated correctly
for each draw. Add tests for indirect draw offsets.
Bug: dawn:548
Change-Id: Ice8325a8a41b8a4375767156dbaba3ee3d714f3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67121
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Improves the validation messages in ComputePassEncoder.cpp,
ProgrammablePassEncoder.cpp, RenderBundleEncoder.cpp, and
EncodingContext.cpp/h to give them more contextual information.
Bug: dawn:563
Change-Id: I87c46c4bfda1375809fae93239029ea4e3b9c0a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67000
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch implements [[num_workgroups]] on the API side for
Dispatch() calls by setting num_workgroups.xyz as root constants.
This patch also adds a temporary validation that on D3D12 backend
using a compute pipeline with [[num_workgroups]] in a
DispatchIndirect call is not supported.
BUG=dawn:839
TEST=dawn_end2end_tests
Change-Id: Iaee2ffd162e9420e4e80944fbb222f10a4600c6a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66580
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit also unifies the initialization process for Adapters.
InitializeImpl() initializes the actual backend adapter.
InitializeSupportedFeaturesImpl() checks base WebGPU features and
discovers additional supported features.
InitializeSupportedLimitsImpl() checks base WebGPU limits and
queries the adapter's maximum supported limits.
Some of these limits from the backend are still overriden in the
frontend because they are limited by internal Dawn constants.
Bug: dawn:685
Change-Id: I43efb0b678dd45f8f89cd62d13104dd00b197da1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64980
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
- Moving the call into DeleteThis should make it so that derived classes don't need to explicitly implement a destructor that calls DestroyApiObject.
Bug: dawn:628
Change-Id: I145f42e7e4c144cc0d2d7c7f609744399d514fe1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66840
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This allows tests to be streamed to N node processes, without incurring the cost of re-scanning the test lists for each case.
It also means that there is an increased chance of state leakage. `--isolate` is a new flag that uses the old behavior of running each test in a separate process.
Depends on: https://github.com/gpuweb/cts/pull/789
Change-Id: Ifc92d1cc07a9de3b2751bed0971f3424d0c247ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66920
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
If we use render bundle, the compability validation between
writeDepth/Stencil in DepthStencilState in render pipeline and
depth/stencilReadOnly in DepthStencilAttachment in render pass
will become two steps:
1. validation between render pipeline and render bundle during
RenderBundleEncoder's SetPipeline().
2. validation between render bundle and render pass during
RenderPassEncoder's ExecuteBundles().
So, render bundle is like a bridge for this compability validation
between pipeline and pass.
The first step has been done in previous patch. The patch does
the second step.
Bug: dawn:485
Change-Id: I1226494e901c07bdb9f565bce7b9073d420f2fe2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66842
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Spinning up new devices for each test can take a long time.
Specifying --j 0 will run a single instance of node, with the given query to run.
Change-Id: I27c161bb76f5deaaa505ab5ae361ea6a0942a130
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66880
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
https://github.com/gpuweb/cts/pull/788 significantly improves the performance of incremental builds, but it can still take around 2 seconds to do that incremental build.
Have the run-cts tool scan the CTS source tree for the most recent modification, and only rebuild if the timestamp is more recent than the last build time.
Significantly reduces startup overhead of the tool.
Change-Id: I7e9227127c02e6d4dc8875a577178956bf5e2481
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66822
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
These should always be resolved or rejected.
The Fatal() call, when a promise is not resolved or rejected, is currently disabled due to https://github.com/gpuweb/cts/issues/784.
Bug: dawn:1123
Change-Id: Ie0e8ac187ad70be0fea41cd66956d0bfd9c53212
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66821
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
The AsyncRunner will enqueue a call to `Device::Tick()` when the runner count moves from 0 async tasks to 1.
It has been observed that some 'async' tasks are actually synchronious, which results in multiple tick callbacks being enqueued before the first has a chance to run.
Fix this by using another boolean to track whether the function has been queued.
Bug: dawn:1127
Change-Id: I7dd81d33d601bf1d3cefb5c4dad6c237883e51ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66820
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Updates all validation messages in BindGroupLayout.cpp and
BindingInfo.cpp to give them better contextual information.
Bug: dawn:563
Change-Id: I7166dce65c93d7c8ac4dd72555fff34c9202e041
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66841
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
tested:
- maxComputeWorkgroupStorageSize
- maxUniformBufferBindingSize
- maxStorageBufferBindingSize
Two of these limits are exposed as configurable to the JS API
so it's important they are tested to work before we expose
them. maxUniformBufferBindingSize came along as well because
the test for storageBufferBindingSize was easy to parameterize.
Bug: dawn:685
Change-Id: I08de6df9d70a22aca0f48ac3fef0038f7aec727b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This change also adds a unittest to validation colorFormatCount in
RenderBundleEncoderDescriptor, and fixes a style issue as well.
Bug: dawn:485
Change-Id: I642f0e250835d76288ac42fa18a8dabf2db30047
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66621
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
For size parameter in mapAsync, use wgpu::kWholeMapSize rather than 0 to
indicate using the default size, i.e. remaining buffer size after
offset. Using size=0 is still available but will cause a deprecation
warning.
Bug: dawn:1159
Change-Id: I474d87ecae4a54ceb28d636f883a6233c91f16fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66284
Auto-Submit: Zhaoming Jiang <zhaoming.jiang@intel.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This change adds two arguments depthReadOnly and stencilReadOnly
into RenderBundleEncoderDescriptor in order to follow WebGPU spec.
It also adds one more validation rule: depthReadOnly must be equal
to stencilReadOnly if depthStencilFormat has both depth and stencil
aspects in RenderBundleEncoderDescriptor. We have already had a
similar validation rule in RenderPassDepthStencilAttachment in
RenderPassDescriptor.
Bug: dawn:485
Change-Id: I32c45b2bd90c7041aa881d8589720a9146d6ac7e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66501
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
If you have a fresh checkout of CTS and miss this step, you get errors
when running the CTS scripts that are hard to figure out.
Change-Id: I12c63455a165d2c37beae75fedd34a4da6c30f28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66640
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This is a reland of ecbdd8fbe7
It prefixes the DEPS variables with "dawn_". Because they are globals,
they may collide with other variables in other projects.
Original change's description:
> Add deps to enable performing the cmake build of dawn_node on CQ
>
> (and the cmake build of Dawn in general)
>
> Bug: dawn:688
> Change-Id: If7c037a03d237372739aed1f5dc78bffb7975a24
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65603
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
Bug: dawn:688
Change-Id: I81ec3d5298efea54b1417ff58569cf1c615ea372
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66400
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
depthWrite/stencilWrite in DepthStencilState in RenderPipeline
should be compatible with depthReadOnly/stencilReadOnly in
DepthStencilAttachment in RenderPass. Otherwise, you may need
to generate validation errors.
Bug: dawn:485
Change-Id: I7b541056dafc4dee4eb31f4cefbac48c0ffc4b18
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66240
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch fixes a compilation error after the CL "Avoid redundant
creation of ComputePipelineBase in GetCachedComputePipeline" is
landed after "Adds destroy handling for BindGroupLayout without
new backend changes yet" is merged into upstream.
BUG=dawn:529
Change-Id: I5dcb2370093a96703ceb0618f3590364b4eff382
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66283
Reviewed-by: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch removes a redundant creation of ComputePipelineBase object
in GetCachedComputePipeline(). Instead, we directly compute the blueprint
hash from the uninitialized backend compute pipeline object.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I9b982664aa140ab385418a202270b9988cfcb9f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66221
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
- Start tracking BindGroupLayout objects at construction
- Utilizes untrack tag for blueprint layouts for caching purposes
- Adds dawn native test file for testing utilities that require static dawn native lib
- Adds testing macros and mocks for simple sanity unit testing
Bug: dawn:628
Change-Id: Ic85b60e9574e67cc5fc1804cc5300cd1f3a0f6fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65862
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
- Renames some of the Device functions to be consistent with documentation
- Reverts change in https://dawn-review.googlesource.com/c/dawn/+/64820 for overloading mDevice == nullptr to determine if objects are alive because device is needed for error propagation. Instead, use list existence to determine if objects are alive
- Updates destroy api to return bool upwards in case we need to further process the extending objects
- Adds tracking functions in ObjectBase
- Adds final tag to all backend Device implementations
- Adds MoveInto LinkedList support to move list elements in O(1)
Bug: dawn:628
Change-Id: Iff70f4f7d55f46ee52d1bd0e02e3671819f2eed4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65861
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Bug: dawn:628
Change-Id: I1250ffe303155004572c2476ec357daa78b7bb3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65860
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
They were previously disabled due to some new Metal alignement
constraint that has now been upstreamed in WebGPU and implemented in
Dawn. So we can reenable them.
Bug: dawn:940
Change-Id: I96e5ac57342fbc0cab09989fe90a6bc4c8f9f40d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66120
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
The second parameter of NSMakeRange(NSUInteger loc, NSUInteger len) is
length, here we just need to pass queryCount.
Bug: dawn:434
Change-Id: I3dfa82e523310258c81c45c4e1c3af80a3df8704
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
`a && b` only evaluates b if a is true. `a & b` always evaluates
both a and b. If a and b are of type bool, `&&` is usually what you
want, so clang now warns on `&` where both arguments are of type bool.
From what I can tell, in Dawn it wasn't important if we evaluate both
branches or not in the places where this fired, so I went with `&&`
everywhere.
Bug: chromium:1255745
Change-Id: Ifa196a7150d5bdfb8527fe8b6f40d7e2e957d609
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66200
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
BoundArrayAccessors is an alias to Robustness, and removing it from
Tint will make code easier to read and search.
BUG=tint:1212
Change-Id: I31aabfcef396290178eff6ea8db7e5bb70b031ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66061
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Provides a place to put error messages.
Helps actually figure out when an overload doesn't match, a dictionary is missing a field, etc.
Bug: dawn:1143
Change-Id: Ibca177f9f42676061511d27898a5c522d1e6cd8f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65721
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
If the IDL provides a default value for a interface method parameter, then use that default value if no argument is provided.
Removes a bunch of std::optional<T>'s from the C++ interfaces, and simplifies binding implementations.
Also fix some defaults of buffer size from 0 to kWholeSize. This was partially done in an earlier CL, but it seems I missed a few.
Bug: dawn:1143
Change-Id: Ifc1bb29a5e7ead42dd015d2333c743165f2459a6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65663
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Check the result of std::getenv() before constructing a std::string.
std::string cannot be constructed with nullptr.
Fix ambiguous overload resolution of std::tolower(), by wrapping it in a
lambda that explicitly takes a 'char' argument.
Bug: dawn:1123
Change-Id: I8a44524a6c0e71f7d2a49a5a9f730115c32df577
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65960
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Running with too many threads can cause device initialization failures.
Bug: dawn:1143
Change-Id: Ie8010ab7a95e88f560dc14ed8b96919313218062
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65662
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Makes them appear in Object methods like length().
Fixes a number of webgpu:idl,constants,flags tests.
Bug: dawn:1123
Change-Id: I2f1baf9c3c51915ce0b0a5dc392cf86aac761676
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65661
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Includes info on how to build, known issues, remaining work.
Bug: dawn:1123
Change-Id: I0a1fe827a1aba06eea7e3574de4a7d1e0fd3f0ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65161
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Updates all validation messages in CommandValidation.cpp to give them
better contextual information.
Bug: dawn:563
Change-Id: I6af5b0a0d99218c09ef564039218b3a7fb6a74db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65607
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This reverts commit ecbdd8fbe7.
Reason for revert: https://ci.chromium.org/ui/p/chrome/builders/official.infra/chrome-branch/977/overview
AssertionError: dep:src/third_party/dawn key:cmake_version value:version:3.13.5 != version:3.16.1
Original change's description:
> Add deps to enable performing the cmake build of dawn_node on CQ
>
> (and the cmake build of Dawn in general)
>
> Bug: dawn:688
> Change-Id: If7c037a03d237372739aed1f5dc78bffb7975a24
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65603
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:688, chromium:1255538
Change-Id: I4c44b511c6fc3ff177785adcaad5f01d2857a2c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65822
Reviewed-by: Sven Zheng <svenzheng@chromium.org>
Reviewed-by: Leonard Grey <lgrey@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Updates all validation messages in CommandEncoder.cpp to give them
better contextual information.
Bug: dawn:563
Change-Id: I0aa2063c4805225a5124fdd07e350ee1a74a5f3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65609
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This is a reland of a57c1db878
in current Dawn implementation RenderPipelineGL and ComputePipelineGL
will be destroyed before calling their initialize() function when we
can find a proper pipeline object in the front-end cache, so mProgram
may not be assigned to a valid GL program ID when the destructor of
PipelineGL is called.
In this CL we always initialize mProgram to 0 in the constructor of
PipelineGL so that it won't be a garbage value in the destructor of
PipelineGL (0 is safe for glDeleteProgram() according to OpenGL SPEC).
Original change's description:
> OpenGL: delete shaders and pipelines when they are not used any longer
>
> Previously on OpenGL backend the GL pipelines and shaders are never
> deleted. With this patch the GL pipelines and shaders will be able to
> be destroyed correctly after they are not needed any longer.
>
> BUG=dawn:529
>
> Change-Id: I4f7f22c7b536825363fe1ecc0f5ffd1bb86fd774
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65140
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Stephen White <senorblanco@chromium.org>
> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Bug: dawn:529
Change-Id: Ie04ab069b9d26658f2b0d1b070d86bb650f3c878
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65486
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>