Fix undefined behaviour converting 3D postest registers

If the position test register is negative, conversion to unsigned
integer is undefined. This breaks games on arm64 where the behaviour is
defined as 'truncate to zero'. Converting to a signed integer first
guarantees the intended behaviour.
This commit is contained in:
Chris Branch 2018-10-05 22:59:06 +01:00
parent c741f37c11
commit af205cf582
1 changed files with 1 additions and 1 deletions

View File

@ -1946,7 +1946,7 @@ void gfx3d_glAlphaFunc(u32 v)
u32 gfx3d_glGetPosRes(const size_t index)
{
return (u32)(PTcoords[index] * 4096.0f);
return (u32)(s32)(PTcoords[index] * 4096.0f);
}
//#define _3D_LOG_EXEC