New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Minimal TMEM cache implementation. #8350
Conversation
|
Rebased for clean fifo-ci run. Looks like I broke Spyro... This is going to need some more work |
Source/Core/VideoCommon/TmemBase.cpp
Outdated
| int odd_base; | ||
| int odd_size; | ||
| }; | ||
| static std::array<texture_unit_state, 8> s_unit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there really no other place to place this (like in the actual cache)? This introduces more file-scope/global mutable state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel really uneasy about how complicated texture cache is getting and just how complicated it is to understand.
This part is still WIP, this state will need to be stored somewhere, and it will need initialized to zero, and something will need to be done on DoState (either we invalidate the whole thing, or for correctness we save anything that's tagged as "cached")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you intend to address those FIXME in here, or in a follow-up PR?
|
FIFOci update: Good news:
Average news:
Bad news: |
|
Are we sure those last two are really broken? Those are ancient fifologs. And Sonic's gravity boost was already broken. |
|
The two games mentioned as broken in those fifologs are only broken in EFB2Tex. In EFB2RAM, they render more correctly than they did before. It'd be nice for them to not black out or act weird in EFB2Tex, but that's a far, far, far less severe issue than we have now. |
|
Any update on what's going on here? |
|
Any hope of progress on this? Quite a few games are affected by it. |
|
Even though this has a regression in EFB2TEX, it would much, much, much better than the current situation if rebased/reviewed/merged. Right now we have people resorting to making custom builds with tmem disabled for particular games, and communities are beginning to rely on these builds to play certain games. |
|
Can this be rebased? There's an issue report that I think this may affect but the buildbot builds are gone. |
|
So, as a bit of a refresher, here's the current status of this Pull Request. The EFB2RAM path of this Pull Request seems to work perfectly. It even has handled new, previously unknown cases of tmem issues that weren't known at the time of its creation. It has been verified to work in the rebased version of this PR. The main thing this Pull Request fixes is a bunch of games with video playback issues. It appears that whatever video player that Sega used has a lot of issues with the tmem implementation in master. Both paths of this PR seem to work fine for this. Verified games that are fixed include: Sonic Riders However, the EFB2Tex version of this PR does have some issues that aren't present on the EFB2RAM version. Spyro: A Hero's Tail https://fifo.ci/compare/4964271-4953579/ In EFB2TEX ONLY, the water issues return. However, using EFB2RAM you can get the correct effect. This appears to be an invalidation thing. Sonic Riders: Zero Gravity Fourth Player's viewport appears to flicker in EFB2Tex. EFB2RAM in this Pull Request works fine, however. It is currently broken in master too so this isn't a big issue. The fact that EFB2RAM fixes it is actually a benefit. That's actually all that's known broken in the PR, two invalidation issues. |
|
I know this is marked as draft and do not merge. But at this point what currently exists here is far superior to the behavior in Master. While the invalidation issues kind of suck, I'd rather have things 95% working so we can potentially work toward a release and then worry about the EFB2Tex path later. |
|
This needs a rebase/rewrite; the Windows build system changed in PR #9092. |
|
Just doing my annual bump |
|
I went through the major cases again and they all behave the same as we remember. Spyro: A Hero's Tail - Needs EFB2RAM but is fixed at least. |
|
So, has there been any progress in regards to this pull request? I've merged it into my own semi-custom build for Sonic Riders and Sonic Riders ZG, and it seems to work fine(which are the only games that I own which have the TMEM issues). The only problem is that I don't have a lot of games to do regression testing, and as such, I'm not sure if it's ready to pull in or not. Thank you for all the work. |
|
Status report: This PR was rapidly implemented as a prototype to prove the idea. It is not production ready code. I need to take some time to rewrite it. I haven't gotten around to doing this yet. |
|
Note that this is just cleanup. Titles fixed by this pull request are still fixed, but there's no change in behavior otherwise. |
|
I think my main concern is that we don't break savestates/TASing with this. |
|
Current status: The bulk of the restructuring has been done. The main thing that remains is deciding where the tmem state should live and then hooking it upto savestates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working as well as expected. The Spyro regression is something that happened after TMEM, but was hidden by the broken TMEM behavior.
|
Everything seems to work fine on my end with the new patch. All games that rely on proper TMem emulation for cutscenes work. Sonic Riders Zero Gravity works and with the texture cache bug fixed, that means Edit: I might need to retest Zero Gravity because I'm not sure the patch itself has been applied correctly. Edit 2: Sonic Riders Zero Gravity gravity effects work perfectly with this patch set with EFB2Texture active. This might also fix the 4-player bug, but this is yet to be tested. Edit 3: As confirmed by JMC, my fears have been justified: 4-player multiplayer still needs EFB2RAM to work correctly, which is very weird since it is not an EFB related issue somehow(I was wrong about that as well, my memory seems to be failing). |
|
It is an EFB related issue and a texture cache related issue. But neither appear to be a bug with TMEM, just something masked by TMEM. |
58a7818
to
1861b7b
Compare
|
I did some squashing and added a large comment at the top of Tmem.cpp for future developers. As far as I'm concerned, this is ready for merging. |
7e476ca
to
120106c
Compare
|
Fixed a minor squash issue. Renamed Tmem to TMEM |
Now works with games that deliberately avoid invalidating TMEM because they know textures are too large to fit: * Sonic Riders * Metal Arms: Glitch in the System * Godzilla: Destroy All Monsters Melee * NHL Slapshot * Tak and the Power of Juju * Night at the Museum: Battle of the Smithsonian * 428: Fūsa Sareta Shibuya de
Fixes issue where vulkan might crash trying to bind a deleted texture.
|
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
|
In the words of great Aristotle, "One swallow does not make a summer, neither does one fine day; similarly one day or brief time of happiness does not make a person entirely happy." Translated to modern times, I'm pretty sure it would read, "Yolo." ...Then again, I'm not a philosopher. |

Now works with games that deliberately avoid invalidating TMEM because they know textures are too large to fit:
TODO:
Depends on: