2021-02-21 17:30:12 +00:00
|
|
|
msg = []
|
|
|
|
if 'vulkan' in renderers
|
|
|
|
msg += 'Install "@0@" or pass "-Dvulkan=disabled" to disable it.'
|
|
|
|
else
|
|
|
|
msg += 'Required for vulkan renderer support.'
|
|
|
|
endif
|
|
|
|
|
|
|
|
dep_vulkan = dependency('vulkan',
|
|
|
|
version: '>=1.2.182',
|
|
|
|
required: 'vulkan' in renderers,
|
|
|
|
not_found_message: '\n'.join(msg).format('vulkan')
|
|
|
|
)
|
|
|
|
if not dep_vulkan.found()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2021-10-19 10:20:56 +00:00
|
|
|
# Vulkan headers are installed separately from the loader (which ships the
|
|
|
|
# pkg-config file)
|
|
|
|
if not cc.check_header('vulkan/vulkan.h', dependencies: dep_vulkan)
|
|
|
|
if 'vulkan' in renderers
|
|
|
|
error('\n'.join(msg).format('vulkan-headers'))
|
|
|
|
else
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2023-07-27 07:59:02 +00:00
|
|
|
glslang = find_program('glslang', 'glslangValidator', native: true, required: false)
|
2021-02-21 17:30:12 +00:00
|
|
|
if not glslang.found()
|
|
|
|
if 'vulkan' in renderers
|
|
|
|
error('\n'.join(msg).format('glslang'))
|
|
|
|
else
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-11-07 12:22:14 +00:00
|
|
|
glslang_version_info = run_command(glslang, '--version', check: true).stdout()
|
|
|
|
glslang_version = glslang_version_info.split('\n')[0].split(':')[-1]
|
|
|
|
|
2021-02-21 17:30:12 +00:00
|
|
|
wlr_files += files(
|
2023-04-14 09:40:44 +00:00
|
|
|
'pass.c',
|
2021-02-21 17:30:12 +00:00
|
|
|
'renderer.c',
|
|
|
|
'texture.c',
|
|
|
|
'vulkan.c',
|
|
|
|
'util.c',
|
|
|
|
'pixel_format.c',
|
|
|
|
)
|
|
|
|
|
|
|
|
wlr_deps += dep_vulkan
|
|
|
|
features += { 'vulkan-renderer': true }
|
|
|
|
|
|
|
|
subdir('shaders')
|