Skip to content
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

[NOT FOR MERGE YET] Ignore format reinterpretation hack #4089

Closed
wants to merge 3 commits into from

Conversation

jroweboy
Copy link
Contributor

@jroweboy jroweboy commented Aug 12, 2018

Overview

When the texture cache rework pr #3281 was originally created, there was an additional commit that I added to discuss if we wanted to include it. This commit avoids costly reuploads from CPU memory to the GPU by ignoring validation whenever that surface was created on the GPU only (more on what this means later) I removed it at that time because it had one known regression, and also because I didn't want to stall getting the PR merged with debate over it. I'm bringing this back up for discussion now that its not attached to a massive PR

Testing this change

The following log filter should be enough to get some log spam in games that hit this edge case

*:Info Debug.GPU:Debug

If you find games that start spamming lines about "Validating surface with pixel format" please post a few of those logs on this PR along with what game was printing those logs and where. Additionally, please mention how much of a performance impact this has on those games when upscaled to 4x resolution (percentage difference with frame limiter off should be sufficient) If you find a game thats broken with just this one PR, please make a post about where it breaks as well.

Why shouldn't we merge it yet?

Known Issues

This PR is known to break Paper mario: #3281 (comment) This is because paper mario clears the depth/stencil buffer by drawing a quad with depth+stencil write enabled and funcs set to AlwaysTrue. This means that the reinterpret hack will ignore syncing the upload of the depth/stencil buffer from CPU (as the d/s surface was created on the GPU) and when we draw with the unsynced GPU surface, things get a little weird. (Read the full explanation below for more details on why this is broken with this change)

Unknown Issues

Also, since its a hack, it might break other games that do stupid things. (who knows?)

Why did you submit it if you know it has issues?

The reason I want to submit this as a PR is because it provides a very significant speed boost to many games, while also not being a large amount of work to do compared to GL texture decoding/encoding. Its pretty clear that we don't have anyone actively working on improving the video core at the moment (only wwylele was working on it, and he's busy with DSP) and I think this can be considered as an acceptable hold over until someone gets around to working on the GPU emulation again.

What would need addressed to get merged?

I'm submitting this with a second commit that will log cases where the hack takes effect. I plan to use this info to find the games that benefit from the hack, and determine if these are games that hw en/decoding will be able to speed up easily (ie: games that do not reinterpret d/s framebuffers as rgba textures)

After we gather some data about what games benefit, what games break, and how hard is it to fix this with gl texture decoding/encoding then I think its fine to merge (only if others think its fine as well of course)

I currently don't have any plans for hardcoding paper mario detection or anything like that. I personally think we can list it as a known workaround on the wiki to turn this feature off in the ini. But I don't mind adding it to the settings, i'd just like to at least discuss what should be done. When compared to the other GPU options citra has, this one has less known issues compared to Accurate Multiplication or even Hardware Shaders, which is why i didn't feel like adding it to the settings.

Why does this happen?

Games have a tendency to abuse the ability to access cached surfaces with different formats than what it was originally uploaded as. In cases where the cached surfaces weren't already synced with the CPU (in the code these are called invalid regions on the cached surface, which are set by the CPU writing to RasterizerCachedMemory pages) we attempt to copy from an existing valid surface when surface is being loaded, before falling back to doing a full surface upload from CPU -> GPU memory. The entire point of the surface cache is to avoid copying data between CPU <-> GPU while still keeping them in sync as much as needed.

How does this work?

When validating a surface (aka when either emulated CPU / GPU is getting a surface and that surface has regions that were modified on the CPU, but not updated on the GPU surface yet) it does one more additional check to try and prevent a upload. This additional check will look through all of the surfaces that were created only on the gpu (ie: through a texture copy, or when expanding an existing surface that was also GPU only, etc) and aren't currently synced with cpu memory (called dirty_regions in the code) and if they overlap entirely, it will not validate that surface, and also return without uploading CPU memory to the GPU. In maybe a little bit simpler terms, we don't sync the memory from the CPU -> GPU in the case where we'd be writing to something that was only created by the GPU and was never read by the CPU.

