Enables the 'chromium_experimental_full_ptr_parameters' extension to
allow passing of uniform, storage and workgroup address-spaced
pointers as parameters, as well as pointers into sub-objects.
Bug: tint:1758
Change-Id: I8c85e6104ef4f2b9a177dec2857b1bf7f5148212
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103860
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Overriding the alignment to 1 would cause nested structures to be
incorrectly laid out. The fix: Don't override the alignment.
All struct layout validation works on the sem offsets, so none of this
has to change.
Bug: tint:1776
Change-Id: Ic01d45fb2790cd823ed9a55e336860ebdc351aea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112603
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
We use WGSL to visualize the AST. Make sure we don't hide anything.
Bug: tint:1776
Change-Id: Iedd7ca797fb745d9db7d0aba8a5718039241afbb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112602
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
This CL fix the extractBits polyfill, used for D3D12 backend on windows.
With this patch the related CTS would get pass.
Fixed: tint:1775
Change-Id: I15636bb55af502fff773c19f03b4c3c9e99b63fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112207
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Adds functionality to Dawn and Tint to rotate and flip-Y external
textures through the shader transform. Tests are included.
Bug: chromium:1316671
Change-Id: I40a6b67eaeb2a348f469e4879eeb585bc40537b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110181
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL adds const-eval for the `normalize` builtin.
Bug: tint:1581
Change-Id: I6d5ba3e0ba507921137ca90c4caefa9daf88f735
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111740
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL adds const-eval for the `fma` builtin.
Bug: tint:1581
Change-Id: Ia4df818fec9d5d969b364b2c165400d787a9e275
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111584
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This CL adds const-eval for the `distance` builtin.
Bug: tint:1581
Change-Id: Iee3af6474ace8e7baa230156f582f0a372f77cb7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111583
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL adds const-eval for the `inverseSqrt` builtin.
Bug: tint:1581
Change-Id: Ieef063416a8033b5fac9396e30c76c20b3360a90
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111581
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL implements f16 in uniform and storage address space, allowing
using f16 types in uniform and storage buffers on all backends. Tint
uint tests and Dawn E2E tests are added to validate the f16 types work
as expected.
Bug: tint:1473, tint:1502
Change-Id: I15e3de1033d3727f2ea33f4657f682c5f13c2153
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106320
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Check that these work as a mix of constant and runtime.
Bug: tint:1581
Change-Id: I572122d9425c4bb8e60125879f9829d765580d1f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111243
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL removes support or if-break and requires the use of break-if.
Bug: tint:1724
Change-Id: I8311de2f0ce11b5af7fada71d258ae441f9e42f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111100
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL updates the SPIRV-Reader to emit `break-if` nodes instead of
`if-break` statements.
Bug: tint:1724
Change-Id: I8cd568f5e90a950acc5a42a470345273a5f1e6bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111103
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Update CreateASTTypeFor() to handle a potential edge-case described in tint:1764.
We haven't seen this issue happen in production, nor can I find a way to trigger this with the tint executable, but try to handle this before we encounter a nasty bug.
Fixed: tint:1764
Change-Id: I496932955a6fdcbe26eacef8dcd04988f92545a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111040
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL adds const-eval for `degrees` and `radians`.
Bug: tint:1581
Change-Id: I7f00e2b1e5ab7c8e895680a6b75b9531dac31f5a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110601
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
There's a reason the overload of `ctx.Replace()` that takes a pointer to the replacement is deprecated - it doesn't play well when used as part of another replacement.
Switch to using the callback overload of Replace() to fix bad transform output.
Bug: tint:1386647
Change-Id: I94292eeb65d24d7b2446b16b8b4ad13bdd27965a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111000
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This is a catch-all that handles all cases where an operation can result
in non-finite values, such as from calls to std::cosh and std::sinh.
Bug: tint:1581
Bug: tint:1747
Change-Id: Ibb55466fea01b263c98d598459c788fd22cf5bb7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110726
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
With this CL, binary ops add, subtract, multiply, and divide of concrete
values will now produce an error if the result is inf/NaN, as it was
doing with abstract values. This also affects the cross builtin, which
is written in terms of subtract and multiply.
Bug: tint:1581
Bug: tint:1747
Change-Id: Ib1d0d8deddc82c67ab53729a6011937636fcc1a5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110163
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This CL adds const-eval for `min` and `max`.
Bug: tint:1581
Change-Id: Ica68ba312f21767c46d57d83570ddc72ee857231
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110166
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL removes support for fallthrough from the SPIRV-Reader.
Bug: tint:1644
Change-Id: I80b63d627960a82ba90de83af407c539b0442080
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109004
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
We cannot explicitly name the result type of this builtin, so we have
to redeclare it manually.
Fixed: oss-fuzz:53347, oss-fuzz:53343
Change-Id: I23816b8b35eb20ae91472143ab30668b573d65bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110160
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: James Price <jrprice@google.com>
Passing a dereferenced value from Hashmap::Find() directly into Hashmap::Add() is a potential cause of UAF, as the insertion may reallocate the map, invalidating the input reference.
I'll try to think of ways to make this foot-gun harder to do, but this CL fixes the immediate bug found by fuzzers.
Bug: chromium:1383755
Change-Id: I4f8b2fcb0745b008a47ef9947c330afb9ac4e78f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110020
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This CL adds const-eval for `tan` and `tanh`.
Bug: tint:1581
Change-Id: I3d3506a6e7462bba1557cb88065d696ddc21b0f6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109562
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This CL adds const-eval for `cos` and `cosh`.
Bug: tint:1581
Change-Id: I8df8f979a7b351288cadccda88940fdb5a20d18f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109561
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This CL adds const-eval for `sin` and `sinh`.
Bug: tint:1581
Change-Id: I96345378c826e2c49ffae688b5185764019967d5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109560
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This CL adds const-eval for the `acosh` test case. The generation of
`f16` values into test files is also fixed because `acosh` requires the
value to be `>= 1.0`
Bug: tint:1581
Change-Id: Iba2ca4d9d114034845475679346f042c8c66e571
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109341
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
The generator script was not using the test values for `f16`, they
always got a zero initialization. This CL fixes the script to generate
`f16` values.
Change-Id: I95e8f2c7007251a646de05b4f7fe0aad14e740f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109342
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>