This script will automate repeatable frame times for Metal, Vulkan or OpenGL backends.
A .dtm replay file is required. It is used to repeat the exact same sequence for every run.
usage: ./gfx-render-time.sh --help
--dtm|-p replay.dtm
Path to dtm replay file. This is required.
--metal|--vulkan|--opengl
The graphics backend to test. If none are set, only Metal will be tested.
--repeat|-r 1
How many runs for each graphics backend. Defaults to 1.
--dolphin|-o /Application/Dolphin.app
Path to Dolphin.app. Defaults to Application folder.
--game|-g game.gcz
The path will be detected automatically for rvz, iso and wia files.
For other rom types, the path must be set manually.
--hud
Performance HUD for Metal and Vulkan graphics backend's. Ventura and later.
--config=|-C System.Section.Key=Value
Options accepted by Dolphin will be passed to it.
https://wiki.dolphin-emu.org/index.php?title=GameINI
Using the included sample file: F-Zero-Sand-Ocean-Intro.dtm
enter in terminal: (Ctrl-C
to cancel)
./gfx-render-time.sh --dtm F-Zero-Sand-Ocean-Intro.dtm --metal --vulkan --repeat 3
output: (This is also written to summary.txt.)
1/3 metal................5.085ms
Run completed. Sampled 11436 frames.
2/3 metal................5.088ms
Run completed. Sampled 11436 frames.
3/3 metal................5.104ms
Run completed. Sampled 11436 frames.
11436 frames 5.085ms metal pass 1
11436 frames 5.088ms metal pass 2
11436 frames 5.104ms metal pass 3
34308 frames 5.092ms complete
1/3 vulkan...................6.075ms
Run completed. Sampled 11436 frames.
2/3 vulkan...................6.085ms
Run completed. Sampled 11436 frames.
3/3 vulkan...................6.070ms
Run completed. Sampled 11436 frames.
11436 frames 6.075ms vulkan pass 1
11436 frames 6.085ms vulkan pass 2
11436 frames 6.070ms vulkan pass 3
34308 frames 6.077ms complete
Results: F-Zero\ Sand\ Ocean\ Intro\ 09.15,09.36.04
The output will be located next to the .dtm file in a dated folder. Each backend pass will list frame time in milliseconds. Console output will be hidden from the terminal and redirected to console.txt.
├── F-Zero-Sand-Ocean-Intro 09.15,09.36.04
│ ├── _summary.txt
│ ├── console.txt
│ ├── metal pass 1.txt
│ ├── metal pass 2.txt
│ ├── metal pass 3.txt
│ ├── vulkan pass 1.txt
│ ├── vulkan pass 2.txt
│ └── vulkan pass 3.txt
└── F-Zero-Sand-Ocean-Intro.dtm
Run a copy of Dolphin outside the default /Applications
folder:
./gfx-render-time.sh --dolphin ~/Downloads/Dolphin.app --dtm F-Zero-Sand-Ocean-Intro.dtm
The following will set the resolution to 4x native and disable custom texture loading. More can be found in the Dolphin Wiki:
./gfx-render-time.sh --dtm F-Zero-Sand-Ocean-Intro.dtm \
-C Graphics.Settings.InternalResolution=4 -C Graphics.Settings.HiresTextures=False
- Replay.dtm files are portable between Apple ARM and Intel machines.
- Errors emitted by Dolphin will not be visible in the terminal. This is due to Dolphin emitting all console output to stderr making it difficult to differentiate in the script. Check the console.txt file if it's not running properly.
- Disable
Config
/General
/Enable Cheats
for recording and playback or risk desyncronization. - Disable
Graphics
/Hacks
/Save Texture Cache to State
when recording with save states. - Using save states is fragile. They tend to break between Dolphin revisions.
- Save states are tied to the Game Cube bios. Using a real bios during recording will fail to load when playback depends on the default bios provided by Dolphin.
- When sharing or moving replay files between machines, try to minimize any custom settings while recording unless they are part of what's being measured. Keep in mind any game specific configurations (from game properties) since the performance numbers can be affected by it.
- The .dtm file will embed some settings when the recording is made. By consequence, they will be inherited during playback. They cannot be changed through
--config=
options. - The graphics backend is written to the .dtm file. The script patches it so it's so it runs for all backends. This is generally not a problem. The only side effect is that games that depend on EFB CPU access can desync. Metroid Prime 2 visor scan lock is an example.
embeded settings | settings location |
---|---|
MAIN_CPU_THREAD |
Config / General / Dual Core |
MAIN_DSP_HLE |
Config / Audio / DSP Emulation Engine |
MAIN_CPU_CORE |
Config / Advanced / CPU Emulation Engine |
MAIN_SYNC_GPU |
Properties Menu / Game Config / Syncronize GPU Thread |
MAIN_FAST_DISC_SPEED |
Properties Menu / Game Config / Speed up Disc Transfer Rate |
SYSCONF_LANGUAGE or MAIN_GC_LANGUAGE |
Config / Wii or GameCube / System Language |
SYSCONF_PAL60 |
Config / Wii / Use PAL60 Mode |
SYSCONF_PROGRESSIVE_SCAN |
Graphics / Advanced / Enable Progressive Scan |
GFX_HACK_EFB_ACCESS_ENABLE |
Graphics / Hacks / Skip EFB Access from CPU |
GFX_HACK_SKIP_EFB_COPY_TO_RAM |
Graphics / Hacks / Store EFB Copies to Texture Only |
GFX_HACK_EFB_EMULATE_FORMAT_CHANGES |
Graphics / Hacks / Ignore Format Changes |
GFX_HACK_SKIP_XFB_COPY_TO_RAM |
Graphics / Hacks / Store XFB Copies to Texture Only |
GFX_HACK_IMMEDIATE_XFB |
Graphics / Hacks / Immediatly Present XFB |
SESSION_USE_FMA |
|
MAIN_JIT_FOLLOW_BRANCH |