dawn-cmake/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.glsl
James Price 0e1f57cbc2 glsl: Implement compound assignment
Use the ExpandCompoundAssignment transform to convert compound
assignments to regular assignments.

Bug: tint:1325
Change-Id: I0567131aa7c6b4beb6e25c0c6c559795e9c58c19
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85286
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-03-31 22:30:10 +00:00

30 lines
598 B
GLSL

#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void unused_entry_point() {
return;
}
struct S {
ivec4 a[4];
};
int counter = 0;
int foo() {
counter = (counter + 1);
return counter;
}
int bar() {
counter = (counter + 2);
return counter;
}
void tint_symbol() {
S x = S(ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0)));
int tint_symbol_3 = foo();
int tint_symbol_1_save = tint_symbol_3;
int tint_symbol_2 = bar();
x.a[tint_symbol_1_save][tint_symbol_2] = (x.a[tint_symbol_1_save][tint_symbol_2] + 5);
}