Skip to content

anv, drirc: Add workaround to speed up Cyberpunk 2077 reg allocation.

Calling the ra_allocate function after each register spill can take
several minutes. This option speed up shader compilation by spilling all
registers after the first ra_allocate failure. Required for
Cyberpunk 2077, which uses a watchdog thread to terminate the process
in case the render thread hasn't responded within 2 minutes.

Execution time of my Cyberpunk2077 shader compilation test: https://gitlab.freedesktop.org/illia.a.polishchuk/cyberpunk-vulkan-compute-hang-test-anv

Before the patch:

real	1m28,738s
user	1m28,329s
sys	0m0,400s

After the patch

real	0m29,245s
user	0m28,835s
sys	0m0,404s

I think it's acceptable patch because Cyberpunk benchmarks has
the same FPS with and without patch. (I started
it without patch with a patched binary with disabled watchdog thread)

Closes: #9241 (closed)

Merge request reports