mirror of https://github.com/PCSX2/pcsx2.git
GS: Reduce false positives in dev overflow errors
This commit is contained in:
parent
200ec5dcfb
commit
ce08627396
|
@ -3685,10 +3685,14 @@ void GSState::GSTransferBuffer::Init(int tx, int ty, const GIFRegBITBLTBUF& blit
|
||||||
|
|
||||||
bool GSState::GSTransferBuffer::Update(int tw, int th, int bpp, int& len)
|
bool GSState::GSTransferBuffer::Update(int tw, int th, int bpp, int& len)
|
||||||
{
|
{
|
||||||
|
u32 packet_size = 0;
|
||||||
|
u32 tex_size = 0;
|
||||||
if (total == 0)
|
if (total == 0)
|
||||||
{
|
{
|
||||||
start = end = 0;
|
start = end = 0;
|
||||||
total = std::min<int>((tw * bpp >> 3) * th, 1024 * 1024 * 4);
|
tex_size = (((tw * th * bpp) + 7) >> 3);
|
||||||
|
packet_size = (tex_size + 15) & ~0xF; // Round up to the nearest quadword
|
||||||
|
total = std::min<int>(tex_size, 1024 * 1024 * 4);
|
||||||
overflow = false;
|
overflow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3696,11 +3700,11 @@ bool GSState::GSTransferBuffer::Update(int tw, int th, int bpp, int& len)
|
||||||
|
|
||||||
if (len > remaining)
|
if (len > remaining)
|
||||||
{
|
{
|
||||||
if (!overflow)
|
if (!overflow && len > packet_size)
|
||||||
{
|
{
|
||||||
overflow = true;
|
overflow = true;
|
||||||
#if defined(PCSX2_DEVBUILD) || defined(_DEBUG)
|
#if defined(PCSX2_DEVBUILD) || defined(_DEBUG)
|
||||||
Console.Warning("GS transfer buffer overflow");
|
Console.Warning("GS transfer buffer overflow len %d remaining %d, tex_size %d tw %d th %d bpp %d", len, remaining, tex_size, tw, th, bpp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue