mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-27 12:18:35 +01:00
GL: Realized we need another sanity check in the readback code
Added similar checks to Vulkan, just because.
This commit is contained in:
1 parent
036baf04d0
commit
d1910de166
2 files changed
+17
-4
No files matched your search
@@ -1306,6 +1306,10 @@ void GLQueueRunner::CopyReadbackBuffer(int width, int height, Draw::DataFormat s
|
||||
// don't usually provide very optimized conversion implementations, though some do.
|
||||
// Just need to be careful about dithering, which may break Danganronpa.
|
||||
int bpp = (int)Draw::DataFormatSizeInBytes(destFormat);
|
||||
if (!readbackBuffer_ || bpp <= 0 || !pixels) {
|
||||
// Something went wrong during the read and no readback buffer was allocated, probably.
|
||||
return;
|
||||
}
|
||||
for (int y = 0; y < height; y++) {
|
||||
memcpy(pixels + y * pixelStride * bpp, readbackBuffer_ + y * width * bpp, width * bpp);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user