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. --- wscript | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'wscript') diff --git a/wscript b/wscript index 964b7878c7..694ead0736 100644 --- a/wscript +++ b/wscript @@ -806,6 +806,10 @@ video_output_features = [ 'name': '--vulkan', 'desc': 'Vulkan context support', 'func': check_cc(header_name='vulkan/vulkan.h', lib='vulkan'), + }, { + 'name': '--shaderc', + 'desc': 'libshaderc SPIR-V compiler', + 'func': check_cc(header_name='shaderc/shaderc.h', lib='shaderc_shared'), }, { 'name': 'egl-helpers', 'desc': 'EGL helper functions', -- cgit v1.2.3