As a reminder, if there was already a compatible surface with the latest data from the CPU that we could have copied from already, we would have. This is only in the cases where the game is using memory locations that were created by the GPU (and so they weren't necessary to download to cpu memory until the game reads from it), and haven't been read back from by the CPU (else they would've been removed from dirty_regions), and are now simply just not synced with the CPU (not like they were synced before anyway). Like I previously mentioned, this is technically a case where we should reload the data from CPU -> GPU, but graphically, it doesn't seem to have any impact on games except for paper mario for the reasons mentioned before. But instead of loading, we instead keep those regions marked as invalid, and they'll only be marked valid if the game actually performs a memory read on the surface (which forces a flush from GPU -> CPU)


This change is Reviewable

jroweboy added 2 commits Aug 11, 2018
This is an intentional hack which will ignore reloading textures
from the cpu when the texture was created solely on the gpu (ie from a
texture copy) and the requested texture format differs from cached
format. Normally this would require a flush as the formats are different
but this will skip that bringing huge performance benefits to games
that use this to draw mostly unnoticable after effects.
Used to debug cases when hw texture encoding / decoding will be useful
and when it won't work (such as if the depth buffer is being read from
in a texture format)
@cluezbot
Copy link

cluezbot commented Aug 12, 2018

Hi, this is neobot, using neobrain's account. I'm keeping an archive of versions of this PR:

2018-08-12T01:40:04Z: c18a789...jroweboy:1e12e8d27fe7696f8c70b2ee3210a7e12593d08b

@Dragios
Copy link
Contributor

Dragios commented Aug 12, 2018

My result here is not that impressive due to CPU bottleneck so keep this in mind. The performance gap will be much greater if using a combination of great CPU and GPU.
Tested with Intel Xeon X5460 & GTX 1050 Ti


Pokédex 3D Pro [Displaying Abomasnow Pokedex – 34% → 85%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D24S8 and found surfaces created on the gpu that have the following pixel formats: D16,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D16 and found surfaces created on the gpu that have the following pixel formats: D24S8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D24S8 and found surfaces created on the gpu that have the following pixel formats: RGBA8, D16,

Zen Pinball 3D [Excalibur table (Launch the ball) – 57% → 76%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,

Phoenix Wright: Ace Attorney - Dual Destinies [With Apollo character shown – 33% → 109%
I'm not sure which log start first but this is the pattern:

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D24S8 and found surfaces created on the gpu that have the following pixel formats: D24S8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D24S8 and found surfaces created on the gpu that have the following pixel formats: D24S8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,

Phoenix Wright: Ace Attorney - Spirit of Justice [First game dialog with background image – 60% → 223%]
I'm not sure which log start first but this is the pattern:

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D24S8 and found surfaces created on the gpu that have the following pixel formats: D24S8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D24S8 and found surfaces created on the gpu that have the following pixel formats: D24S8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,

50 Classic Games [For some reason, this log only show once during booting the game and no where to be seen elsewhere in game – No performance difference]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: D24S8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: D24S8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: D24S8,

Luxor 3D [Same case as above – No performance difference]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565,

Super Mario Maker [Occurs during booting only, can't test any further as the game cannot proceed to main menu]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,

Mii Maker [Only occurs during booting]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,

Metal Gear Solid: Snake Eater 3D [Same case as above]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,

Prof. Layton vs Phoenix Wright: Ace Attorney [This log only occurs on Main Menu – 158% → 416%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8, Not a real pixel format,

Prof. Layton vs Phoenix Wright: Ace Attorney [In dialog with Chelmey – 98% → 295%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8, RGB8, Not a real pixel format,

Super Smash Bros [Mario - Battlefield map (paused mode) – 69% → 200%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB5A1, D24S8,

Project X Zone 2 [This log only occurs on Main Menu – 325% → 423%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D24S8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,

Fire Emblem Fates [During character creation – 86% → 200%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,

Monster Hunter 4 Ultimate [During character creation – 83% → 185%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,

Pokémon Mystery Dungeon: Gates to Infinity [Only occur during game loading (three circle)]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB8,

Pokémon Red [Video Framebuffer not updated at all – 178% → 324%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGB5A1 and found surfaces created on the gpu that have the following pixel formats: RGBA4,

Tales of the Abyss [Stuck on loading due to pipe3 unimplemented]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGB8 and found surfaces created on the gpu that have the following pixel formats: RGB8,

@Dragios
Copy link
Contributor

Dragios commented Aug 12, 2018

Existing issue discovered
This PR breaks Virtual Console games. It shows black screen on top screen.

Note: It shows nothing initially but if you upscale, it will show the previous image buffer. Same goes with down-scaling back. Assume the texture is not forwarding properly.

@tywald
Copy link
Contributor

tywald commented Aug 12, 2018

Tested with i7-3770K @ 4.3GHz & GTX 680

Monster Hunter Generations [Astalos - 95% → 235% | during its roar - 80% → 180%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,

Monster Hunter 3 Ultimate [Capcom logo - 15% → 40%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8, 
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565, 

Monster Hunter 4 Ultimate [Monster roars - 45% → 85%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8,

Monster Hunter Stories [Hakum Village - 41% → 43%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565, 

Etrian Odyssey Untold [Emerald Grove - 175% → 615%]

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGBA8, 
Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format D24S8 and found surfaces created on the gpu that have the following pixel formats: D24S8, 

At boot I also saw:

Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1643: Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: D24S8, 

@tabnk
Copy link

tabnk commented Aug 12, 2018

Monster Hunter Stories with Intel 3770 and R9 290.
Before this PR : 8 FPS
This PR : 8-9 FPS

Log:
Validating surface with pixel format RGBA8 and found surfaces created on the gpu that have the following pixel formats: RGB565.

Even with this hack Monster Hunter Stories still so slow.

This just sounds like nonsense to me. I'm sure devs aren't sitting
around going "hmm now what?". This sounds like a solution in search of a
problem.
@jroweboy
Copy link
Contributor Author

jroweboy commented Aug 14, 2018

Added a telemetry field to check whenever the hack is used by a game and put it in canary. This should give us a good list of games to check for regressions.

Thank you everyone for your previous test results!

Okay, we are getting a bunch of telemetry data pouring in right now with games that we'll need to check to see if they still work after the hack. I'll make a new post with all the games that we find in a couple of days :)

@jroweboy
Copy link
Contributor Author

jroweboy commented Aug 14, 2018

Thanks everyone for your performance tests! The first batch of telemetry has come back with this following list of games that trigger this hack. If you have any of these games, please check that they aren't broken :D (and if you find any performance gains or what not, lemme know)

2 Fast 4 Gnomz
3D Game Collection
3D Shinobi III
3D Streets of Rage
7TH DRAGON Ⅲ code:VFD
Adventure Labyrinth Story
Attack On Titan: Humanity in ...
BRAVELY DEFAULT
CODE OF PRINCESS
Conan Marionettesymphony
DBZ: Extreme Butoden
DEAD OR ALIVE Dimensions
DQM2
DQMJOKER3
DQMJOKER3 PRO
DQMT
DRAGON QUEST XI
Dementium Remastered
Detective Pikachu
Devil Summoner: Soul Hackers
Doragana
Dragon Quest VIII
EO V: BEYOND THE MYTH
EO V: Beyond the Myth
Etrian Odyssey 2 Untold
Etrian Odyssey Untold
Etrian Odyssey V
Etrian Odyssey V (Demo)
Etrian Odyssey X
FE Echoes: Shadows of Valentia
Fire Emblem Awakening
Fire Emblem Echoes
Fire Emblem Fates
Fire Emblem: Awakening
Ghost Recon Shadow Wars
IE GO CS: Thunderflash
IE GO CS: Wildfire
Inazuma Eleven GO Light
KINGDOM HEARTS 3D
Kid Icarus: Uprising
LEGO® MARVEL's Avengers
Little Battlers eXperience
Lord of Magna: Maiden Heaven
Luxor
MARIO KART 7
MGS SNAKE EATER 3D
MH3U
MONSTER HUNTER 3 (tri-) G
MONSTER HUNTER 4
MONSTER HUNTER 4 ULTIMATE
MONSTER HUNTER 4G
MONSTER HUNTER GEN
MONSTER HUNTER STORIES
MONSTER HUNTER X
MONSTER HUNTER XX
Mario & Luigi
Mario & Sonic Rio 2016
Mario Party: The Top 100
Mega Man Legacy Collection
Mii Maker
Miitopia
Mirror of Fate
Need For Speed™ The Run
Nekketsu Monogatari Special
New Style Boutique 3
ONE PIECE Unlimited World Red
PAPER MARIO
PROJECT X ZONE 2
PW:AA - Dual Destinies
PW:AA - Spirit of Justice
Pokemon Rutile Ruby
Pokemon Star Sapphire
Pokédex 3D
Pokédex 3D Pro
Pokémon Alpha Sapphire
Pokémon Mystery Dungeon
Pokémon Omega Ruby
Pokémon Rising Ruby
Pokémon SMD
Pokémon Sun
Pokémon Trading Card Game
Pokémon Ultra Moon
Pokémon Ultra Sun
Pokémon X
Prof. Layton VS Ace Attorney
Prof. Layton vs Phoenix Wrigh...
Professor Layton: Azran Legacy
Professor Layton: Miracle Mask
Project X Zone
RESIDENT EVIL REVELATIONS
River City: Knights of Justice
SMT IV: Apocalypse
SONIC GENERATIONS
SUPER STREET FIGHTER Ⅳ
Shin Megami Tensei IV
Sonic Boom: Fire & Ice
Sonic Toon
Super Luigi Maker
Super Mario Maker
Super Smash Bros.
TALES OF THE ABYSS
The Great Ace Attorney
Tomodachi Life
ULTIMATE NES REMIX
YO-KAI WATCH
YO-KAI WATCH 2: PSYCHIC …
Yu-Gi-Oh!
Yu-Gi-Oh!ZEXAL
Zen Pinball 3D
イナズマイレブンGO ギャラクシー
エクストルーパーズ
デジモンワールド Re:Digitize De…
ドラゴンボールヒーローズUM2
ドラゴンボールヒーローズUMX
ファイアーエムブレム if
レイトン教授と超文明Aの遺産
大逆転裁判 -成歩堂龍ノ介の冒險-
大逆転裁判2
探偵神宮寺三郎 復讐の輪舞
逆転裁判5
역전재판5 KOR v5.2

@Dartz150
Copy link

Dartz150 commented Aug 15, 2018

The performance gain is outstanding in some games

Machine:
Intel core i7 8700 @3.2GHz
8GB RAM
NVIDIA GTX 1050Ti

Kid Icarus Uprising (Surprised that now boots and goes ingame)
Before this PR : FPS 20
This PR : FPS 59-60

KINGDOM HEARTS 3D
Before this PR : FPS 18-25
This PR : FPS 59-60
This one had enormous lag in cutscenes, now it's gone.

Also in my case, sometimes there was a massive slowdown between screen changes, and now them are all gone, specially noticeable in the ORAS intro movie.

@legoj15
Copy link

legoj15 commented Aug 16, 2018

MGS 3D runs at full speed now more than ever on my hardware:
Ryzen 1400
GTX 1060 6GB
16GB RAM

Canary 764: ~74 FPS
Nightly 901: ~ 62 FPS in the same part of the title screen (camera underneath the log)

Edit: Luigi's Mansion: Dark Moon no longer boots on Canary 764 (shows garbage on the bottom screen), but it does on master. May or may not have to do with this PR. Not related to this PR

@RocketRobz
Copy link

RocketRobz commented Aug 16, 2018

Graphics card: NVIDIA GeForce GTX 260
RAM: 8GB

Game:
Style Savvy: Styling Star

Performance has improved with this PR.

Nightly 901: 29-30FPS (if not scaled), 20-22FPS (scaled)
Canary 764: 29-30FPS (scaled and non-scaled), 20-25FPS (only if scaled, and if more than one character are on screen, in a non-2D location)

@Demos25
Copy link

Demos25 commented Aug 20, 2018

That's the logs you asked for in #4108
4108-logs.zip

@B3n30
Copy link
Contributor

B3n30 commented Aug 20, 2018

FYI: Debug.GPU <Debug> video_core/renderer_opengl/gl_rasterizer_cache.cpp:ValidateSurface:1645: Validating surface with pixel format Not a real pixel format and found surfaces created on the gpu that have the following pixel formats: D16 is the line Dead Or Alive Dimensions generates

@jroweboy
Copy link
Contributor Author

jroweboy commented Nov 11, 2018

At the end of the day, this is just a hack. I don't see myself or any other maintainer merging this, even behind an option. I don't have the time or the effort to put into doing full texture reinterpretation either, so I'll just close this. At one point I felt strongly that this was more on the side of "acceptable workaround" instead of a hack, but after a few months of the PR sitting here, I still can't see myself pushing this forward any more so I'm just going to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants