mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
There's a reason the overload of `ctx.Replace()` that takes a pointer to the replacement is deprecated - it doesn't play well when used as part of another replacement. Switch to using the callback overload of Replace() to fix bad transform output. Bug: tint:1386647 Change-Id: I94292eeb65d24d7b2446b16b8b4ad13bdd27965a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111000 Auto-Submit: Ben Clayton <bclayton@google.com> Commit-Queue: James Price <jrprice@google.com> Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
33 lines
808 B
GLSL
33 lines
808 B
GLSL
#version 310 es
|
|
|
|
float tint_float_modulo(float lhs, float rhs) {
|
|
return (lhs - rhs * trunc(lhs / rhs));
|
|
}
|
|
|
|
|
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|
void unused_entry_point() {
|
|
return;
|
|
}
|
|
int a = 0;
|
|
float b = 0.0f;
|
|
int tint_div(int lhs, int rhs) {
|
|
return (lhs / (bool(uint((rhs == 0)) | uint(bool(uint((lhs == -2147483648)) & uint((rhs == -1))))) ? 1 : rhs));
|
|
}
|
|
|
|
int tint_mod(int lhs, int rhs) {
|
|
return (lhs % (bool(uint((rhs == 0)) | uint(bool(uint((lhs == -2147483648)) & uint((rhs == -1))))) ? 1 : rhs));
|
|
}
|
|
|
|
void foo(int maybe_zero) {
|
|
a = tint_div(a, 0);
|
|
a = tint_mod(a, 0);
|
|
a = tint_div(a, maybe_zero);
|
|
a = tint_mod(a, maybe_zero);
|
|
b = (b / 0.0f);
|
|
b = tint_float_modulo(b, 0.0f);
|
|
b = (b / float(maybe_zero));
|
|
b = tint_float_modulo(b, float(maybe_zero));
|
|
}
|
|
|