commit | eab1f626295c64225e95862b35e2a359559bbdc7 | [log] [tgz] |
---|---|---|
author | Antonio Maiorano <amaiorano@google.com> | Wed Feb 01 15:46:34 2023 +0000 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Feb 01 15:46:34 2023 +0000 |
tree | 04a6568d5a387a6de5fc4a0df7a5547c5cfb1fe3 | |
parent | 98bd83a8fca4b358885ea77a17faa2c4a8a7a768 [diff] |
tint/hlsl: for default-only switch, only emit condition if it has side-effects This fixes edge-cases, like the condition expression being a type-cast, which DXC apparently sees as a variable re-declaration. Example: fn foo(x : f32) { switch (i32(x)) { default { } } } was emitted as HLSL: void foo(float x) { int(x); do { } while (false); } The `int(x)` is seen as a re-declaration of `x` by DXC. We fix this by only emitted the condition expression if it has side-effects (which currently means it contains a call expression). Bug: tint:1820 Change-Id: I7e4320fa09ea2d634c9e324cb0b752b0ee7dcde9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118161 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Dawn is an open-source and cross-platform implementation of the work-in-progress WebGPU standard. More precisely it implements webgpu.h
that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h
version that Dawn implements.webgpu.h
.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
(TODO)
Apache 2.0 Public License, please see LICENSE.
This is not an officially supported Google product.