Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
TextureCache: Simplify XFB reconstruction #7925
Currently, we don't consider the stride from the video interface when loading the XFB texture from memory. This results in textures which are twice the width being created, with both fields side-by-side. The data is then ignored as only the first half of the texture is actually displayed, but it's still incorrect.
This PR changes things to create two cache entries, one for each field, and display them as the real hardware would.
ARM also had no CPU XFB decoding function, and with the GPUs not supporting texel buffers large enough, GPU decoding wasn't possible. So on Android, you likely just saw black screens for in-memory XFBs.
Lastly, we're still reliant on the force progressive hack, unless XFB2RAM is enabled. If XFB2RAM is disabled, you'll just get a purple screen, as for interlaced scanout, the stride won't match (copy stride will be half the scanout stride, as it's only displaying every second line). Otherwise, you can disable the hack, and see the half-vertical-resolution interlaced video in all its glory. See the comment in TextureCacheBase.cpp in StitchXFBCopy() for more info.
I tested the same games I tested for Hybrid XFB. On D3D, I don't notice any obvious regressions. However, Vulkan complains about "Dest rect is too large for CopyRectangleFromTexture", this does not happen on master.
I noticed that
Compare the two blobs of code:
Yeah, my original change used DoPartialTextureUpdates for XFB copies too. But that doesn't consider stride, or the order of copies (re rogue leader comment), so there still needs to be a second path.
Using block math doesn't really make sense to me, as the XFBs aren't tiled in memory.
edit: ahh, I think I see how it's getting an out-of-range rectangle, the size is checked before scaling..
True but my point wasn't about the block math, it was to call out that the
Then again, D3D runs fine so maybe Vulkan is just being extra picky :)