Skip to content

Leave a stage library the driver has not compiled to a worker - #1429

Merged
NotRexed merged 2 commits into
NotRexed:mainfrom
jarynclouatre:fix/gpl-cold-libraries
Nov 10, 2026
Merged

NotRexed merged 2 commits into
NotRexed:mainfrom
jarynclouatre:fix/gpl-cold-libraries

Conversation

@jarynclouatre

Copy link
Copy Markdown
Contributor

With RX_VK_GPL set, a draw links its pipeline from stage libraries, and a library the driver had not compiled was compiled right there, holding the draw. Where the device has pipelineCreationCacheControl, the draw now asks for the two libraries that hold shaders (pre-rasterization and fragment) with VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT. If either comes back VK_PIPELINE_COMPILE_REQUIRED the pipeline is not linked: the draw is left out or waits for the worker's full build, exactly as without libraries, and the worker builds the cold libraries after it, for the program's next pipeline. A library that fails is not asked for again. With RX_VK_GPL set, the frame line also counts the libraries the driver had, the cold ones, and how many of those the workers built and in what time. RX_VK_GPL_SYNC (set to anything): compiled in the draw, as before.

Testing: RTX 4070 Ti Super, driver 621.14, Windows 11, Ryzen 7 9800X3D. A scripted 10-minute route (boot, Hyrule Field, Kakariko, Market, Lost Woods, Gerudo Valley), RX_VK_GPL=1, libraries not warmed, one run each on 7dbdcdc:

libraries off this compiled in the draw (RX_VK_GPL_SYNC)
frames presented in 595 s 33,000 33,000 25,800
time lost against 60 fps, s 45.5 45.2 165.7
replay thread's time in pipelines, s 3.5 4.3 153.3
draws left out 265,836 144,300 324

Alone it makes RX_VK_GPL as fast as having it off, with fewer draws left out. Warming the libraries into the pipeline cache (next PR) is what it is for. tests/test_gpl_cold_library.py is new.

@NotRexed

Copy link
Copy Markdown
Owner

This landed in the v2.0.12 branch (merged there for testing; it reaches main with that release), so closing. Thanks!

@NotRexed NotRexed closed this Nov 10, 2026
@NotRexed

Copy link
Copy Markdown
Owner

Reopened: closing this was a mistake on my side. It was tested in the v2.0.12 branch, and it will be merged into main here, so it shows as merged. Sorry for the noise.

@NotRexed NotRexed reopened this Nov 10, 2026
@jarynclouatre

Copy link
Copy Markdown
Contributor Author

Rebased on main and resolved the conflict in gpu/vk/vk_replay.cpp: the frame line keeps main's descriptor saves and adds the library counts after them. Nothing else changed. The tests pass on the rebased branch; I have not run the game on it yet.

@jarynclouatre

Copy link
Copy Markdown
Contributor Author

Thanks, both fixed in the new commit: the test is in run_all.py's ARGS with {cxx}, and the comment says "set".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants