Merge pull request #3967 from raven02/patch-17

Quick fix FF4 CC missing title text in framebuffer-to-memory mode
This commit is contained in:
Henrik Rydgård 2013-09-30 03:39:47 -07:00
commit add0350b56
2 changed files with 13 additions and 20 deletions

View file

@ -907,8 +907,7 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s
#ifdef USING_GLES2
PackFramebufferSync_(nvfb); // synchronous glReadPixels
#else
if(gl_extensions.PBO_ARB || !gl_extensions.ATIClampBug)
{
if(gl_extensions.PBO_ARB || !gl_extensions.ATIClampBug) {
if(!sync) {
PackFramebufferAsync_(nvfb); // asynchronous glReadPixels using PBOs
} else {
@ -1304,9 +1303,10 @@ void FramebufferManager::DecimateFBOs() {
VirtualFramebuffer *vfb = vfbs_[i];
int age = frameLastFramebufUsed - std::max(vfb->last_frame_render, vfb->last_frame_used);
if (vfb == displayFramebuf_ || vfb == prevDisplayFramebuf_ || vfb == prevPrevDisplayFramebuf_) {
if(updateVram && age == 0 && !vfb->memoryUpdated)
if(updateVram && age == 0 && !vfb->memoryUpdated && vfb == displayFramebuf_)
ReadFramebufferToMemory(vfb);
if (vfb == displayFramebuf_ || vfb == prevDisplayFramebuf_ || vfb == prevPrevDisplayFramebuf_) {
continue;
}

View file

@ -189,7 +189,6 @@ inline void TextureCache::AttachFramebuffer(TexCacheEntry *entry, u32 address, V
if (entry->format != framebuffer->format) {
WARN_LOG_REPORT_ONCE(diffFormat1, G3D, "Render to texture with different formats %d != %d", entry->format, framebuffer->format);
// If it already has one, let's hope that one is correct.
// If "AttachFramebufferValid" , Evangelion Jo and Kurohyou 2 will be 'blue background' in-game
AttachFramebufferInvalid(entry, framebuffer);
} else {
AttachFramebufferValid(entry, framebuffer);
@ -211,8 +210,6 @@ inline void TextureCache::AttachFramebuffer(TexCacheEntry *entry, u32 address, V
if (framebuffer->format != entry->format) {
WARN_LOG_REPORT_ONCE(diffFormat2, G3D, "Render to texture with different formats %d != %d at %08x", entry->format, framebuffer->format, address);
// TODO: Use an FBO to translate the palette?
// If 'AttachFramebufferInvalid' , Kurohyou 2 will be missing battle scene in-game and FF Type-0 will have black box shadow/'blue fog' and 3rd birthday will have 'blue fog'
// If 'AttachFramebufferValid' , DBZ VS Tag will have 'burning effect' ,
AttachFramebufferValid(entry, framebuffer);
} else if ((entry->addr - address) / entry->bufw < framebuffer->height) {
WARN_LOG_REPORT_ONCE(subarea, G3D, "Render to area containing texture at %08x", address);
@ -514,11 +511,8 @@ void TextureCache::UpdateSamplingParams(TexCacheEntry &entry, bool force) {
//Workaround to fix a clamping bug in pre-HD ATI/AMD drivers
if (gl_extensions.ATIClampBug && entry.framebuffer)
{
return;
}
else
{
if (force || entry.sClamp != sClamp) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, sClamp ? GL_CLAMP_TO_EDGE : GL_REPEAT);
entry.sClamp = sClamp;
@ -527,7 +521,6 @@ void TextureCache::UpdateSamplingParams(TexCacheEntry &entry, bool force) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, tClamp ? GL_CLAMP_TO_EDGE : GL_REPEAT);
entry.tClamp = tClamp;
}
}
}
static void ConvertColors(void *dstBuf, const void *srcBuf, GLuint dstFmt, int numPixels) {