GZDoom slight delay during startup (temp problem)

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

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
User avatar
Posts: 26430
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

GZDoom slight delay during startup (temp problem)

Post by Enjay »

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
Posts: 13107
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: GZDoom slight delay during startup (temp problem)

Post by Rachael »

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
Posts: 764
Joined: Thu Apr 25, 2013 12:21 pm
Graphics Processor: nVidia with Vulkan support
Location: Disappointment Island

Re: GZDoom slight delay during startup (temp problem)

Post by SanyaWaffles »

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.
Posts: 2893
Joined: Sat May 28, 2016 1:01 pm

Re: GZDoom slight delay during startup (temp problem)

Post by dpJudas »

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.

Return to “Technical Issues”