All AST transforms live inside this namespace. There will be a
corresponding ir::transform namespace for IR transforms.
Change-Id: I543972451c08e7df5632b835257999a8af3701d1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132424
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
If vertex buffer is null, SetVertexBuffer() actually unset that
buffer slot. This is a new feature in WebGPU. This change adds
validations and unittest in order to support this feature.
Bug: dawn:1675
Change-Id: Ia3e5d4196423590ff5b60ea78cc1e8cdd9c67d15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/124842
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Sets the Chromium Dawn DEPS builders to be available as
branched trybots.
Bug: chromium:1432491
Change-Id: I319e76c3c0fc7d2bc168c0fdd6c07eebd8165046
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132272
Commit-Queue: Brian Sheedy <bsheedy@google.com>
Kokoro: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@google.com>
This prepares for the addition of IR transforms. Subsequent patches
will introduce an ast::transform namespace and refactor the Transform
class into a common base class for the two types of transform.
Bug: tint:1718
Change-Id: I0088d8356341e861df68df1f4f755ee82757dd2d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132423
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
There is no `builtin` subdirectory of `ast`, and this additional
`builtin` namespaces causes awkward conflicts in a subsequent patch
that moves AST transforms under the `ast` namespace.
Change-Id: I54b11f37b686875f1dab7deb9781e978a639d6e9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132422
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Make sure we return `false` when something goes wrong during
codegen. Also, add some more TINT_ICE calls in places where we know
stuff is unimplemented. This makes it easier to track current progress
against Tint's E2E tests.
Bug: tint:1906
Change-Id: Ic5885201d7b4f286d8f282df5a2074a017a98477
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132421
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Bug: chromium:1424945
Change-Id: I033721f19f38a86056053807d15a499c0232a2ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132403
Kokoro: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This is a reland of commit e241d64d25
It adds handling and tests for internal errors in the wire
Original change's description:
> Allow internal errors for pipeline creation failure
>
> Change-Id: I6b8c109ae67e230fea3fb14511c2b3562191c0fa
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132300
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Loko Kung <lokokung@google.com>
Change-Id: Icfda2d04bbb340fc4fdacf5ae65593bf958172fb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132441
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This reverts commit e241d64d25.
Reason for revert: Missing the change to handle the enums in the wire
Original change's description:
> Allow internal errors for pipeline creation failure
>
> Change-Id: I6b8c109ae67e230fea3fb14511c2b3562191c0fa
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132300
> Kokoro: Kokoro <noreply+kokoro@google.com>
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Loko Kung <lokokung@google.com>
TBR=enga@chromium.org,noreply+kokoro@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com,lokokung@google.com
Change-Id: I12309e85e888cc400729f88bb2340e8ecdf6b798
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132440
Auto-Submit: Austin Eng <enga@chromium.org>
Kokoro: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Some drivers over-release this object when is accessed more than
once.
Bug: chromium:1443658
Change-Id: I861a74e7756dcf16b0a2d25a85bf47815b6779f0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132262
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Adds a white box test to ensure that D3D12 descriptor heap allocations
only are valid during the serial they are created on.
Bug: dawn:1701
Change-Id: I1e1587ab602d5472fbba9e751bf3cd1e6e5ead11
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132266
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This CL make sure developers are warned when zero-size dispatches and
draws occur. Even though those are valid, it is good to encourage
developers to avoid them when possible.
Bug: dawn:1786
Change-Id: I99cbe8d556569d2e779b7b9c64739c3e5da8e290
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132222
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Fr <beaufort.francois@gmail.com>
ir::Value has a virtual Type() method. Implement this on the subclasses
that actually have a type.
Removed pointless memory usage on instructions that have no value.
Also un-getter some fields to match the other IR code.
Change-Id: Ibf545a582d5cbb820410c9aaec0312692e803373
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131745
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
d3d11 doesn't allow creating a constant buffer with other GPU
accelerated usage. This CL workarounds problem by creating two
buffers one for uniform buffer usage, one for other usage, and
copy content to uniform buffer when it is needed.
Bug: dawn:1755
Bug: dawn:1798
Bug: dawn:1721
Change-Id: I26bfee1cca2204f6464ba611872c490165e97f68
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132020
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Missing utils:: namespace on TrimSuffix().
Change-Id: I184bee79dc2c807730c1be0a532b290441d5f4ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132323
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Register the name of 'var' and 'let' variables when building the IR.
Use the names of these variables when printing the disassembly.
Change-Id: I56ee24a29333f1bc8f97459bc1cfca5c3a59e79d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131741
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL adds support for the transient attachment feature and texture
usage flag to Vulkan, using the usage flag to allocate textures via
lazily-allocated memory if the latter is available.
Testing is covered by the
MultisampledRenderingWithTransientAttachmentTest now being run on
Vulkan due to transient attachments feature now being supported on
Vulkan.
Bug: dawn:1695
Change-Id: I45a04d21b1b6ea612086a368b9c77a0ff43e93f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/130180
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Adds a `Value()` method to the writer which gets the ID for a value,
which could either be a constant or an instruction result.
Bug: tint:1906
Change-Id: I57f5e0cfea1e3b8322702090714bac49d003ba75
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132285
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Bug: dawn:1685
Change-Id: I6c9da45efac12986095be5dd1a3ed2a536b76d64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132302
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Loko Kung <lokokung@google.com>
Auto-Submit: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
All instructions are unimplemented, and the only supported branch
target is the function terminator.
No new tests, as this only handles returning from an empty function.
Bug: tint:1906
Change-Id: I05cf5d252d96d37757c3ac1f84b79d0586c36b97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132283
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Use a hashmap to de-duplicate constants.
Bug: tint:1906
Change-Id: Ic2654e1819d8c3c0199ce3f723f20877495ed0f0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132282
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Change-Id: I6b8c109ae67e230fea3fb14511c2b3562191c0fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132300
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
There's a few reasons for this change:
* Not all values have identifiers, and carrying redundant fields is
inefficent.
* Not all IDs will be integers - much like LLVM IR and SPIR-V, we will
likely want to disassemble with textual identifiers, so a uint32_t
is not ideal, and a std::string is even more bloat for each value.
* Transforms don't use identifiers, but instead raw pointers. We don't
want to encourage using IDs as they're simply a less-efficient way to
refer to values.
* This makes values consistent with types and flow-control blocks, as
they will both have their disassembly ID generated by the
disassembler.
The next step will be to add a hashmap to the module so that
pre-declared value names can be stored out-of-band.
Bug: tint:1718
Change-Id: I80beafc165f2bde54cc44a91015776926ca952b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131740
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Change-Id: I4f8ff98b980d9dd9a89e7e4407f6e1cbd1eaaf0a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132320
Kokoro: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: James Price <jrprice@google.com>