mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
tint: Add a negation operator to Number
Use this for expressing negative i32s. Replacing `i32(-123)` with `-123_i` is more readable as the former looks like it should be generating a WGSL cast, which it does not. Bug: tint:1504 Change-Id: Iead3885b903e1f707b8a7e6b9090d65930df118e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89401 Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
17fa42d527
commit
636e3d0111
@@ -991,7 +991,7 @@ TEST_F(InspectorGetConstantIDsTest, U32) {
|
||||
|
||||
TEST_F(InspectorGetConstantIDsTest, I32) {
|
||||
AddOverridableConstantWithID("foo", 1, ty.i32(), nullptr);
|
||||
AddOverridableConstantWithID("bar", 20, ty.i32(), Expr(i32(-42)));
|
||||
AddOverridableConstantWithID("bar", 20, ty.i32(), Expr(-42_i));
|
||||
AddOverridableConstantWithID("baz", 300, ty.i32(), Expr(42_i));
|
||||
|
||||
Inspector& inspector = Build();
|
||||
|
||||
Reference in New Issue
Block a user