mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
This CL adds `<<=` and `>>=` to the supported operators in WGSL. The ExpandCompoundAssignment transform is used to convert to the expanded form. Bug: tint:1594 Change-Id: I20519052c52d4b69bc90def1acc5c0a30c36fd8a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97980 Auto-Submit: Dan Sinclair <dsinclair@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
12 lines
218 B
Plaintext
12 lines
218 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct S {
|
|
/* 0x0000 */ int4 a;
|
|
};
|
|
|
|
void foo(device S* const tint_symbol) {
|
|
(*(tint_symbol)).a = as_type<int4>((as_type<uint4>((*(tint_symbol)).a) << uint4(2u)));
|
|
}
|
|
|