Merge pull request #6807 from unknownbrackets/danganronpa-hack

Use 8888, always, for Danganronpa's FBOs
This commit is contained in:
Henrik Rydgård 2014-08-30 15:32:06 +02:00
commit 1c8c652d81
2 changed files with 21 additions and 11 deletions

View File

@ -791,7 +791,7 @@ void FramebufferManager::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h
bool trueColor = g_Config.bTrueColor;
if (hackForce04154000Download_ && vfb->fb_address == 0x00154000) {
trueColor = false;
trueColor = true;
}
if (trueColor) {
@ -1384,6 +1384,18 @@ inline bool FramebufferManager::ShouldDownloadFramebuffer(const VirtualFramebuff
return updateVRAM_ || (hackForce04154000Download_ && vfb->fb_address == 0x00154000);
}
inline bool FramebufferManager::ShouldDownloadUsingCPU(const VirtualFramebuffer *vfb) const {
bool useCPU = g_Config.iRenderingMode == FB_READFBOMEMORY_CPU;
// We might get here if hackForce04154000Download_ is hit.
// Some cards or drivers seem to always dither when downloading a framebuffer to 16-bit.
// This causes glitches in games that expect the exact values.
// It has not been experienced on NVIDIA cards, so those are left using the GPU (which is faster.)
if (g_Config.iRenderingMode == FB_BUFFERED_MODE && gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA) {
useCPU = true;
}
return useCPU;
}
void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool sync, int x, int y, int w, int h) {
#ifndef USING_GLES2
@ -1447,6 +1459,9 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s
nvfb->colorDepth = FBO_8888;
break;
}
if (ShouldDownloadUsingCPU(vfb)) {
nvfb->colorDepth = vfb->colorDepth;
}
textureCache_->ForgetLastTexture();
nvfb->fbo = fbo_create(nvfb->width, nvfb->height, 1, false, nvfb->colorDepth);
@ -1735,15 +1750,8 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) {
const int MAX_PBO = 2;
GLubyte *packed = 0;
bool unbind = false;
u8 nextPBO = (currentPBO_ + 1) % MAX_PBO;
bool useCPU = g_Config.iRenderingMode == FB_READFBOMEMORY_CPU;
// We might get here if hackForce04154000Download_ is hit.
// Some cards or drivers seem to always dither when downloading a framebuffer to 16-bit.
// This causes glitches in games that expect the exact values.
// It has not been experienced on NVIDIA cards, so those are left using the GPU (which is faster.)
if (g_Config.iRenderingMode == FB_BUFFERED_MODE && gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA) {
useCPU = true;
}
const u8 nextPBO = (currentPBO_ + 1) % MAX_PBO;
const bool useCPU = ShouldDownloadUsingCPU(vfb);
// We'll prepare two PBOs to switch between readying and reading
if (!pixelBufObj_) {

View File

@ -223,7 +223,6 @@ public:
}
return true;
}
inline bool ShouldDownloadFramebuffer(const VirtualFramebuffer *vfb) const;
bool NotifyFramebufferCopy(u32 src, u32 dest, int size, bool isMemset = false);
bool NotifyStencilUpload(u32 addr, int size, bool skipZero = false);
@ -255,6 +254,9 @@ private:
static void ClearDepthBuffer();
static bool MaskedEqual(u32 addr1, u32 addr2);
inline bool ShouldDownloadFramebuffer(const VirtualFramebuffer *vfb) const;
inline bool ShouldDownloadUsingCPU(const VirtualFramebuffer *vfb) const;
void SetColorUpdated(VirtualFramebuffer *dstBuffer) {
dstBuffer->memoryUpdated = false;
dstBuffer->dirtyAfterDisplay = true;