zink: implement async gfx precompile
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 22 Sep 2022 20:42:19 +0000 (16:42 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 11 Oct 2022 17:02:14 +0000 (17:02 +0000)
commit41ffb15de564849668c942aa79a570b6f262de99
tree15bd2012c1394a86319051b746d1463a3912e5fd
parentaed4e716d0d89a9f6343a6cd722e258c65e0b69b
zink: implement async gfx precompile

the pipe_context::link_shader hook is called when shaders are
linked into a program by the application

by leveraging this, it becomes possible to utilize the existing
graphics pipeline library to implement precompilation
by creating a partial pipeline containing only the shader stages
and then adding in the vertex input and fragment output stages
dynamically using the fast-link feature

if all goes well, and if the vulkan driver's fast-linking is
truly fast, the full pipeline should be dynamically combined
in time to avoid stuttering, and an optimized variant will be
queued for async compile to be used the next time the pipeline
triggers a draw

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18961>
src/gallium/drivers/zink/zink_compiler.c
src/gallium/drivers/zink/zink_program.c
src/gallium/drivers/zink/zink_program.h
src/gallium/drivers/zink/zink_program_state.hpp
src/gallium/drivers/zink/zink_screen.c
src/gallium/drivers/zink/zink_types.h