Commit Graph

3062 Commits

Author SHA1 Message Date
Shrek Shao f4c8a6ac9b Mark pipeline overridable constants as unsafe
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>
2021-10-26 02:06:36 +00:00
Austin Eng ec60b17964 Revert "Disable DrawIndexedIndirect"
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>
2021-10-25 16:16:53 +00:00
Ben Clayton 066ab14e34 wgsl: Remove unnecessary phony-assignments
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>
2021-10-25 15:27:52 +00:00
Ben Clayton 5c4ce7bd9b wgsl: Migrate from ignore() to phony-assignment
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>
2021-10-25 15:14:23 +00:00
Brandon Jones eb0d900506 Improving Metal backend validation messages.
Improves validation messages in various Metal backend files:

 - SamplerMTL.mm
 - ShaderModuleMTL.mm
 - SwapChainMTL.mm
 - TextureMTL.mm

Bug: dawn:563
Change-Id: I076c08bb3dbecc430d5d4d7fbfeea48166070688
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67320
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-10-22 17:39:20 +00:00
Brandon Jones 4ce84fcfe1 Improving Vulkan backend validation messages.
Improves validation messages in various Vulkan backend files:

 - vulkan/DeviceVk.cpp
 - vulkan/ShaderModuleVk.cpp
 - vulkan/SwapChainVk.cpp
 - vulkan/TextureVk.cpp
 - vulkan/external_memory/MemoryServiceDmaBuf.cpp
 - vulkan/external_memory/MemoryServiceOpaqueFD.cpp
 - vulkan/external_memory/MemoryServiceZirconHandle.cpp
 - vulkan/external_semaphore/SemaphoreServiceFD.cpp
 - vulkan/external_semaphore/SemaphoreServiceZirconHandle.cpp

Bug: dawn:563
Change-Id: I521fecc29e7919413aa6210eff050848689296a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67122
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-10-21 23:45:54 +00:00
Brandon Jones c19f27b80d Revert "Improve validation errors for encoders"
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>
2021-10-21 23:14:54 +00:00
Antonio Maiorano ceb46e788c dawn_node: add "enable/disable-dawn-features=<comma-separated-values>"
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>
2021-10-21 23:02:34 +00:00
Antonio Maiorano c6745901f0 dawn_node: add "dlldir=<path>" flag
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>
2021-10-21 21:46:44 +00:00
Antonio Maiorano 821f1a8a60 dawn_node: add "dawn-backend=<value>" flag
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>
2021-10-21 20:56:34 +00:00
Brandon Jones 1d55306255 Improving D3D12 backend validation messages.
Improves validation messages in various D3D12 backend files:

 - CommandBufferD3D12.cpp
 - ShaderModuleD3D12.cpp
 - SwapChainD3D12.cpp
 - TextureD3D12.cpp

Bug: dawn:563
Change-Id: I00607012f5bec81780c419993fc32dc0984dad27
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67143
Commit-Queue: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-10-21 20:21:54 +00:00
Antonio Maiorano e772615b53 dawn_node: add support for input flags
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>
2021-10-21 19:34:34 +00:00
Brandon Jones 7dc906a4c9 Improve validation messages for surface/swap chain
Updates validation messages with more contextual information in:
 - ChainUtils.h
 - Device.cpp
 - SpirvValidation.cpp
 - Surface.cpp
 - SwapChain.cpp

Bug: dawn:563
Change-Id: I486512791caaf1acf4607539aa5ad11daf1ab9be
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67140
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-10-21 19:25:04 +00:00
Brandon Jones fc5cae6a19 Improving OpenGL backend validation messages.
Improves validation messages in various OpenGL backend files:

 - BackendGL.cpp
 - BindGroupGL.cpp
 - CommandBufferGL.cpp
 - DeviceGL.cpp
 - PipelineGL.cpp
 - QueueGL.cpp
 - ShaderModuleGL.cpp

Bug: dawn:563
Change-Id: Idd5751b6f68ea435e5f3c045dcbfd0e5c049fce6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67144
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@google.com>
2021-10-21 16:37:45 +00:00
Aleksi Sapon 08b9654751 Zero the index offsets before an indirect draw
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>
2021-10-21 14:29:44 +00:00
Austin Eng 05a3187b41 Revert "Populate some D3D12 limits from the backend"
This reverts commit aa8fcfc64b.

Reason for revert: Failing the Dawn->Chromium roll
https://ci.chromium.org/ui/p/chromium/builders/try/dawn-win10-x86-deps-rel/18903/overview

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>

TBR=cwallez@chromium.org,enga@chromium.org,rafael.cintron@microsoft.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I17b44455f3b46f1855ab59808ece1e11bf73275d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:685
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67141
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-10-20 21:19:49 +00:00
Brandon Jones 520539f8f9 Various validation error improvements
A grab bag of validation error message improvements in the following
files:

 - Adapter.cpp
 - BackendConnection.cpp
 - BindGroup.cpp
 - CommandBuffer.cpp
 - CommandBufferStateTracker.cpp
 - ComputePipeline.cpp
 - Device.cpp
 - Instance.cpp
 - Limits.cpp
 - Queue.cpp

