ErrorData should not be discarded. The error must be handled.
Bug: chromium:1063810
Change-Id: I55e782e499f307b91790db10a42878afdc7540dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17501
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is a regression that was caught by the WebGPU CTS after
https://dawn-review.googlesource.com/c/dawn/+/17240 where the
BindGroupLayout validation was changed to use a set, and the check for
KMaxBindingsPerGroup removed.
This CL also adds a regression test.
Bug: dawn:354
Change-Id: I0cda545b9df7220ca53216878cf24ac8ce880648
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17620
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This CL starts the emitting of SPIR-V types. This CL adds code to emit
the `AliasType`, `BoolType`, `F32Type`, `I32Type`, `MatrixType`,
`U32Type`, `VectorType` and `VoidType`.
Bug: tint:5
Change-Id: Ic13026ca9006fc0a253d019b1a6dd984ae992fba
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17561
Reviewed-by: David Neto <dneto@google.com>
Define the ID targeted by the entry point. Do this to avoid
asserts in the optimizer code
Bug: tint:3
Change-Id: Idbd4c8a058f2d51ff44696d2029502044d01b424
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17562
Reviewed-by: dan sinclair <dsinclair@google.com>
This reverts commit 7c24b6b2ff.
Reason for revert: We can reland this CL now as the fix in shaderc has
been merged.
Note that the declaration whether a storage texture is multisampled or not
cannot be extracted correctly in SPVC. The fix in Dawn will be added after
it is fixed in shaderc.
Original change's description:
> Revert "Check bind group layout with storage texture in pipeline descriptors"
>
> This reverts commit 63f2666ee7.
>
> Reason for revert: causes failures in dawn_unittests after Dawn uses SPVC by default. We need a fix in both SPVC and this CL before re-landing.
>
> Original change's description:
> > Check bind group layout with storage texture in pipeline descriptors
> >
> > This patch adds all the validations on the use of bind group layout with
> > read-only storage texture and write-only storage texture in the creation
> > of pipeline objects.
> >
> > 1. GPUBindGroupLayout.bindingType must match the type of the storage
> > texture variable (read-only or write-only) in shader.
> > 2. GPUBindGroupLayout.storageTextureFormat must be a valid texture
> > format that supports STORAGE usage.
> > 3. GPUBindGroupLayout.storageTextureFormat must match the storage
> > texture format declaration in shader.
> > 4. GPUBindGroupLayout.textureDimension must match the storage texture
> > dimension declared in shader.
> >
> > BUG=dawn:267
> > TEST=dawn_unittests
> >
> > Change-Id: Ifa3c2194dc76de14f790a0a73868e69bbb31c814
> > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17167
> > Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
> > Reviewed-by: Kai Ninomiya <kainino@chromium.org>
>
> TBR=cwallez@chromium.org,kainino@chromium.org,yunchao.he@intel.com,jiawei.shao@intel.com,shaobo.yan@intel.com,hao.x.li@intel.com,enga@chromium.org,jiajie.hu@intel.com
>
> Change-Id: Idb4083b11f22fa7e4c5c8477bc4b65b58900746e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: dawn:267
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17380
> Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
TBR=cwallez@chromium.org,kainino@chromium.org,yunchao.he@intel.com,jiawei.shao@intel.com,shaobo.yan@intel.com,hao.x.li@intel.com,enga@chromium.org,jiajie.hu@intel.com
Bug: dawn:267, chromium:1063570
Change-Id: If762cbb206e738f4e54e75c88d506fdf3a44f280
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17461
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This Cl adds utility classes to dump out SPIR-V disassembly of the
builder and instructions.
Bug: tint:5
Change-Id: Ib4c57025ac63cb0be456bd819461c98ffa94367f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17560
Reviewed-by: David Neto <dneto@google.com>
(Manual)?SwapChainTests had a narrowing conversions from double to float
Bug: dawn:269
Change-Id: I5b07f53556fa5461877631904fa2c1ab6c8e6596
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17540
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This Cl adds error messages into the SPIR-V generator.
Bug: tint:5
Change-Id: I45c0d286dd8ec251773ff5e036322090647d780c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17521
Reviewed-by: David Neto <dneto@google.com>
This CL updates the SPIR-V generator to create entry point instructions.
Bug: tint:5
Change-Id: I04394bd508c0871ae9563cc811b4e49e42c2bb3a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17322
Reviewed-by: David Neto <dneto@google.com>
Also removes a MaybeError from a function that can't return errors.
Bug: chromium:1063810
Change-Id: I9125b2b164a2892006442e26d6070d226fec8665
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17481
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
SPVC only allows SPIR-V 1.0 while WebGPU samples and other existing
content outputs SPIR-V 1.3. Turning SPVC on by default broke all of
them, so we disable SPVC until we decide what to do.
Bug: chromium:1063810
Change-Id: Iedcf31960eb25b0974e8c67030232902cd58a4a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Also fixes a bug where we weren't validating duplicating
bindings in the shader, and where dynamic offset validation
could be incorrectly fetching the wrong bindings.
Bug: dawn:354
Change-Id: I93178c34eb4d43119e8b9de5738ae4596e9277cd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17240
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This CL updates the SPIR-V generator to only create the GLSL import if
it's requested.
Bug: tint:5
Change-Id: I96a9100adf0a0c59dcdd82c12ac27c566ea2663f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17341
Reviewed-by: David Neto <dneto@google.com>
A Namer is a place for saving and looking up names
based on SPIR-V IDs.
Bug: tint:3
Change-Id: I6aeb2f5f7ba63c2e0a816dcbac88f964beafabc6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17284
Reviewed-by: dan sinclair <dsinclair@google.com>
This Cl adds functions to the WGSL generator.
Bug: tint:4
Change-Id: Ibc7d27597c6c0d63c82931d0fa016856359d21b5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17340
Reviewed-by: David Neto <dneto@google.com>
This CL adds emitting of if statements to the WGSL generator.
Bug: tint:4
Change-Id: Ie79b40779a028dd40eac99c5459c971ead6cc43e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17286
Reviewed-by: David Neto <dneto@google.com>
This Cl updates the WGSL writer to generate else statements.
Bug: tint:4
Change-Id: I72f6bbb6a2ab00bec3933083fd12c5da1a3dd5f8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17285
Reviewed-by: David Neto <dneto@google.com>
This CL emits the loop statement from the WGSL generator.
Bug: tint:4
Change-Id: I45be066ed306a71df053f7e61e6201a10a3d1056
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17283
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL generator to output switch statements.
Bug: tint:4
Change-Id: I4450b10932960691c76e76869105ade01fdd5a79
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17282
Reviewed-by: David Neto <dneto@google.com>
This Cl updates the WGSL writer to output variable statements.
Bug: tint:4
Change-Id: Ic557ea0c1b366644a8496dd43e4cfd85b9e8a84f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17281
Reviewed-by: David Neto <dneto@google.com>
This CL adds unless statement to the WGSL generator.
Bug: tint:4
Change-Id: Id171cb1438d290938f1da946c23992bdae688359
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17280
Reviewed-by: David Neto <dneto@google.com>
This Cl updates the WGSL writer to emit the regardless statement.
Bug: tint:4
Change-Id: Iab35f3f0d956bd6cdd1411a06b4ca022147b0f87
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17261
Reviewed-by: David Neto <dneto@google.com>
This CL adds emitting return statements into the WGSL writer.
Bug: tint:4
Change-Id: Ia2331f7c20e3a3e3af1aa1553cef83bec315eae3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17260
Reviewed-by: David Neto <dneto@google.com>
This CL adds the Kill, Nop and Fallthrough statements to the WGSL
writer.
Bug: tint:4
Change-Id: Ic0c635cfa7ca4c3195c593b119f9436ffeb1f9dc
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17201
Reviewed-by: David Neto <dneto@google.com>
This Cl adds support for emitting the WGSL continue statement.
Bug: tint:4
Change-Id: I20f87d46e707bdd7ae2a517983e779988892c445
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17200
Reviewed-by: David Neto <dneto@google.com>
This CL adds case statements to the WGSL generator.
Bug: tint:4
Change-Id: Ic7945646d79b7c3e9e1cb1cf57d1633a28f45fc0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17180
Reviewed-by: David Neto <dneto@google.com>
This CL adds emitting of the break statement to the WGSL writer.
Bug: tint:4
Change-Id: Iceae8cf8c1c77d63455621ea23f566af57c9e717
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17163
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL writer to emit the assignment statement nodes.
Bug: tint:4
Change-Id: I8a52f4e96c61ecb9e97cd3da41f4a1aa718e8d37
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17162
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL generator to emit the UnaryOpExpression node.
Bug: tint:4
Change-Id: I54046b5238a45994f7a4ed27941bd22b0c75f836
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17161
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL generator to output UnaryMethodExpression
nodes.
Bug: tint:4
Change-Id: If43c0e5c12a967f08cc23e816d292353490404cf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17160
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL writer to emit the unary derivative expression.
Bug: tint:4
Change-Id: I18c0fd56d88f98a6c5d37e176d98ab7b3077a50c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17120
Reviewed-by: David Neto <dneto@google.com>
This CL updates the WGSL writer to emit the relational expressions.
Bug: tint:4
Change-Id: I2b2f5e40f2091ce2b7715773f3811aed7ed61f6a
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17100
Reviewed-by: David Neto <dneto@google.com>
The webgpu.h surface-based swapchains are implement on Metal which
required adding the present mode to NewSwapChainBase.
Additional automated tests are added which require getting the Instance
so a new getter is added to DawnTest. Additional some the state tracking
of swapchains is performed in the backend, so the
SwapChainValidationTests are turned into regular DawnTests so they can
check backends do the correct state tracking. To not lose coverage of
the Null backend, a NullBackend() DawnTestParam factory is added.
Finally swapchains cannot be entirely tested in an automated fashion, so
a new example is added called "ManualSwapChainTests" that allows
manually checking a number of properties. Documentation of the controls
and a manual test plan is in a comment at the top of the example's
source.
Bug: dawn:269
Change-Id: If62fffc29a6cefdbec62747d01c523e2a5475715
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17181
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
They were failing because services of the Metal backend like the
MapRequestTracker thought that work was still pending since the device
only waited for previous commands to complete, and not also pending
commands.
Bug: dawn:68
Change-Id: I917ecefe90707b0c89f7e9b4b7379a98ed3956d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17320
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This reverts commit 63f2666ee7.
Reason for revert: causes failures in dawn_unittests after Dawn uses SPVC by default. We need a fix in both SPVC and this CL before re-landing.
Original change's description:
> Check bind group layout with storage texture in pipeline descriptors
>
> This patch adds all the validations on the use of bind group layout with
> read-only storage texture and write-only storage texture in the creation
> of pipeline objects.
>
> 1. GPUBindGroupLayout.bindingType must match the type of the storage
> texture variable (read-only or write-only) in shader.
> 2. GPUBindGroupLayout.storageTextureFormat must be a valid texture
> format that supports STORAGE usage.
> 3. GPUBindGroupLayout.storageTextureFormat must match the storage
> texture format declaration in shader.
> 4. GPUBindGroupLayout.textureDimension must match the storage texture
> dimension declared in shader.
>
> BUG=dawn:267
> TEST=dawn_unittests
>
> Change-Id: Ifa3c2194dc76de14f790a0a73868e69bbb31c814
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17167
> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
TBR=cwallez@chromium.org,kainino@chromium.org,yunchao.he@intel.com,jiawei.shao@intel.com,shaobo.yan@intel.com,hao.x.li@intel.com,enga@chromium.org,jiajie.hu@intel.com
Change-Id: Idb4083b11f22fa7e4c5c8477bc4b65b58900746e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:267
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17380
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch adds all the validations on the use of bind group layout with
read-only storage texture and write-only storage texture in the creation
of pipeline objects.
1. GPUBindGroupLayout.bindingType must match the type of the storage
texture variable (read-only or write-only) in shader.
2. GPUBindGroupLayout.storageTextureFormat must be a valid texture
format that supports STORAGE usage.
3. GPUBindGroupLayout.storageTextureFormat must match the storage
texture format declaration in shader.
4. GPUBindGroupLayout.textureDimension must match the storage texture
dimension declared in shader.
BUG=dawn:267
TEST=dawn_unittests
Change-Id: Ifa3c2194dc76de14f790a0a73868e69bbb31c814
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17167
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>