This website requires JavaScript.
Explore
Help
Sign In
encounter
/
dawn-cmake
mirror of
https://github.com/encounter/dawn-cmake.git
Watch
1
Star
0
Fork
You've already forked dawn-cmake
0
Code
Issues
Packages
Projects
Releases
Wiki
Activity
70d8711973
dawn-cmake
/
test
/
tint
/
bug
/
chromium
/
1372963.wgsl.expected.wgsl
9 lines
99 B
WebGPU Shading Language
Raw
Normal View
History
Unescape
Escape
tint: Fix C++ UB when shifting abstract 0 left by >= 64 In WGSL, we can shift left abstracts by >= 64, as long as the result is representable in the data type we choose for it. When shifting 0, we can shift by any positive u32 value (result is always 0), but in C++, it's UB to shift by more than the bit width of the data type, so we need to handle this. This bug was caught by ClusterFuzz. Bug: chromium:1372963 Change-Id: I638ca190b93538908ca6472f3735627ea8531c5a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106266 Reviewed-by: David Neto <dneto@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
2022-10-18 20:17:55 +00:00
fn
g
(
)
->
vec4
<
i32
>
{
Update lexer to not include `-` in numbers. This CL removes the parsing of a `-` in front of numerics when lexed. This will cause the number to become a UnaryOperator negation then the number instead of a negative number. Bug: tint:1679, tint:1141, tint:1570 Change-Id: I217c0ffcbe5be934c8d56bd83141b47ade83bc60 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106463 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-10-26 15:20:47 +00:00
return
(
vec4
(
-
(
0
)
)
<
<
vec4
(
2147483649
)
)
;
tint: Fix C++ UB when shifting abstract 0 left by >= 64 In WGSL, we can shift left abstracts by >= 64, as long as the result is representable in the data type we choose for it. When shifting 0, we can shift by any positive u32 value (result is always 0), but in C++, it's UB to shift by more than the bit width of the data type, so we need to handle this. This bug was caught by ClusterFuzz. Bug: chromium:1372963 Change-Id: I638ca190b93538908ca6472f3735627ea8531c5a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106266 Reviewed-by: David Neto <dneto@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
2022-10-18 20:17:55 +00:00
}
@
fragment
fn
main
(
)
{
g
(
)
;
}