From 86daae14534f4bf0b449ceff03a46aac2f1a9242 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sun, 28 Jul 2024 23:59:32 -0700 Subject: [PATCH] meson: Define some VMA debug options for convenience --- thirdparty/meson.build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/thirdparty/meson.build b/thirdparty/meson.build index b9b9256f97..8bd29db98e 100644 --- a/thirdparty/meson.build +++ b/thirdparty/meson.build @@ -3,10 +3,20 @@ if vulkan.found() libvolk = static_library('volk', sources: 'volk/volk.c', c_args: ['-DVK_NO_PROTOTYPES'], dependencies: vulkan) volk = declare_dependency(compile_args: ['-DVK_NO_PROTOTYPES'], include_directories: 'volk', link_with: libvolk, dependencies: vulkan) +debug_vma = false + vma_defns = [ '-DVMA_STATIC_VULKAN_FUNCTIONS=0', '-DVMA_DYNAMIC_VULKAN_FUNCTIONS=0', -] + ] + +if debug_vma + vma_defns += [ + '-DVMA_DEBUG_MARGIN=16', + '-DVMA_DEBUG_DETECT_CORRUPTION=1', + '-DVMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY=256', + ] +endif libvma = static_library('vma', sources: 'vma.cc', cpp_args: vma_defns, include_directories: 'VulkanMemoryAllocator/include', dependencies: [vulkan, volk]) vma = declare_dependency(compile_args: vma_defns, include_directories: 'VulkanMemoryAllocator/include', link_with: libvma)