mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
Clamp RGB values in pal mode
This commit is contained in:
parent
c643238b86
commit
823dc6ea00
1 changed files with 4 additions and 1 deletions
|
@ -454,7 +454,10 @@ SSAVec4i DrawTriangleCodegen::ToBgra(SSAInt index)
|
|||
|
||||
SSAInt DrawTriangleCodegen::ToPal8(SSAVec4i c)
|
||||
{
|
||||
return RGB32k[((c[2] >> 3) * 32 + (c[1] >> 3)) * 32 + (c[0] >> 3)].load(true).zext_int();
|
||||
SSAInt red = SSAInt::clamp(c[0], SSAInt(0), SSAInt(255));
|
||||
SSAInt green = SSAInt::clamp(c[1], SSAInt(0), SSAInt(255));
|
||||
SSAInt blue = SSAInt::clamp(c[2], SSAInt(0), SSAInt(255));
|
||||
return RGB32k[((blue >> 3) * 32 + (green >> 3)) * 32 + (red >> 3)].load(true).zext_int();
|
||||
}
|
||||
|
||||
SSAInt DrawTriangleCodegen::ProcessPixel8(SSAInt bg, SSAInt *varying)
|
||||
|
|
Loading…
Reference in a new issue