-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
EFB2RAM Speedhack #1952
EFB2RAM Speedhack #1952
Conversation
Please do not review coding style issues yet! Also, the efb2ram cache option is used for now, if this PR has an actual change to be merged, it will be changed. This PR is supposed to be merged after PR #1948. This hack tries to make efb2ram faster, by skipping the efb to ram copy under the following conditions: - The texture was loaded at least once - The texture is not one of the paletted textures that are efb copies Obviously this won't work on games that read or change the efb data after it was copied to RAM. But some games require efb2ram right now, without doing this. This hack is mostly intended to be used for those paletted textures that are efb copies, but it does work on some others as well. Examples for this are the spinning coins in New Super Mario Bros and the garbage on screen that happens in RS2 after loading a profile. TODO: - Check if the other uses of efb2ram in RS2 work with this. This is at least some effect on torpedoes and some heat effect.
@@ -500,7 +500,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con | |||
SettingCheckBox* efbcopy_disable = CreateCheckBox(page_hacks, _("Disable"), wxGetTranslation(efb_copy_desc), vconfig.bEFBCopyEnable, true); | |||
efbcopy_texture = CreateRadioButton(page_hacks, _("Texture"), wxGetTranslation(efb_copy_texture_desc), vconfig.bCopyEFBToTexture, false, wxRB_GROUP); | |||
efbcopy_ram = CreateRadioButton(page_hacks, _("RAM"), wxGetTranslation(efb_copy_ram_desc), vconfig.bCopyEFBToTexture, true); | |||
cache_efb_copies = CreateCheckBox(page_hacks, _("Enable Cache"), wxGetTranslation(cache_efb_copies_desc), vconfig.bEFBCopyCacheEnable); | |||
cache_efb_copies = CreateCheckBox(page_hacks, _("Speedhack"), wxGetTranslation(cache_efb_copies_desc), vconfig.bEFBCopyCacheEnable); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
So, if I'm understanding correctly, this assumes games either read an EFB2RAM copy from the CPU or use it from the GPU, but not both, and that EFB copies with the same destination address will get used the same way. I'm a bit skeptical that it's actually a good idea; it seems like it will cause subtle errors which will be difficult to track down. The palette EFB copy part mostly harmless, I guess, but I'm not sure it's worth exposing the option just for a few games. |
Tested on Metroid Games, Super Mario Sunshine, ZTP,ZWW(pictobox), Okami, Silent Hill SM, Resident Evil Darkside chronicles for these games works fine and gives quite a boost plays almost like EFB to Texture speed. |
What exactly do those games use efb2ram for? I could test Metroid and Okami myself, if i knew what i was looking for. About the others, some explanation which textures are broken with efb2tex and work with this PR would be nice. PS: Twilight Princess is one of the games, the PR was created for |
Well... about broken |
@dolphin-emu-bot rebuild |
New Super Mario Bros from 90 to 110 fps. Coins work fine. |
I think i will change this from a speed hack option for efb2ram to a compatibility option for efb2tex. An option that makes the fast and incompatible mode more compatible, is a better idea than a mode that makes THE compatible mode more incompatible. This will reduce the amount of confusion and user error. Can i use the name "Hybrid Mode" for this? Even though, efb2ram is a hybrid mode already? The speed and compatibilty of this mode does lie between efb2tex and efb2ram. About The Last Story: |
I wouldn't call it a hack for efb2ram, just call it a more saver way for efb2tex. For efb2tex only games, this should have no performance impact (but small stuttering on the first frame). But lots of games are working with this setup without the full efb2ram configuration: """ |
Hmm, if that's true, could it just replace efb2tex? I'm not really sure about that, some games do some stupid stuff. If a game "spams" just ONE new efb copy per frame, the speed is reduced a lot. Your explanation of what this mode does is much more precise that what i had and what i could have come up with. |
I'm closing this, because i managed to kill the repository it is based on, and also those "paletted efb copies" might get properly fixed within the new few weeks. When that happens, those paletted efb copies might work in efb2tex, rendering this PR useless. |
This is the same trick which is used for Metroid's fonts/texts, but for all textures. If 2 different textures at the same address are loaded during the same frame, create a 2nd entry instead of overwriting the existing one. If the entry was overwritten in this case, there wouldn't be any caching, which results in a big performance drop. The restriction to textures, which are loaded during the same frame, prevents creating lots of textures when textures are used in the regular way. This restriction is new. Overwriting textures, instead of creating new ones is faster, if the old ones are unlikely to be used again. Since this would break efb copies, don't do it for efb copies. Castlevania 3 goes from 80 fps to 115 fps for me. There might be games that need a higher texture cache accuracy with this, but those games should also see a performance boost from this PR. Some games, which use paletted textures, which are not efb copies, might be faster now. And also not require a higher texture cache accuracy anymore. (similar sitation as PR dolphin-emu#1916)
Please do not review coding style issues yet! Also, the efb2ram cache option is used for now, if this PR has an actual change to be merged, it will be changed. This PR is supposed to be merged after PR #1948.
This hack tries to make efb2ram faster, by skipping the efb to ram copy under the following conditions:
Obviously this won't work on games that read or change the efb data after it was copied to RAM. But some games require efb2ram right now, without doing this.
This hack is mostly intended to be used for those paletted textures that are efb copies, but it does work on some others as well. Examples for this are the spinning coins in New Super Mario Bros and the garbage on screen that happens in RS2 after loading a profile.
TODO: