12739dffec
Previously, SKSL_INT was limited to an int32_t, so we couldn't differentiate between -1 and 4294967295. We could paper over the difference in some cases by relying on the expression's type, but this was imperfect and left us unable to differentiate between an overflow and valid results. SKSL_INT is now an int64_t; the code has been updated to fix bugs that shook out as a result of the change. This isn't a complete solution for overflow handling. There are still lots of obvious places for improvement--e.g. constant folding can easily overflow, and statements like `byte x = 1000;` are still happily accepted. Change-Id: I30d1f56b6f264543f3aa83046f43c2eb56d5fce4 Bug: skia:10932 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345173 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
24 lines
348 B
GLSL
24 lines
348 B
GLSL
|
|
void main() {
|
|
int i1 = 0;
|
|
i1++;
|
|
int i2 = 305441741;
|
|
i2++;
|
|
int i3 = 2147483647;
|
|
i3++;
|
|
int i4 = 4294967295;
|
|
i4++;
|
|
int i5 = -48879;
|
|
i5++;
|
|
uint u1 = 0u;
|
|
u1++;
|
|
uint u2 = 305441741u;
|
|
u2++;
|
|
uint u3 = 2147483647u;
|
|
u3++;
|
|
uint u4 = 4294967295u;
|
|
u4++;
|
|
uint u5 = 65535u;
|
|
u5++;
|
|
}
|