mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-26 10:07:56 +00:00
Actually clamp the initial value
This commit is contained in:
parent
ea1c61913a
commit
127c825337
1 changed files with 1 additions and 1 deletions
|
@ -295,7 +295,7 @@ double RGBACluster::QuantizedError(
|
||||||
const float pct = ((pt - uqp1) * uqpdir) / uqplsq;
|
const float pct = ((pt - uqp1) * uqpdir) / uqplsq;
|
||||||
int32 j1 = floor(pct * static_cast<float>(nBuckets-1));
|
int32 j1 = floor(pct * static_cast<float>(nBuckets-1));
|
||||||
int32 j2 = ceil(pct * static_cast<float>(nBuckets-1));
|
int32 j2 = ceil(pct * static_cast<float>(nBuckets-1));
|
||||||
j1 = std::max(0, j1);
|
j1 = std::min(std::max(0, j1), nBuckets - 1);
|
||||||
j2 = std::min(j2, nBuckets - 1);
|
j2 = std::min(j2, nBuckets - 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue