mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-28 14:20:30 +00:00
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:
parent
ac0c4544e1
commit
a8db46a6b8
@ -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
|
||||
}
|
||||
|
||||
/*=============================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user