diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2023-09-05 23:06:11 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2023-09-05 23:06:11 +0200 |
| commit | 0c9b7b9e6181a24673afcf4b87d850f405659308 (patch) | |
| tree | e04c5e59160ff8fd9c15f72d414d369b9cf25867 | |
| parent | dbc3e96c98c3aa15fd5200d922b0b59f50ad999f (diff) | |
don't try link vma if not use
| -rw-r--r-- | CMakeLists.txt | 8 | ||||
| -rw-r--r-- | src/vkh_image.c | 2 | ||||
| -rw-r--r-- | src/vkhelpers.c | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 867d49d..5563e16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,9 +72,13 @@ FUNCTION (setup_lib LibName) ${CMAKE_CURRENT_SOURCE_DIR}/include ${Vulkan_INCLUDE_DIRS} ) + if (VKH_USE_VMA) + TARGET_LINK_LIBRARIES("${LibName}" + PRIVATE + libVMA + ) + ENDIF() TARGET_LINK_LIBRARIES("${LibName}" - PRIVATE - libVMA PUBLIC ${Vulkan_LIBRARIES} Threads::Threads diff --git a/src/vkh_image.c b/src/vkh_image.c index b795a31..ca8ebc9 100644 --- a/src/vkh_image.c +++ b/src/vkh_image.c @@ -220,7 +220,7 @@ void vkh_image_set_layout(VkCommandBuffer cmdBuff, VkhImage image, VkImageAspect VkImageSubresourceRange subres = {aspectMask,0,1,0,1}; vkh_image_set_layout_subres(cmdBuff, image, subres, old_image_layout, new_image_layout, src_stages, dest_stages); } - +// This method is based on https://github.com/SaschaWillems/Vulkan/blob/master/base/VulkanTools.h#L88 void vkh_image_set_layout_subres(VkCommandBuffer cmdBuff, VkhImage image, VkImageSubresourceRange subresourceRange, VkImageLayout old_image_layout, VkImageLayout new_image_layout, VkPipelineStageFlags src_stages, VkPipelineStageFlags dest_stages) { diff --git a/src/vkhelpers.c b/src/vkhelpers.c index 2bf3454..fa508e5 100644 --- a/src/vkhelpers.c +++ b/src/vkhelpers.c @@ -395,6 +395,7 @@ void vkh_instance_extensions_check_init () { } void vkh_instance_extensions_check_release () { free (instExtProps); + instExtCount = 0; } static VkLayerProperties* instLayerProps; @@ -413,4 +414,5 @@ void vkh_layers_check_init () { } void vkh_layers_check_release () { free (instLayerProps); + instance_layer_count = 0; } |