D3D9: Correct depth readback.

This commit is contained in:
Unknown W. Brackets 2022-10-09 13:21:04 -07:00
parent 199bfe4596
commit d83f736b1f
2 changed files with 6 additions and 4 deletions

View File

@ -2662,8 +2662,7 @@ void FramebufferManagerCommon::ReadFramebufferToMemory(VirtualFramebuffer *vfb,
if (vfb && vfb->fbo) {
// We'll pseudo-blit framebuffers here to get a resized version of vfb.
if (gameUsesSequentialCopies_) {
// Ignore the x/y/etc., read the entire thing.
// TODO: What game did we need this for?
// Ignore the x/y/etc., read the entire thing. See below.
x = 0;
y = 0;
w = vfb->width;
@ -2677,7 +2676,7 @@ void FramebufferManagerCommon::ReadFramebufferToMemory(VirtualFramebuffer *vfb,
vfb->usageFlags |= FB_USAGE_DOWNLOAD;
} else {
// Let's try to set the flag eventually, if the game copies a lot.
// Some games copy subranges very frequently.
// Some games (like Grand Knights History) copy subranges very frequently.
const static int FREQUENT_SEQUENTIAL_COPIES = 3;
static int frameLastCopy = 0;
static u32 bufferLastCopy = 0;

View File

@ -134,7 +134,10 @@
}
void FramebufferManagerDX9::PackFramebufferSync(VirtualFramebuffer *vfb, int x, int y, int w, int h, RasterChannel channel) {
if (channel != RASTER_COLOR) {
if (channel == RASTER_DEPTH) {
PackDepthbuffer(vfb, x, y, w, h);
return;
} else if (channel != RASTER_COLOR) {
// Unsupported
WARN_LOG_ONCE(d3ddepthreadback, G3D, "Not yet supporting depth readbacks on DX9");
return;