mirror of https://github.com/PCSX2/pcsx2.git
GS/HW: avoid divide by zero's in draw rect calculations
This commit is contained in:
parent
08649b7aa8
commit
92b6c1c08d
|
@ -491,7 +491,7 @@ GSVector4i GSLocalMemory::GetRectForPageOffset(u32 base_bp, u32 offset_bp, u32 b
|
|||
|
||||
const u32 page_offset = (offset_bp - base_bp) >> 5;
|
||||
const GSVector2i& pgs = m_psm[psm].pgs;
|
||||
const GSVector2i page_offset_xy = GSVector2i(page_offset % bw, page_offset / bw);
|
||||
const GSVector2i page_offset_xy = GSVector2i(page_offset % bw, page_offset / std::max(1U, bw));
|
||||
return GSVector4i(pgs * page_offset_xy).xyxy() + GSVector4i::loadh(pgs);
|
||||
}
|
||||
|
||||
|
|
|
@ -914,7 +914,7 @@ GSVector4i GSRendererHW::GetSplitTextureShuffleDrawRect() const
|
|||
GSVector4i GSRendererHW::GetDrawRectForPages(u32 bw, u32 psm, u32 num_pages)
|
||||
{
|
||||
const GSVector2i& pgs = GSLocalMemory::m_psm[psm].pgs;
|
||||
const GSVector2i size = GSVector2i(static_cast<int>(bw) * pgs.x, static_cast<int>(num_pages / bw) * pgs.y);
|
||||
const GSVector2i size = GSVector2i(static_cast<int>(bw) * pgs.x, static_cast<int>(num_pages / std::max(1U, bw)) * pgs.y);
|
||||
return GSVector4i::loadh(size);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue