Using relative threshold for floats in mesh comparison

Changes the threshold comparison from absolute to relative.
Removes threshold for MLoopCol comparison.

Adds a compare relative threshold function.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12273
This commit is contained in:
Himanshi Kalra
2021-08-24 00:49:36 +05:30
committed by Himanshi Kalra
parent be1891e895
commit 875c2ea5b5
3 changed files with 33 additions and 8 deletions

View File

@@ -172,6 +172,9 @@ MINLINE size_t clamp_z(size_t value, size_t min, size_t max);
MINLINE int compare_ff(float a, float b, const float max_diff);
MINLINE int compare_ff_relative(float a, float b, const float max_diff, const int max_ulps);
MINLINE bool compare_threshold_relative(const float value1,
const float value2,
const float thresh);
MINLINE float signf(float f);
MINLINE int signum_i_ex(float a, float eps);