mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 08:06:19 +00:00
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>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
194abe611b
commit
5cf943e797
@@ -1,5 +1,9 @@
|
||||
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 - (trunc((lhs / rhs)) * rhs));
|
||||
return (lhs - (tint_trunc((lhs / rhs)) * rhs));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
float tint_trunc(float param_0) {
|
||||
return param_0 < 0 ? ceil(param_0) : floor(param_0);
|
||||
}
|
||||
|
||||
float tint_float_mod(float lhs, float rhs) {
|
||||
return (lhs - (trunc((lhs / rhs)) * rhs));
|
||||
return (lhs - (tint_trunc((lhs / rhs)) * rhs));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
float tint_trunc(float param_0) {
|
||||
return param_0 < 0 ? ceil(param_0) : floor(param_0);
|
||||
}
|
||||
|
||||
float tint_float_mod(float lhs, float rhs) {
|
||||
return (lhs - (trunc((lhs / rhs)) * rhs));
|
||||
return (lhs - (tint_trunc((lhs / rhs)) * rhs));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
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(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) {
|
||||
return (lhs - (trunc((lhs / rhs)) * rhs));
|
||||
return (lhs - (tint_trunc((lhs / rhs)) * rhs));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
float3 tint_trunc(float3 param_0) {
|
||||
return param_0 < 0 ? ceil(param_0) : floor(param_0);
|
||||
}
|
||||
|
||||
float3 tint_float_mod(float3 lhs, float3 rhs) {
|
||||
return (lhs - (trunc((lhs / rhs)) * rhs));
|
||||
return (lhs - (tint_trunc((lhs / rhs)) * rhs));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
float3 tint_trunc(float3 param_0) {
|
||||
return param_0 < 0 ? ceil(param_0) : floor(param_0);
|
||||
}
|
||||
|
||||
float3 tint_float_mod(float3 lhs, float3 rhs) {
|
||||
return (lhs - (trunc((lhs / rhs)) * rhs));
|
||||
return (lhs - (tint_trunc((lhs / rhs)) * rhs));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
|
||||
Reference in New Issue
Block a user