Quick answer: Vulkan pipeline cache write to disk during game shutdown taking 2+ seconds? Cache size grew; sync write blocks the main thread - write async or chunk into smaller files.

Player quits the game; window freezes for 2 seconds before closing. Disk write is the cause.

Write async on background thread

Detached thread writes the cache. Main thread continues with shutdown; OS reaps the thread.

Or write periodically during play

Periodic cache flush during low-load moments. Shutdown has less to write.

Chunk the cache

Multiple smaller cache files; write only changed chunks. Faster I/O; finer granularity.

“Disk I/O at shutdown is visible UX. Hide it.”

Audit any operation tied to game shutdown. Each adds latency to the close; players notice.

Related reading