GZDoom slight delay during startup (temp problem)

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE? Did your computer break? Ask here.

Moderator: GZDoom Developers

GZDoom slight delay during startup (temp problem)

Postby Enjay » Fri Nov 05, 2021 3:29 pm

I'm just wondering if anyone has an explanation for the following:

I had been using GZDoom (a git build from a few days ago) and doing a lot of going into GZDoom, checking how a shader looked, quitting immediately altering what I was working on and then repeating.

After doing this several times (maybe 20+), I noticed that GZDoom was taking a bit longer to start than normal. The startup window would get as far as the message that says "player 1 of 1 (1 nodes)" and then pause for around 5 seconds before the background behind the startup window became a full-screen instance of GZDoom and the game started in the usual way. Normally the point where the ~5 second delay happened is near-instantaneous for me.

I didn't think about it too much at the time but I noticed that it was still happening a few days later (even with nothing other than the default files loaded). I checked that I wasn't doing something that I hadn't intended to (e.g. loading something, or caching textures) and it all seemed fine. I even disabled my visus checker for a trial and that wasn't the issue either. I updated to the latest git build but the delay persisted.

Then, on a hunch, on the IWAD selection window, I changed from Vulkan to OpenGL and ran GZDoom. It started quickly (no 5 second delay). Then I quit and switched back to Vulkan and the delay was still gone.

So, any ideas why this might have happened?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: GZDoom slight delay during startup (temp problem)

Postby Rachael » Fri Nov 05, 2021 7:12 pm

What's happening is your shader cache is being invalidated. On Vulkan, GZDoom is responsible for the shader cache, and if it needs to be rebuilt it will do so. Not sure how much mods affect this, but usually shouldn't be too much. Updating your GZDoom version (even with dev builds) will likely require a cache rebuild too, though.

In OpenGL the cache is managed by your video card but only if you are on AMD or NVidia. If you are on Intel, or using Vulkan, then GZDoom will manage your cache.

You can find GZDoom's shader cache in the following folder on Windows: %localappdata%\zdoom\cache

Basically, GZDoom's fast startups only ever occur when nothing important has changed between the current session and the last, that would otherwise invalidate the cache data. If you play other games, then your video card drivers might clean out its own caches to make room for the other games' caches, as well.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: GZDoom slight delay during startup (temp problem)

Postby SanyaWaffles » Fri Nov 05, 2021 7:58 pm

I notice sometimes GZDoom will take a long, long time starting up if the graphics driver got replaced and I didn't restart. Restarting usually fixes it.
User avatar
SanyaWaffles
Certified Heretic and Grill Champion
 
Joined: 25 Apr 2013
Location: Disappointment Island
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: GZDoom slight delay during startup (temp problem)

Postby dpJudas » Fri Nov 05, 2021 8:14 pm

Unless someone else added it, the vulkan backend will compile the GLSL shaders every time. I think Rachael may still be on to something though. It is possible that the driver keeps building up a cache internally of compiled SPIR-V shaders until you launch another application (GZDoom OpenGL in this case) which then maybe clears the cache. That would be my best guess of what is going on here.
dpJudas
 
 
 
Joined: 28 May 2016


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 0 guests