From 258487370fd840b018a404225277d74f74899c59 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 13 Sep 2017 03:09:48 +0200 Subject: vo_gpu: vulkan: generalize SPIR-V compiler In addition to the built-in nvidia compiler, we now also support a backend based on libshaderc. shaderc is sort of like glslang except it has a C API and is available as a dynamic library. The generated SPIR-V is now cached alongside the VkPipeline in the cached_program. We use a special cache header to ensure validity of this cache before passing it blindly to the vulkan implementation, since passing invalid SPIR-V can cause all sorts of nasty things. It's also designed to self-invalidate if the compiler gets better, by offering a catch-all `int compiler_version` that implementations can use as a cache invalidation marker. --- options/options.c | 2 ++ options/options.h | 1 + 2 files changed, 3 insertions(+) (limited to 'options') diff --git a/options/options.c b/options/options.c index 6467468691..b96ed5ef02 100644 --- a/options/options.c +++ b/options/options.c @@ -90,6 +90,7 @@ extern const struct m_obj_list ao_obj_list; extern const struct m_sub_options opengl_conf; extern const struct m_sub_options vulkan_conf; +extern const struct m_sub_options spirv_conf; extern const struct m_sub_options angle_conf; extern const struct m_sub_options cocoa_conf; @@ -686,6 +687,7 @@ const m_option_t mp_opts[] = { OPT_SUBSTRUCT("", demux_opts, demux_conf, 0), OPT_SUBSTRUCT("", gl_video_opts, gl_video_conf, 0), + OPT_SUBSTRUCT("", spirv_opts, spirv_conf, 0), #if HAVE_GL OPT_SUBSTRUCT("", opengl_opts, opengl_conf, 0), diff --git a/options/options.h b/options/options.h index 63dee03612..d2d0ea3cf9 100644 --- a/options/options.h +++ b/options/options.h @@ -330,6 +330,7 @@ typedef struct MPOpts { struct angle_opts *angle_opts; struct opengl_opts *opengl_opts; struct vulkan_opts *vulkan_opts; + struct spirv_opts *spirv_opts; struct cocoa_opts *cocoa_opts; struct dvd_opts *dvd_opts; -- cgit v1.2.3