Permalink
Browse files

GPU: Remove FBO auto-download hack.

See #6261.  This should be replaced now with block transfer detection,
which is faster and doesn't cause crashes.

Games that previously required this setting should use block transfer
instead.  If that doesn't work, it's a bug.
  • Loading branch information...
unknownbrackets committed Dec 25, 2017
1 parent 9b909b4 commit 025a806ab4fa4a5f52a1ecd48feca93930da0706
@@ -162,7 +162,6 @@ bool FramebufferManagerCommon::UpdateSize() {
void FramebufferManagerCommon::BeginFrame() {
DecimateFBOs();
currentRenderVfb_ = nullptr;
updateVRAM_ = !(g_Config.iRenderingMode == FB_NON_BUFFERED_MODE || g_Config.iRenderingMode == FB_BUFFERED_MODE);
}
void FramebufferManagerCommon::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
@@ -195,7 +194,7 @@ u32 FramebufferManagerCommon::FramebufferByteSize(const VirtualFramebuffer *vfb)
}
bool FramebufferManagerCommon::ShouldDownloadFramebuffer(const VirtualFramebuffer *vfb) const {
return updateVRAM_ || (PSP_CoreParameter().compat.flags().Force04154000Download && vfb->fb_address == 0x00154000);
return PSP_CoreParameter().compat.flags().Force04154000Download && vfb->fb_address == 0x00154000;
}
void FramebufferManagerCommon::SetNumExtraFBOs(int num) {
@@ -457,7 +456,7 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame
vfbs_.push_back(vfb);
currentRenderVfb_ = vfb;
if (useBufferedRendering_ && !updateVRAM_ && !g_Config.bDisableSlowFramebufEffects) {
if (useBufferedRendering_ && !g_Config.bDisableSlowFramebufEffects) {
gpu->PerformMemoryUpload(fb_address_mem, byteSize);
NotifyStencilUpload(fb_address_mem, byteSize, true);
// TODO: Is it worth trying to upload the depth buffer?
@@ -1210,7 +1209,7 @@ void FramebufferManagerCommon::ResizeFramebufFBO(VirtualFramebuffer *vfb, int w,
}
bool FramebufferManagerCommon::NotifyFramebufferCopy(u32 src, u32 dst, int size, bool isMemset, u32 skipDrawReason) {
if (updateVRAM_ || size == 0) {
if (size == 0) {
return false;
}
@@ -1580,7 +1579,7 @@ void FramebufferManagerCommon::OptimizeDownloadRange(VirtualFramebuffer * vfb, i
}
bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dstStride, int dstX, int dstY, u32 srcBasePtr, int srcStride, int srcX, int srcY, int width, int height, int bpp, u32 skipDrawReason) {
if (!useBufferedRendering_ || updateVRAM_) {
if (!useBufferedRendering_) {
return false;
}
@@ -385,7 +385,6 @@ class FramebufferManagerCommon {
u32 framebufRangeEnd_ = 0;
bool useBufferedRendering_ = false;
bool updateVRAM_ = false;
bool usePostShader_ = false;
bool postShaderAtOutputResolution_ = false;
bool postShaderIsUpscalingFilter_ = false;
@@ -719,10 +719,6 @@ bool TextureCacheCommon::AttachFramebuffer(TexCacheEntry *entry, u32 address, Vi
// If they match exactly, it's non-CLUT and from the top left.
if (exactMatch) {
// Apply to non-buffered and buffered mode only.
if (!(g_Config.iRenderingMode == FB_NON_BUFFERED_MODE || g_Config.iRenderingMode == FB_BUFFERED_MODE))
return false;
DEBUG_LOG(G3D, "Render to texture detected at %08x!", address);
if (framebuffer->fb_stride != entry->bufw) {
WARN_LOG_REPORT_ONCE(diffStrides1, G3D, "Render to texture with different strides %d != %d", entry->bufw, framebuffer->fb_stride);
@@ -1037,11 +1037,6 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int
void FramebufferManagerGLES::EndFrame() {
CHECK_GL_ERROR_IF_DEBUG();
// We flush to memory last requested framebuffer, if any.
// Only do this in the read-framebuffer modes.
if (updateVRAM_)
PackFramebufferAsync_(nullptr);
// Let's explicitly invalidate any temp FBOs used during this frame.
if (gl_extensions.GLES3 && glInvalidateFramebuffer != nullptr) {
for (auto temp : tempFBOs_) {
View
@@ -255,17 +255,11 @@ void GPU_GLES::CheckGPUFeatures() {
bool useCPU = false;
if (!gl_extensions.IsGLES) {
// Urrgh, we don't even define FB_READFBOMEMORY_CPU on mobile
#ifndef USING_GLES2
useCPU = g_Config.iRenderingMode == FB_READFBOMEMORY_CPU;
#endif
// 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) {
if (gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA || gl_extensions.ver[0] < 3) {
useCPU = true;
}
if (gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA || !gl_extensions.VersionGEThan(3, 0)) {
useCPU = true;
}
} else {
useCPU = true;

0 comments on commit 025a806

Please sign in to comment.