Open masterthdev opened 11 months ago
Quick Update
I tried CLI benchmark command twice using this command: godot -d camera_3d.tscn --benchmark
It loaded faster in second run. Here are the results:
First run: BENCHMARK:
Second run: BENCHMARK:
Now running the project from editor loads faster too. AppData\Roaming\Godot\app_userdata\projectname\vulkan folder contains two files in benchmarked projects:
pipelines.amd_radeon_rx_5600m.cache pipelines.amd_radeon_rx_5600m.editor.cache
Looks like pipelines.amd_radeon_rx_5600m.cache isn't generated when running project from editor, which prevents loading caches from shader_cache folder. It generated once yesterday but it was very small(307 kb, others are more than 1 mb)
I think I found the issue.
Cache files are created on exit. Editor.cache file is created when switching renderer on editor, using 'Quit To Process' List from process menu or using X button on top right corner of the window.
Running project with --benchmark created non-editor cache correctly because I closed it using X button. When running project from the editor, using X button or using get_tree().quit() generates the non-editor cache file. However, using "Stop Running Project(F8)" button on the editor doesn't generate cache file in any renderers. This prevents generating cache file on borderless windows.
However, using "Stop Running Project(F8)" button on the editor doesn't generate cache file in any renderers.
F8 kills the project's process, so it has no time to intercept this and call a signal handler that can safely write files on exit. (Godot also currently lacks support for SIGTERM signal handlers either way.)
Looks like pipelines.amd_radeon_rx_5600m.cache isn't generated when running project from editor, which prevents loading caches from shader_cache folder.
They may be generating in a different path: https://github.com/godotengine/godot/pull/82972
Godot version
4.2.stable
System information
Godot v4.2.stable - Windows 10.0.22000 - Vulkan (Forward+) - dedicated AMD Radeon RX 5600M (Advanced Micro Devices, Inc.; 31.0.21023.2010) - AMD Ryzen 7 4800H with Radeon Graphics (16 Threads)
Issue description
Edit: Check my latest reply, looks like using "Stop Running Project(F8)" button prevents generating vulkan cache file.
Shader loading is very slow on Forward+ compared to mobile and compatibility renderers, when running a project with F5/F6.
Shader cache and vulkan pipeline cache at %AppData%\Godot\app_userdata\projectname\ directory don't regenerate, but most shaders don't load any faster.
I deleted all caches and used --verbose output to measure shader loading times. Looks like there is no way to output timestamps, I had to screen record console output.
Caches I deleted: %AppData%\Roaming\Godot\ %AppData%\Local\Godot\ .godot /AMD folders from each drive(includes directx caches but deleted anyway) Shader cache from gpu driver
I repeated the test multiple times, timings below were consistent each run. Shader time is time between first and last "Shader 'shadername' (group x) SHA256: XXXX..." line in verbose output.
I have this issue in all godot 4 builds I tried. If there is a way to profile shader loading times please let me know. I don't know how accurate verbose output is.
Steps to reproduce
Minimal reproduction project
bench.zip