mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-07 16:50:58 +02:00
Merge pull request #13902 from Tilka/fix_color_clamp
VideoSW: fix clamping after vertex color interpolation
This commit is contained in:
@@ -173,12 +173,8 @@ static void Draw(s32 x, s32 y, s32 xi, s32 yi)
|
|||||||
{
|
{
|
||||||
for (int comp = 0; comp < 4; comp++)
|
for (int comp = 0; comp < 4; comp++)
|
||||||
{
|
{
|
||||||
u16 color = (u16)ColorSlopes[i][comp].GetValue(x, y);
|
const float color = ColorSlopes[i][comp].GetValue(x, y);
|
||||||
|
tev.Color[i][comp] = (u8)std::clamp<float>(color, 0.0f, 255.0f);
|
||||||
// clamp color value to 0
|
|
||||||
u16 mask = ~(color >> 8);
|
|
||||||
|
|
||||||
tev.Color[i][comp] = color & mask;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user