Bug: dawn:563
Change-Id: Ied9f660fc22302d3fd5af4796de32efec529ca05
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67001
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-10-20 17:42:38 +00:00
Brandon Jones c7e6bb0d8d 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>
2021-10-20 17:13:48 +00:00
Austin Eng aa8fcfc64b 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>
2021-10-20 16:32:48 +00:00
Jiawei Shao 1349ca182e D3D12: Support [[num_workgroups]] for Dispatch
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>
2021-10-20 00:58:48 +00:00
Austin Eng d97b29cd86 Populate supported Vulkan limits from the backend
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>
2021-10-19 22:52:14 +00:00
Loko Kung bf9b3cc5a9 Moves DestroyApiObject call into ApiObjectBase::DeleteThis
- 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>
2021-10-19 22:43:13 +00:00
Ben Clayton 74635bc6e9 dawn_node: Use the new CTS server runner
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>
2021-10-19 21:27:23 +00:00
Yunchao He d2c9cd369d Add validation rule for depth/stencil between bundle and pass
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>
2021-10-19 21:10:23 +00:00
Ben Clayton 4168780f81 dawn_node: Run CTS serially if --j 0 is specified
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>
2021-10-19 20:32:32 +00:00
Ben Clayton 06b827ee92 dawn_node: Only rebuild CTS if something has changed
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>
2021-10-19 20:07:15 +00:00
Antonio Maiorano 1bf932e7b4 D3D12: dump disassembled DXBC when dump_shaders is enabled
Useful for debugging FXC bugs.

Bug: dawn:1162
Change-Id: If4fc7d0f16370d15235a6c872309fe1536dd9edc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66900
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-10-19 19:42:22 +00:00
Ben Clayton e9cbd4896a dawn_node: Track promises
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>
2021-10-19 19:18:42 +00:00
Ben Clayton 0e3d4fcbd4 dawn_node: Prevent setImmediate() being queued multiple times
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>
2021-10-19 18:42:29 +00:00
Brandon Jones 538f795e6c Improve errors in BindGroupLayout, BindingInfo
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>
2021-10-19 16:14:51 +00:00
Austin Eng 26ae0ea4c5 Add tests for some limits
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>
2021-10-19 16:06:21 +00:00
Peter Kasting 40b73c646e Fix an unused variable warning on Android.
Bug: chromium:1203071
Change-Id: Iebd5443626f5dbfafc4e01c77190b67d1ef5f7aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66800
Commit-Queue: Peter Kasting <pkasting@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Peter Kasting <pkasting@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-10-18 20:14:11 +00:00
Yunchao He e43eaabac9 Add validation rule for depth/stencil between pipeline and render bundle
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>
2021-10-18 16:57:31 +00:00
Zhaoming Jiang 2a5b981a87 Deprecation of using 0 as default size in buffer mapAsync
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>
2021-10-18 05:30:39 +00:00
Yunchao He 79d2099125 Add depth/stencilReadOnly and validations in RenderBundleEncoderDescriptor
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>
2021-10-15 16:56:13 +00:00
James Price 17dd734e54 dawn_node: Document `npm install` step for CTS
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>
2021-10-15 16:40:12 +00:00
Austin Eng 4948c81344 Reland "Add deps to enable performing the cmake build of dawn_node on CQ"
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>
2021-10-15 14:28:32 +00:00
Yunchao He daffd22b68 Add validation rule for depth/stencil between pipeline and pass
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>
2021-10-14 04:09:21 +00:00
Austin Eng 91851e23a8 Remove several compile-time constants in favor of limits
Bug: dawn:685
Change-Id: Ifac25116c741fdab7b6a8093b4230065beca4773
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65483
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-10-13 18:57:18 +00:00
Jiawei Shao e0390b8967 Fix compilation error after ComputePipelineBase becomes virtual
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>
2021-10-13 04:19:26 +00:00
Jiawei Shao 8fd1eb5443 Avoid redundant creation of ComputePipelineBase in GetCachedComputePipeline
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>
2021-10-13 00:43:05 +00:00
Loko Kung 2f3fe95ad5 Adds destroy handling for BindGroupLayout without new backend changes yet.
- 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>
2021-10-12 18:53:57 +00:00
Loko Kung fc5a7d414f Adds remaining setup logic to implement destroy in Device and ObjectBase.
- 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>
2021-10-12 17:46:26 +00:00
François Beaufort a4c8c8d5bf Remove "extension"
Now that Chrome uses [1] "feature" instead of "extension", this CL
removes all occurrences of "extension".

[1] https://chromium-review.googlesource.com/c/chromium/src/+/3205514

Change-Id: Ibbaaf5d6e99be62453604c71d8110eea9820c803
Bug: dawn:1149
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65900
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-10-12 13:21:56 +00:00
Loko Kung 6fd28ba4cb Adds iterators and a check to avoid segfault when removing node in LinkedList.
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>
2021-10-11 23:29:30 +00:00
Ben Clayton 34206ec07b dawn_node: Use wgpu::SupportedLimits
Query the Adapter / Device for limits instead of hardcoding them.

Bug: dawn:1143
Change-Id: Ib6d47bdb81df8e5e6eb767d35d346bbf34c5877a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65722
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-10-11 15:42:12 +00:00
Corentin Wallez 008cba9b29 Reenable timestamp queries on Metal macOS 11
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>
2021-10-11 13:50:29 +00:00
Corentin Wallez 2d1762049b Make Dawn's feature name casing match WebGPU (- instead of _)
Bug: dawn:550
Change-Id: I1017b4a2e93a75925e8762f2d09ace9a8d5d7b49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65802
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: François Beaufort <fbeaufort@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-10-11 10:18:09 +00:00
Li Hao daf1cdbb28 Fix resolve range of resolveQuerySet on Metal
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>
2021-10-11 09:09:22 +00:00
Nico Weber 9a8099eb8b Fix Wbitwise-instead-of-logical warnings
`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>
2021-10-08 14:39:39 +00:00