mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-30 10:23:35 +00:00
HLSL's % operator results in less precise results than expected. Bug: tint:1799 Change-Id: I1a9572288a0e536f0fc9c0748a25dcf58551e57b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119760 Kokoro: Kokoro <noreply+kokoro@google.com> Kokoro: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
12 lines
272 B
HLSL
12 lines
272 B
HLSL
float16_t tint_float_mod(float16_t lhs, float16_t rhs) {
|
|
return (lhs - (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;
|
|
}
|