Use AUDIO_VIDEO_ENABLE flags to skip rendering when not needed by the frontend - #570
Open
msheehan79 wants to merge 5 commits into
Open
Use AUDIO_VIDEO_ENABLE flags to skip rendering when not needed by the frontend#570msheehan79 wants to merge 5 commits into
msheehan79 wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds some checks based on the RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE macro to skip the rendering portion of video or audio when not required, in order to reduce the overhead when running features such as Runahead.
I did some benchmark testing on this PR using the method detailed below. In addition, I also just used the core as I normally would to play and did not notice any regressions during my playback.
Benchmarking:
I used Hyperfine to run the core in headless mode, using the following .cfg changes from default:
Test Method: Used an average of 10 runs of the original vs pr core, calculated for 5000 frames, with 1 warmup run. I used 4 frames of runahead for the bulk of my testing.
Example command used: hyperfine -w 1 --runs 10 -n "Current Core" "retroarch.exe -L mame_libretro_current.dll C:\emulation\roms\arcade\mame\4dwarrio.7z -v --config benchmark.cfg --max-frames 5000" ^ -n "Updated Core" "retroarch.exe -L mame_libretro_updated.dll C:\emulation\roms\arcade\mame\4dwarrio.7z -v --config benchmark.cfg --max-frames 5000"
Results
The actual FPS gain varied quite a bit by game, but at no point did I see a regression or drop in FPS with this enabled.
AI Disclosure I used Gemini Pro 3.1 to help me get a better understanding of the libretro/MAME runloop and to suggest some possible locations where we could skip rendering, it was used a guideline only. All code was committed by me and all tests run myself, not using AI agents,