mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-03 13:11:34 +00:00
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>
16 lines
377 B
HLSL
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;
|
|
}
|