GPU/HW: Use signed difference in luma_distance()

Fixes the warning, and also underflowing, since both were unsigned
it would overflow if the second was greater the first.
This commit is contained in:
Stenzek 2025-06-13 20:54:00 +10:00
parent ac0c4544e1
commit a8db46a6b8
No known key found for this signature in database

View File

@ -787,7 +787,7 @@ float rgb_distance(uint a, uint b)
// Calculate the luminance difference between two ABGR8 colors and normalize it
float luma_distance(uint a, uint b)
{
return abs(luma(a) - luma(b)) * 0.0006535948f; // Multiplicative replacement for division by 1530
return abs(int(luma(a)) - int(luma(b))) * 0.0006535948f; // Multiplicative replacement for division by 1530
}
/*=============================================================================