render/vulkan: add Vulkan allocator

This commit is contained in:
Simon Ser 2021-01-16 15:10:00 +01:00
parent f52482d23a
commit 80d870ae52
6 changed files with 543 additions and 1 deletions

View file

@ -1,6 +1,6 @@
allocators = get_option('allocators')
if 'auto' in allocators and get_option('auto_features').enabled()
allocators = ['gbm']
allocators = ['gbm', 'vulkan']
elif 'auto' in allocators and get_option('auto_features').disabled()
allocators = []
endif
@ -23,3 +23,13 @@ if gbm.found()
has = cc.has_function('gbm_bo_get_fd_for_plane', dependencies: [gbm])
internal_config.set10('HAVE_GBM_BO_GET_FD_FOR_PLANE', has)
endif
vulkan = disabler()
if 'vulkan' in allocators or 'auto' in allocators
vulkan = dependency('vulkan', required: 'vulkan' in allocators)
endif
if vulkan.found()
wlr_files += files('vulkan.c')
wlr_deps += vulkan
features += { 'vulkan-allocator': true }
endif