mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
GPU/HW: Fix readback of odd transfer widths
Fixes character model flailing and crash in FF9.
This commit is contained in:
parent
d118377c9e
commit
41cf894488
|
@ -599,7 +599,7 @@ void GPU_HW_D3D11::ReadVRAM(u32 x, u32 y, u32 width, u32 height)
|
||||||
{
|
{
|
||||||
// Get bounds with wrap-around handled.
|
// Get bounds with wrap-around handled.
|
||||||
const Common::Rectangle<u32> copy_rect = GetVRAMTransferBounds(x, y, width, height);
|
const Common::Rectangle<u32> copy_rect = GetVRAMTransferBounds(x, y, width, height);
|
||||||
const u32 encoded_width = copy_rect.GetWidth() / 2;
|
const u32 encoded_width = (copy_rect.GetWidth() + 1) / 2;
|
||||||
const u32 encoded_height = copy_rect.GetHeight();
|
const u32 encoded_height = copy_rect.GetHeight();
|
||||||
|
|
||||||
// Encode the 24-bit texture as 16-bit.
|
// Encode the 24-bit texture as 16-bit.
|
||||||
|
|
|
@ -580,7 +580,7 @@ void GPU_HW_OpenGL::ReadVRAM(u32 x, u32 y, u32 width, u32 height)
|
||||||
{
|
{
|
||||||
// Get bounds with wrap-around handled.
|
// Get bounds with wrap-around handled.
|
||||||
const Common::Rectangle<u32> copy_rect = GetVRAMTransferBounds(x, y, width, height);
|
const Common::Rectangle<u32> copy_rect = GetVRAMTransferBounds(x, y, width, height);
|
||||||
const u32 encoded_width = copy_rect.GetWidth() / 2;
|
const u32 encoded_width = (copy_rect.GetWidth() + 1) / 2;
|
||||||
const u32 encoded_height = copy_rect.GetHeight();
|
const u32 encoded_height = copy_rect.GetHeight();
|
||||||
|
|
||||||
// Encode the 24-bit texture as 16-bit.
|
// Encode the 24-bit texture as 16-bit.
|
||||||
|
|
|
@ -449,7 +449,7 @@ void GPU_HW_OpenGL_ES::ReadVRAM(u32 x, u32 y, u32 width, u32 height)
|
||||||
{
|
{
|
||||||
// Get bounds with wrap-around handled.
|
// Get bounds with wrap-around handled.
|
||||||
const Common::Rectangle<u32> copy_rect = GetVRAMTransferBounds(x, y, width, height);
|
const Common::Rectangle<u32> copy_rect = GetVRAMTransferBounds(x, y, width, height);
|
||||||
const u32 encoded_width = copy_rect.GetWidth() / 2;
|
const u32 encoded_width = (copy_rect.GetWidth() + 1) / 2;
|
||||||
const u32 encoded_height = copy_rect.GetHeight();
|
const u32 encoded_height = copy_rect.GetHeight();
|
||||||
|
|
||||||
// Encode the 24-bit texture as 16-bit.
|
// Encode the 24-bit texture as 16-bit.
|
||||||
|
|
Loading…
Reference in a new issue