mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-02 12:41:36 +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>
17 lines
561 B
HLSL
17 lines
561 B
HLSL
vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
|
|
return param_0 < 0 ? ceil(param_0) : floor(param_0);
|
|
}
|
|
|
|
vector<float16_t, 3> tint_float_mod(float16_t lhs, vector<float16_t, 3> rhs) {
|
|
const vector<float16_t, 3> l = vector<float16_t, 3>((lhs).xxx);
|
|
return (l - (tint_trunc((l / rhs)) * rhs));
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void f() {
|
|
const float16_t a = float16_t(4.0h);
|
|
const vector<float16_t, 3> b = vector<float16_t, 3>(float16_t(1.0h), float16_t(2.0h), float16_t(3.0h));
|
|
const vector<float16_t, 3> r = tint_float_mod(a, b);
|
|
return;
|
|
}
|