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.
pull/3444/head
Stenzek 5 months ago
parent ac0c4544e1
commit a8db46a6b8
No known key found for this signature in database

@ -787,7 +787,7 @@ float rgb_distance(uint a, uint b)
// Calculate the luminance difference between two ABGR8 colors and normalize it // Calculate the luminance difference between two ABGR8 colors and normalize it
float luma_distance(uint a, uint b) 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
} }
/*============================================================================= /*=============================================================================

Loading…
Cancel
Save