summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2016-01-09 18:30:29 +1300
committerScott Mansell <phiren@gmail.com>2016-01-09 18:30:29 +1300
commit74b772c3be4a724c12094c08d26466fdbb4f841b (patch)
tree587e163daecfeaad9e4d1d0ac7a84d08a581e2d9 /Source/Core/VideoCommon/TextureCacheBase.cpp
parent39971ec03958dce195c43b285c97579736acaee8 (diff)
Avoid the "Memory stride too small" assert
EFB2Tex still has no idea what to do with these weird textures so we simply disable EFB2Tex when one is encountered.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 5805eb3d8b..d6ec45a1e9 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -1107,6 +1107,21 @@ void TextureCacheBase::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFo
}
}
+ if (dstStride < bytes_per_row)
+ {
+ // This kind of efb copy results in a scrambled image.
+ // I'm pretty sure no game actually wants to do this, it might be caused by a
+ // programming bug in the game, or a CPU/Bounding box emulation issue with dolphin.
+ // The copy_to_ram code path above handles this "correctly" and scrambles the image
+ // but the copy_to_vram code path just saves and uses unscrambled texture instead.
+
+ // To avoid a "incorrect" result, we simply skip doing the copy_to_vram code path
+ // so if the game does try to use the scrambled texture, dolphin will grab the scrambled
+ // texture (or black if copy_to_ram is also disabled) out of ram.
+ ERROR_LOG(VIDEO, "Memory stride too small (%i < %i)", dstStride, bytes_per_row);
+ copy_to_vram = false;
+ }
+
// Invalidate all textures that overlap the range of our efb copy.
// Unless our efb copy has a weird stride, then we want avoid invalidating textures which
// we might be able to do a partial texture update on.