Merge pull request #6300 from unknownbrackets/gpu-blocktransfer

Try to handle more block transfer / tex render cases
This commit is contained in:
Henrik Rydgård committed 2014-06-12 20:34:26 +02:00
commit 3da962f585
2 files changed
+12 -3

No files matched your search

+4
View File
@@ -22,6 +22,7 @@
#include "native/thread/threadutil.h"
#include "Core/Core.h"
#include "Core/Config.h"
#include "Core/Debugger/Breakpoints.h"
#include "Core/MemMap.h"
#include "Core/System.h"
#include "Core/Host.h"
@@ -725,6 +726,7 @@ bool __IoRead(int &result, int id, u32 data_addr, int size) {
result = ERROR_KERNEL_BAD_FILE_DESCRIPTOR;
return true;
} else if (Memory::IsValidAddress(data_addr)) {
CBreakPoints::ExecMemCheck(data_addr, true, size, currentMIPS->pc);
u8 *data = (u8*) Memory::GetPointer(data_addr);
if (f->npdrm) {
result = npdrmRead(f, data, size);
@@ -855,6 +857,8 @@ bool __IoWrite(int &result, int id, u32 data_addr, int size) {
return true;
}
CBreakPoints::ExecMemCheck(data_addr, false, size, currentMIPS->pc);
bool useThread = __KernelIsDispatchEnabled() && ioManagerThreadEnabled && size > IO_THREAD_MIN_DATA_SIZE;
if (useThread) {
// If there's a pending operation on this file, wait for it to finish and don't overwrite it.
+8 -3
View File
@@ -245,8 +245,8 @@ void TextureCache::AttachFramebuffer(TexCacheEntry *entry, u32 address, VirtualF
if (!entry->framebuffer || entry->invalidHint == -1) {
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.
AttachFramebufferInvalid(entry, framebuffer, fbInfo);
// Let's avoid rendering when we know the format is wrong. May be a video/etc. updating memory.
DetachFramebuffer(entry, address, framebuffer);
} else {
AttachFramebufferValid(entry, framebuffer, fbInfo);
}
@@ -313,10 +313,15 @@ void TextureCache::NotifyFramebuffer(u32 address, VirtualFramebuffer *framebuffe
// Must be in VRAM so | 0x04000000 it is.
const u32 addr = (address | 0x04000000) & 0x0FFFFFFF;
const u32 bpp = framebuffer->format == GE_FORMAT_8888 ? 4 : 2;
const u64 cacheKey = (u64)addr << 32;
// If it has a clut, those are the low 32 bits, so it'll be inside this range.
// Also, if it's a subsample of the buffer, it'll also be within the FBO.
const u64 cacheKeyEnd = cacheKey + ((u64)(framebuffer->fb_stride * MAX_SUBAREA_Y_OFFSET) << 32);
u64 cacheKeyEnd = cacheKey + ((u64)(framebuffer->fb_stride * MAX_SUBAREA_Y_OFFSET * bpp) << 32);
if (addr >= 0x04000000 && addr < 0x04110000) {
// This range usually is dominated by framebuffers. Assume the entire height is up for grabs.
cacheKeyEnd = cacheKey + ((u64)(framebuffer->fb_stride * framebuffer->height * bpp) << 32);
}
switch (msg) {
case NOTIFY_FB_CREATED: