dawn-cmake/test/tint/expressions/binary/mod/scalar-scalar/f16.wgsl.expected.dxc.hlsl
Antonio Maiorano 5cf943e797 tint/hlsl: implement trunc in terms of floor/ceil to work around FXC bug
Bug: tint:1883
Change-Id: If6c160da0684353a873428a08063aa91ee7a01c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125420
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2023-03-27 18:55:25 +00:00

16 lines
377 B
HLSL

float16_t tint_trunc(float16_t param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float16_t tint_float_mod(float16_t lhs, float16_t rhs) {
return (lhs - (tint_trunc((lhs / rhs)) * rhs));
}
[numthreads(1, 1, 1)]
void f() {
const float16_t a = float16_t(1.0h);
const float16_t b = float16_t(2.0h);
const float16_t r = tint_float_mod(a, b);
return;
}