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>
The CTS has been changed to use the version of SPIR-V that spvc is
expecting, so the issues that previously caused a rollback should no
longer occur.
BUG=dawn:337
Change-Id: Ied5c39059d417359a697930287728faf57289c62
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16900
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This CL sets the root folder to be used by the linter when determining
header guards.
Bug: tint:23
Change-Id: I52ce8d3cd67e9882d4ea8a2c9cbd2d5d5650d5b7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17205
Reviewed-by: David Neto <dneto@google.com>
This CL adds MemberAccessor handling into the WGSL generator.
Bug: tint:4
Change-Id: Ib84f9ca1969fec48f167433af957dc1ed4de3415
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17063
Reviewed-by: David Neto <dneto@google.com>
This CL adds Cast Expression emission to the WGSL generator.
Bug: tint:4
Change-Id: Ib48290d53423be5770cfb8f1b5f1ccb93b53a4df
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17062
Reviewed-by: David Neto <dneto@google.com>
This CL adds call expressions to the WGSL writer support.
Bug: tint:4
Change-Id: I1caa2f5f81ac2e2ab89755c1721e96d44c331853
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17060
Reviewed-by: David Neto <dneto@google.com>
This CL adds 'as' generation into the WGSL generator.
Bug: tint:4
Change-Id: Ica9e615e30aae1882681d8da74b26a51cff6dc30
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16880
Reviewed-by: David Neto <dneto@google.com>
This makes it easier to find and track tests as the generator grows.
Bug: tint:4
Change-Id: I9660e459f3ffd33f3048a331f23623318af013e0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16840
Reviewed-by: David Neto <dneto@google.com>
This makes it easier to see the bug.
Bug: tint:22
Change-Id: Ic5acc0b8299ef31eb73b49863bc42ac09de6e9bf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17203
Reviewed-by: dan sinclair <dsinclair@google.com>
This CL extends the WGSL writer to output ArrayAccessorExpression the
initializers are also output so we can test the array[5] syntax..
Bug: tint:4
Change-Id: I560ca6af4d714e13b136f6ded2fb3329e309c9ca
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16820
Reviewed-by: David Neto <dneto@google.com>
This adds parity for reflection features in the spvc-only code path up
to 421684f. Additionally changes will be needed to bring support to
parity up to HEAD.
BUG=dawn:337
Change-Id: I2143587c54018da766934fa60d80aedd1ccd151b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17165
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This CL extends the build options to Tint to make the various readers
and writers all optional.
Change-Id: I913e1830b1bb2243eff5deb4b8079ba592dd52e1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16801
Reviewed-by: David Neto <dneto@google.com>
CopyResource may only be used for resources that have exactly the same
format, dimension, mips, layers. And it can only be used if the entire
texture region is copied.
Bug: dawn:353
Change-Id: Ia8f96cc10c88fe026e23bce2d0532624725b12e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/16984
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This CL creates the skeleton for the SPIR-V writer.
Bug: tint:5
Change-Id: I849d8766d32d48314a51096710272f9821e2c1c4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16641
Reviewed-by: David Neto <dneto@google.com>
The `assert` will compile out in Release builds so we don't actually
parse the module, which means we're always testing against an empty
module and the tests fail.
Bug: tint:22
Change-Id: I49a1f8fc8ec6231a65f4f17e385cff576c4f0d06
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17204
Reviewed-by: David Neto <dneto@google.com>
The roll in Chromium is failing, because Dawn doesn't handle all of the new enum
values, but I cannot land the 'proper' fix in Dawn, because Chromium doesn't yet
know about the new enum values. Yay, cross dependencies.
So my solution is land the default case in Dawn, land the DEPS roll in Chromium,
then patch in the 'proper' cases in Dawn.
Roll third_party/shaderc/ a7657e4fa..95185d920 (2 commits)
a7657e4fa2..95185d920a
$ git log a7657e4fa..95185d920 --date=short --no-merges --format='%ad %ae %s'
2020-03-17 rharrison Rolling 4 dependencies (#1002)
2020-03-16 rharrison Add reflection support for storage textures (#1001)
Created with:
roll-dep third_party/shaderc
Change-Id: Id73b38643d9a6d418be9c75e218fdad7a18839bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17164
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>