From 52ab408299ede98eec84e06a95ee926e94b4a213 Mon Sep 17 00:00:00 2001 From: uni-dos <32173659+uni-dos@users.noreply.github.com> Date: Sat, 19 Feb 2022 14:02:41 -0800 Subject: [PATCH 1/6] started implementing meson --- include/meson.build | 3 +++ meson.build | 50 +++++++++++++++++++++++++++++++++++++++++++++ meson_options.txt | 3 +++ src/meson.build | 17 +++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 include/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 src/meson.build diff --git a/include/meson.build b/include/meson.build new file mode 100644 index 0000000..4c5f3f3 --- /dev/null +++ b/include/meson.build @@ -0,0 +1,3 @@ +vk_helpers_inc = include_directories('.') + +install_headers('vkh.h', subdir : 'vkhelpers') \ No newline at end of file diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..cce6ea4 --- /dev/null +++ b/meson.build @@ -0,0 +1,50 @@ +project( + 'vkh', + 'c', 'cpp', + version : '0.1.0', + meson_version : '>=0.56.2', + default_options : [ + 'c_std=c11', + 'cpp_std=c++11', + 'libdir=lib' #default in cmake + ] +) + +lib_so_version = '1' + +# meson defaults to a debug build +if get_option('buildtype').startswith('debug') + add_project_arguments(['-DDEBUG', '-Wall', + '-Wno-extra', '-Wno-unknown-pragmas'], language : 'c' ) +else + add_project_arguments('-w', language : 'c') +endif + + +if get_option('VKH_ENABLE_VMA') # currently the only option and is required + add_project_arguments('-DUSE_VMA', language : 'cpp') +endif + +if get_option('ENABLE_VALIDATION') + add_project_arguments('-DVKH_USE_VALIDATION', language : 'c') +endif + +vulkan_dep = dependency('vulkan') + +pkg_conf = import('pkgconfig') + +subdir('include') + +subdir('src') + +declare_dependency( + link_with : vk_helper_lib, + include_directories : vk_helpers_inc +) + +pkg_conf.generate(vk_helper_lib, + name : meson.project_name(), + version : meson.project_version(), + filebase : meson.project_name(), + description : 'Vulkan helpers library', +) \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..9caaca6 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('VKH_BUILD_SHARED_LIB', type : 'boolean', value : false, description : 'Build using shared libraries') +option('VKH_ENABLE_VMA', type : 'boolean', value : true, description : 'enable Vulkan Memory Allocator') +option('ENABLE_VALIDATION', type : 'boolean', value : true, description : 'enable vulkan validation layer') \ No newline at end of file diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..12c89ec --- /dev/null +++ b/src/meson.build @@ -0,0 +1,17 @@ +vkhelpers_sources = [ + 'vkh_app.c', 'vkh_buffer.c', + 'vkh_device.c', 'vkh_image.c', + 'vkh_phyinfo.c', 'vkh_presenter.c', + 'vkh_queue.c', 'vkhelpers.c', + 'VmaUsage.cpp' +] + +vk_helper_lib = library(meson.project_name(), + vkhelpers_sources, + include_directories : [vk_helpers_inc], + dependencies : vulkan_dep, + version : meson.project_version(), + soversion : lib_so_version, + install : true +) + From f94dca3b413022d75b54d4928de5c14a3e05f3a9 Mon Sep 17 00:00:00 2001 From: uni-dos <32173659+uni-dos@users.noreply.github.com> Date: Sat, 19 Feb 2022 14:46:07 -0800 Subject: [PATCH 2/6] can be build either statically or shared --- include/meson.build | 2 +- src/meson.build | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/meson.build b/include/meson.build index 4c5f3f3..d83c84e 100644 --- a/include/meson.build +++ b/include/meson.build @@ -1,3 +1,3 @@ vk_helpers_inc = include_directories('.') -install_headers('vkh.h', subdir : 'vkhelpers') \ No newline at end of file +install_headers('vkh.h') \ No newline at end of file diff --git a/src/meson.build b/src/meson.build index 12c89ec..886c378 100644 --- a/src/meson.build +++ b/src/meson.build @@ -6,8 +6,9 @@ vkhelpers_sources = [ 'VmaUsage.cpp' ] -vk_helper_lib = library(meson.project_name(), +vk_helper_lib = build_target(meson.project_name(), vkhelpers_sources, + target_type : meson.is_subproject() ? 'static_library' : 'library', include_directories : [vk_helpers_inc], dependencies : vulkan_dep, version : meson.project_version(), From 4b6684883308f95f49f18c484af1b75d139c131a Mon Sep 17 00:00:00 2001 From: uni-dos <32173659+uni-dos@users.noreply.github.com> Date: Sat, 26 Mar 2022 12:16:16 -0700 Subject: [PATCH 3/6] working build with meson --- include/meson.build | 3 - meson.build | 192 +++++++++++++++++++++++++++++++++++++++----- meson_options.txt | 4 +- src/meson.build | 18 ----- 4 files changed, 175 insertions(+), 42 deletions(-) delete mode 100644 include/meson.build delete mode 100644 src/meson.build diff --git a/include/meson.build b/include/meson.build deleted file mode 100644 index d83c84e..0000000 --- a/include/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -vk_helpers_inc = include_directories('.') - -install_headers('vkh.h') \ No newline at end of file diff --git a/meson.build b/meson.build index cce6ea4..a02ee66 100644 --- a/meson.build +++ b/meson.build @@ -1,48 +1,204 @@ +# ///////////////////////////////////////// +# VKH Library Build Configurations # +# ///////////////////////////////////////// + project( 'vkh', 'c', 'cpp', - version : '0.1.0', + version : '0.3.0', meson_version : '>=0.56.2', default_options : [ 'c_std=c11', - 'cpp_std=c++11', - 'libdir=lib' #default in cmake + 'cpp_std=c++11' ] ) +ENABLE_VALIDATION_OPT = false lib_so_version = '1' -# meson defaults to a debug build -if get_option('buildtype').startswith('debug') - add_project_arguments(['-DDEBUG', '-Wall', - '-Wno-extra', '-Wno-unknown-pragmas'], language : 'c' ) +# VMA Options + +# Enable VMA memory recording for debugging +VMA_RECORDING_ENABLD = false + +# Use C++ STL containers instead of VMA's containers +VMA_USE_STL_CONTAINERS = false + +# Link statically with Vulkan API +VMA_STATIC_VULKAN_FUNCTIONS = false + +# Fetch pointers to Vulkan functions internally (no static linking) +VMA_DYNAMIC_VULKAN_FUNCTIONS = true + +# Every allocation will have its own memory block +VMA_DEBUG_ALWAYS_DEDICATED_MEMORY = false + +# Automatically fill new allocations and destroyed allocations with some bit pattern +VMA_DEBUG_INITIALIZE_ALLOCATIONS = false + +# Enable single mutex protecting all entry calls to the library +VMA_DEBUG_GLOBAL_MUTEX = false + +# Never exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount and return error +VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT = false + +# Minimum alignment of all allocations, in bytes. +# Set to more than 1 for debugging purposes only. Must be power of two. +VMA_DEBUG_ALIGNMENT = 1 + +# Minimum margin before and after every allocation, in bytes. +# Set nonzero for debugging purposes only. +VMA_DEBUG_MARGIN = 0 + +# Minimum value for VkPhysicalDeviceLimits::bufferImageGranularity. +# Set to more than 1 for debugging purposes only. Must be power of two. +VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY = 1 + +# Maximum size of a memory heap in Vulkan to consider it "small". +VMA_SMALL_HEAP_MAX_SIZE = 1073741824 # 1 Gigabyte + +# Default size of a block allocated as single VkDeviceMemory from a "large" heap. +VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE = 268435456 # 256 Megabytes + +# Configuration for Debug/Release builds +vkh_compile_options = [] + +if (get_option('buildtype').startswith('debug')) + vkh_compile_options = ['-DDEBUG'] + ENABLE_VALIDATION = true + if (build_machine.system() == 'linux') + vkh_compile_options += ['-Wall', '-Wno-extra', '-Wno-unknown-pragmas'] + elif (build_machine.system() == 'windows') + vkh_compile_options += ['/W4', '/wd4204', '/wd4221', '/wd4100'] + endif else - add_project_arguments('-w', language : 'c') + if (build_machine.system() == 'linux') + vkh_compile_options += ['-w'] + elif (build_machine.system() == 'windows') + vkh_compile_options += ['/W0'] + endif +endif + +# Enable Vulkan Memory Allocator - For more information: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator +# currently the only option +if (get_option('VKH_ENABLE_VMA')) + vkh_compile_options += '-DUSE_VMA' +endif + +if (ENABLE_VALIDATION_OPT == true) + vkh_compile_options += '-DVKH_USE_VALIDATION' +endif + + +# VMA Options Define Flags +if (VMA_RECORDING_ENABLD == true) + vkh_compile_options += '-DVMA_RECORDING_ENABLED=1' +endif + +if (VMA_USE_STL_CONTAINERS == true) + vkh_compile_options += '-DVMA_USE_STL_CONTAINERS=1' +endif + +if (VMA_STATIC_VULKAN_FUNCTIONS == true) + vkh_compile_options += '-DVMA_STATIC_VULKAN_FUNCTIONS=1' +endif + +if (VMA_DYNAMIC_VULKAN_FUNCTIONS == true) + vkh_compile_options += '-DVMA_DYNAMIC_VULKAN_FUNCTIONS=1' +endif + +if (VMA_DEBUG_ALWAYS_DEDICATED_MEMORY == true) + vkh_compile_options += '-DVMA_DEBUG_ALWAYS_DEDICATED_MEMORY=1' +endif + +if (VMA_DEBUG_INITIALIZE_ALLOCATIONS == true) + vkh_compile_options += '-DVMA_DEBUG_INITIALIZE_ALLOCATIONS=1' +endif + +if (VMA_DEBUG_GLOBAL_MUTEX == true) + vkh_compile_options += '-DVMA_DEBUG_GLOBAL_MUTEX=1' +endif + +if (VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT == true) + vkh_compile_options += '-DVMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT=1' +endif + +if (VMA_DEBUG_ALIGNMENT != 1) + vkh_compile_options += '-DVMA_DEBUG_ALIGNMENT=' + VMA_DEBUG_ALIGNMENT endif +if (VMA_DEBUG_MARGIN != 0) + vkh_compile_options += '-DVMA_DEBUG_MARGIN=' + VMA_DEBUG_MARGIN +endif + +if (VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY != 1) + vkh_compile_options += '-DVMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY=' + VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY +endif -if get_option('VKH_ENABLE_VMA') # currently the only option and is required - add_project_arguments('-DUSE_VMA', language : 'cpp') +if (VMA_SMALL_HEAP_MAX_SIZE != 1073741824) # 1 Gigabyte + vkh_compile_options += '-DVMA_SMALL_HEAP_MAX_SIZE=' + VMA_SMALL_HEAP_MAX_SIZE endif -if get_option('ENABLE_VALIDATION') - add_project_arguments('-DVKH_USE_VALIDATION', language : 'c') +if (VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE != 268435456) # 256 Megabytes + vkh_compile_options += '-DVMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE=' + VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE endif +# vkh dependencies vulkan_dep = dependency('vulkan') +threads_dep = dependency('threads') +vkh_dependencies = [vulkan_dep, threads_dep] pkg_conf = import('pkgconfig') -subdir('include') -subdir('src') +vkh_src = [ + 'src/vkh_app.c', + 'src/vkh_buffer.c', + 'src/vkh_device.c', + 'src/vkh_image.c', + 'src/vkh_phyinfo.c', + 'src/vkh_presenter.c', + 'src/vkh_queue.c', + 'src/vkhelpers.c', + 'src/deps/tinycthread.c', + 'src/VmaUsage.cpp' +] -declare_dependency( - link_with : vk_helper_lib, - include_directories : vk_helpers_inc +vkh_include = [ + 'include', + 'src', + 'src/deps' +] + +vkh_shared_library = shared_library('vkh', + c_args: [vkh_compile_options, '-DVKH_SHARED_BUILD'], + cpp_args: [vkh_compile_options, '-DVKH_SHARED_BUILD'], + build_by_default: true, + install: true, + soversion: lib_so_version, + sources: vkh_src, + include_directories: vkh_include, + dependencies: vkh_dependencies +) + +vkh_static_library = static_library('vkh', + c_args: [vkh_compile_options, '-DVKH_STATIC_BUILD'], + cpp_args: [vkh_compile_options, '-DVKH_STATIC_BUILD'], + build_by_default: true, + install: true, + sources: vkh_src, + include_directories: vkh_include, + dependencies: vkh_dependencies ) -pkg_conf.generate(vk_helper_lib, +install_headers('include/vkh.h', subdir: 'vkh') + +vkh_shared_dep = declare_dependency(dependencies: vkh_dependencies, include_directories: 'include', link_with: vkh_shared_library) +vkh_static_dep = declare_dependency(dependencies: vkh_dependencies, include_directories: 'include', link_with: vkh_static_library) + + +# generate a pkgconfig file for shared lib +pkg_conf.generate(vkh_shared_library, name : meson.project_name(), version : meson.project_version(), filebase : meson.project_name(), diff --git a/meson_options.txt b/meson_options.txt index 9caaca6..c9500df 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1 @@ -option('VKH_BUILD_SHARED_LIB', type : 'boolean', value : false, description : 'Build using shared libraries') -option('VKH_ENABLE_VMA', type : 'boolean', value : true, description : 'enable Vulkan Memory Allocator') -option('ENABLE_VALIDATION', type : 'boolean', value : true, description : 'enable vulkan validation layer') \ No newline at end of file +option('VKH_ENABLE_VMA', type : 'boolean', value : true, description : 'enable Vulkan Memory Allocator') \ No newline at end of file diff --git a/src/meson.build b/src/meson.build deleted file mode 100644 index 886c378..0000000 --- a/src/meson.build +++ /dev/null @@ -1,18 +0,0 @@ -vkhelpers_sources = [ - 'vkh_app.c', 'vkh_buffer.c', - 'vkh_device.c', 'vkh_image.c', - 'vkh_phyinfo.c', 'vkh_presenter.c', - 'vkh_queue.c', 'vkhelpers.c', - 'VmaUsage.cpp' -] - -vk_helper_lib = build_target(meson.project_name(), - vkhelpers_sources, - target_type : meson.is_subproject() ? 'static_library' : 'library', - include_directories : [vk_helpers_inc], - dependencies : vulkan_dep, - version : meson.project_version(), - soversion : lib_so_version, - install : true -) - From 6438d5fbc26ed60b519cdf4ae9838c7e55e4fe3f Mon Sep 17 00:00:00 2001 From: uni-dos <32173659+uni-dos@users.noreply.github.com> Date: Sat, 26 Mar 2022 13:50:07 -0700 Subject: [PATCH 4/6] added more meson options --- meson.build | 54 ++++++++++++++++++++++++++--------------------- meson_options.txt | 16 +++++++++++++- 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/meson.build b/meson.build index a02ee66..e6cf56e 100644 --- a/meson.build +++ b/meson.build @@ -13,59 +13,65 @@ project( ] ) -ENABLE_VALIDATION_OPT = false lib_so_version = '1' +# Enable Vulkan Validation Layer +ENABLE_VALIDATION_OPT = get_option('ENABLE_VALIDATION_OPT') + +# Enable Vulkan Memory Allocator - For more information: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator +# Currently the only option +VKH_ENABLE_VMA = get_option('VKH_ENABLE_VMA') + # VMA Options # Enable VMA memory recording for debugging -VMA_RECORDING_ENABLD = false +VMA_RECORDING_ENABLED = get_option('VMA_RECORDING_ENABLED') # Use C++ STL containers instead of VMA's containers -VMA_USE_STL_CONTAINERS = false +VMA_USE_STL_CONTAINERS = get_option('VMA_USE_STL_CONTAINERS') # Link statically with Vulkan API -VMA_STATIC_VULKAN_FUNCTIONS = false +VMA_STATIC_VULKAN_FUNCTIONS = get_option('VMA_STATIC_VULKAN_FUNCTIONS') # Fetch pointers to Vulkan functions internally (no static linking) -VMA_DYNAMIC_VULKAN_FUNCTIONS = true +VMA_DYNAMIC_VULKAN_FUNCTIONS = get_option('VMA_DYNAMIC_VULKAN_FUNCTIONS') # Every allocation will have its own memory block -VMA_DEBUG_ALWAYS_DEDICATED_MEMORY = false +VMA_DEBUG_ALWAYS_DEDICATED_MEMORY = get_option('VMA_DEBUG_ALWAYS_DEDICATED_MEMORY') # Automatically fill new allocations and destroyed allocations with some bit pattern -VMA_DEBUG_INITIALIZE_ALLOCATIONS = false +VMA_DEBUG_INITIALIZE_ALLOCATIONS = get_option('VMA_DEBUG_INITIALIZE_ALLOCATIONS') # Enable single mutex protecting all entry calls to the library -VMA_DEBUG_GLOBAL_MUTEX = false +VMA_DEBUG_GLOBAL_MUTEX = get_option('VMA_DEBUG_GLOBAL_MUTEX') # Never exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount and return error -VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT = false +VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT = get_option('VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT') # Minimum alignment of all allocations, in bytes. # Set to more than 1 for debugging purposes only. Must be power of two. -VMA_DEBUG_ALIGNMENT = 1 +VMA_DEBUG_ALIGNMENT = get_option('VMA_DEBUG_ALIGNMENT') # Minimum margin before and after every allocation, in bytes. # Set nonzero for debugging purposes only. -VMA_DEBUG_MARGIN = 0 +VMA_DEBUG_MARGIN = get_option('VMA_DEBUG_MARGIN') # Minimum value for VkPhysicalDeviceLimits::bufferImageGranularity. # Set to more than 1 for debugging purposes only. Must be power of two. -VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY = 1 +VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY = get_option('VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY') # Maximum size of a memory heap in Vulkan to consider it "small". -VMA_SMALL_HEAP_MAX_SIZE = 1073741824 # 1 Gigabyte +VMA_SMALL_HEAP_MAX_SIZE = get_option('VMA_SMALL_HEAP_MAX_SIZE') # 1 Gigabyte default # Default size of a block allocated as single VkDeviceMemory from a "large" heap. -VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE = 268435456 # 256 Megabytes +VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE = get_option('VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE') # 256 Megabytes default # Configuration for Debug/Release builds vkh_compile_options = [] if (get_option('buildtype').startswith('debug')) vkh_compile_options = ['-DDEBUG'] - ENABLE_VALIDATION = true + ENABLE_VALIDATION_OPT = true if (build_machine.system() == 'linux') vkh_compile_options += ['-Wall', '-Wno-extra', '-Wno-unknown-pragmas'] elif (build_machine.system() == 'windows') @@ -85,41 +91,41 @@ if (get_option('VKH_ENABLE_VMA')) vkh_compile_options += '-DUSE_VMA' endif -if (ENABLE_VALIDATION_OPT == true) +if (ENABLE_VALIDATION_OPT) vkh_compile_options += '-DVKH_USE_VALIDATION' endif # VMA Options Define Flags -if (VMA_RECORDING_ENABLD == true) +if (VMA_RECORDING_ENABLED) vkh_compile_options += '-DVMA_RECORDING_ENABLED=1' endif -if (VMA_USE_STL_CONTAINERS == true) +if (VMA_USE_STL_CONTAINERS) vkh_compile_options += '-DVMA_USE_STL_CONTAINERS=1' endif -if (VMA_STATIC_VULKAN_FUNCTIONS == true) +if (VMA_STATIC_VULKAN_FUNCTIONS) vkh_compile_options += '-DVMA_STATIC_VULKAN_FUNCTIONS=1' endif -if (VMA_DYNAMIC_VULKAN_FUNCTIONS == true) +if (VMA_DYNAMIC_VULKAN_FUNCTIONS) vkh_compile_options += '-DVMA_DYNAMIC_VULKAN_FUNCTIONS=1' endif -if (VMA_DEBUG_ALWAYS_DEDICATED_MEMORY == true) +if (VMA_DEBUG_ALWAYS_DEDICATED_MEMORY) vkh_compile_options += '-DVMA_DEBUG_ALWAYS_DEDICATED_MEMORY=1' endif -if (VMA_DEBUG_INITIALIZE_ALLOCATIONS == true) +if (VMA_DEBUG_INITIALIZE_ALLOCATIONS) vkh_compile_options += '-DVMA_DEBUG_INITIALIZE_ALLOCATIONS=1' endif -if (VMA_DEBUG_GLOBAL_MUTEX == true) +if (VMA_DEBUG_GLOBAL_MUTEX) vkh_compile_options += '-DVMA_DEBUG_GLOBAL_MUTEX=1' endif -if (VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT == true) +if (VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT) vkh_compile_options += '-DVMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT=1' endif diff --git a/meson_options.txt b/meson_options.txt index c9500df..72386c1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1,15 @@ -option('VKH_ENABLE_VMA', type : 'boolean', value : true, description : 'enable Vulkan Memory Allocator') \ No newline at end of file +option('ENABLE_VALIDATION_OPT', type: 'boolean', value: false, description: 'Enable Vulkan Validation Layer') +option('VKH_ENABLE_VMA', type: 'boolean', value: true, description: 'Enable Vulkan Memory Allocator - For more information: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator') +option('VMA_RECORDING_ENABLED', type: 'boolean', value: false, description: 'Enable VMA memory recording for debugging') +option('VMA_USE_STL_CONTAINERS', type: 'boolean', value: false, description: 'Use C++ STL containers instead of VMAs containers') +option('VMA_STATIC_VULKAN_FUNCTIONS', type: 'boolean', value: false, description: 'Link statically with Vulkan API') +option('VMA_DYNAMIC_VULKAN_FUNCTIONS', type: 'boolean', value: true, description: 'Fetch pointers to Vulkan functions internally (no static linking)') +option('VMA_DEBUG_ALWAYS_DEDICATED_MEMORY', type: 'boolean', value: false, description: 'Every allocation will have its own memory block') +option('VMA_DEBUG_INITIALIZE_ALLOCATIONS', type: 'boolean', value: false, description: 'Automatically fill new allocations and destroyed allocations with some bit pattern') +option('VMA_DEBUG_GLOBAL_MUTEX', type: 'boolean', value: false, description: 'Enable single mutex protecting all entry calls to the library') +option('VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT', type: 'boolean', value: false, description: 'Never exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount and return error') +option('VMA_DEBUG_ALIGNMENT', type: 'integer', value: 1, description: 'Minimum alignment of all allocations, in bytes. Set to more than 1 for debugging purposes only. Must be power of two.') +option('VMA_DEBUG_MARGIN', type: 'integer', value: 0, description: 'Minimum margin before and after every allocation, in bytes. Set nonzero for debugging purposes only.') +option('VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY', type: 'integer', value: 1, description: 'Minimum value for VkPhysicalDeviceLimits::bufferImageGranularity. Set to more than 1 for debugging purposes only. Must be power of two.') +option('VMA_SMALL_HEAP_MAX_SIZE', type: 'integer', value: 1073741824, description: 'Maximum size of a memory heap in Vulkan to consider it "small".') +option('VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE', type: 'integer', value: 268435456, description: 'Default size of a block allocated as single VkDeviceMemory from a "large" heap.') \ No newline at end of file From abcbb6413a9eb73e32c473c6790e849aedaf22f4 Mon Sep 17 00:00:00 2001 From: uni-dos <32173659+uni-dos@users.noreply.github.com> Date: Sat, 26 Mar 2022 15:43:30 -0700 Subject: [PATCH 5/6] added summary section --- meson.build | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e6cf56e..436d3ed 100644 --- a/meson.build +++ b/meson.build @@ -209,4 +209,25 @@ pkg_conf.generate(vkh_shared_library, version : meson.project_version(), filebase : meson.project_name(), description : 'Vulkan helpers library', -) \ No newline at end of file +) + +summary ({ + 'ENABLE_VALIDATION_OPT': ENABLE_VALIDATION_OPT, + 'VKH_ENABLE_VMA': VKH_ENABLE_VMA +}, section: 'VKH Options') + +summary ({ + 'VMA_RECORDING_ENABLED': VMA_RECORDING_ENABLED, + 'VMA_USE_STL_CONTAINERS': VMA_USE_STL_CONTAINERS, + 'VMA_STATIC_VULKAN_FUNCTIONS': VMA_STATIC_VULKAN_FUNCTIONS, + 'VMA_DYNAMIC_VULKAN_FUNCTIONS': VMA_DYNAMIC_VULKAN_FUNCTIONS, + 'VMA_DEBUG_ALWAYS_DEDICATED_MEMORY': VMA_DEBUG_ALWAYS_DEDICATED_MEMORY, + 'VMA_DEBUG_INITIALIZE_ALLOCATIONS': VMA_DEBUG_INITIALIZE_ALLOCATIONS, + 'VMA_DEBUG_GLOBAL_MUTEX': VMA_DEBUG_GLOBAL_MUTEX, + 'VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT': VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT, + 'VMA_DEBUG_ALIGNMENT': VMA_DEBUG_ALIGNMENT, + 'VMA_DEBUG_MARGIN': VMA_DEBUG_MARGIN, + 'VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY': VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY, + 'VMA_SMALL_HEAP_MAX_SIZE': VMA_SMALL_HEAP_MAX_SIZE, + 'VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE': VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE, +}, section: 'VMA Options') \ No newline at end of file From f809347eeaf722efd2fad286b7a2a739583d8e70 Mon Sep 17 00:00:00 2001 From: Robert Gonzalez <32173659+uni-dos@users.noreply.github.com> Date: Sat, 26 Mar 2022 19:44:02 -0700 Subject: [PATCH 6/6] Bump Meson version Bump meson to match pull request #119 --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 436d3ed..12d74db 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project( 'vkh', 'c', 'cpp', version : '0.3.0', - meson_version : '>=0.56.2', + meson_version : '>=0.62.0', default_options : [ 'c_std=c11', 'cpp_std=c++11' @@ -230,4 +230,4 @@ summary ({ 'VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY': VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY, 'VMA_SMALL_HEAP_MAX_SIZE': VMA_SMALL_HEAP_MAX_SIZE, 'VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE': VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE, -}, section: 'VMA Options') \ No newline at end of file +}, section: 'VMA Options')