Merge pull request #6378 from unknownbrackets/gpu-minor

Validate framebuffer uploads a bit more
This commit is contained in:
Henrik Rydgård committed 2014-06-21 13:32:09 +02:00
commit 09e5a60499
2 files changed
+11 -6

No files matched your search

+3 -4
View File
@@ -982,17 +982,16 @@ void FramebufferManager::DoSetRenderFrameBuffer() {
u32 byteSize = FramebufferByteSize(vfb);
u32 fb_address_mem = (fb_address & 0x3FFFFFFF) | 0x04000000;
if (fb_address_mem + byteSize > framebufRangeEnd_) {
if (Memory::IsVRAMAddress(fb_address_mem) && fb_address_mem + byteSize > framebufRangeEnd_) {
framebufRangeEnd_ = fb_address_mem + byteSize;
}
// Some AMD drivers crash if we don't clear the buffer first?
ClearBuffer();
if (useBufferedRendering_ && !updateVRAM_) {
gpu->PerformMemoryUpload(fb_address_mem, byteSize);
gpu->PerformStencilUpload(fb_address_mem, byteSize);
// TODO: Is it worth trying to upload the depth buffer?
ClearDepthBuffer();
} else {
ClearBuffer();
}
// Let's check for depth buffer overlap. Might be interesting.
+8 -2
View File
@@ -2061,13 +2061,19 @@ bool GLES_GPU::PerformMemorySet(u32 dest, u8 v, int size) {
bool GLES_GPU::PerformMemoryDownload(u32 dest, int size) {
// Cheat a bit to force a download of the framebuffer.
// VRAM + 0x00400000 is simply a VRAM mirror.
return gpu->PerformMemoryCopy(dest ^ 0x00400000, dest, size);
if (Memory::IsVRAMAddress(dest)) {
return gpu->PerformMemoryCopy(dest ^ 0x00400000, dest, size);
}
return false;
}
bool GLES_GPU::PerformMemoryUpload(u32 dest, int size) {
// Cheat a bit to force an upload of the framebuffer.
// VRAM + 0x00400000 is simply a VRAM mirror.
return gpu->PerformMemoryCopy(dest, dest ^ 0x00400000, size);
if (Memory::IsVRAMAddress(dest)) {
return gpu->PerformMemoryCopy(dest, dest ^ 0x00400000, size);
}
return false;
}
bool GLES_GPU::PerformStencilUpload(u32 dest, int size) {