diff --git a/.gitignore b/.gitignore index df555e03..7ff2aa50 100644 --- a/.gitignore +++ b/.gitignore @@ -52,5 +52,7 @@ CMakeFiles/ .clangd/ compile_commands.json -# Environment preparation scripts -setup-env.sh +# Ignore subproject path except config files +subprojects/* +!subprojects/packagefiles/ +!subprojects/*.wrap diff --git a/graphics/meson.build b/graphics/meson.build index 56794ee8..8ce2b7b0 100644 --- a/graphics/meson.build +++ b/graphics/meson.build @@ -13,36 +13,42 @@ rse_graphics_sources = [ 'src/vulkan_render_pass.c', 'src/vulkan_swapchain.c', 'src/window.c', - ] +] -vulkan_dep = dependency('vulkan', - version : '>=1.4.335') +vulkan_dep = dependency('Vulkan') -sdl3_dep = dependency('sdl3', - version : '>=3.4.0') +sdl3_dep = dependency('sdl3', version: '>=3.4.0') -freetype_dep = dependency('freetype2', - version : '>=22.1.16') -glm_dep = dependency('glm', - version : '>=1.0.3', - method : 'cmake') -vma_dep = dependency('VulkanMemoryAllocator', - version : '>=3.3.0', - modules : ['GPUOpen::VulkanMemoryAllocator']) +freetype_dep = dependency('freetype2', version: '>=22.1.16') +glm_dep = dependency('cglm', version: '>=0.9.6', method: 'cmake') + +vma_dep = dependency('VulkanMemoryAllocator', version: '>=3.3.0') + +stb = dependency('stb', + fallback: ['stb', 'stb_dep']) rse_graphics_lib = shared_library( 'rse_graphics', rse_graphics_sources, - include_directories : [ - '../' - ], - dependencies : [vulkan_dep, - vma_dep, - sdl3_dep, - freetype_dep, - glm_dep, - stb_dep, - ], + include_directories: ['../'], + dependencies: [ + vulkan_dep, + vma_dep, + sdl3_dep, + freetype_dep, + glm_dep, + stb + ], link_with: rse_utilities_lib, - install : true - ) + install: true, +) + +rse_graphics_lib_dep = declare_dependency( + link_with: rse_graphics_lib, + dependencies: [ + vulkan_dep, + vma_dep, + glm_dep + ], + include_directories: include_directories('.') +) \ No newline at end of file diff --git a/graphics/src/graphics_context.h b/graphics/src/graphics_context.h index 955a905e..c0918044 100644 --- a/graphics/src/graphics_context.h +++ b/graphics/src/graphics_context.h @@ -21,7 +21,7 @@ #include "utilities/entity.h" #include "utilities/vector.h" -#include "vma/vk_mem_alloc.h" +#include "vk_mem_alloc.h" #include "vulkan/vulkan_core.h" #include "vulkan_commons.h" diff --git a/graphics/src/vma_port.cpp b/graphics/src/vma_port.cpp index 4f0b3503..bfb0b40c 100644 --- a/graphics/src/vma_port.cpp +++ b/graphics/src/vma_port.cpp @@ -23,7 +23,7 @@ #pragma GCC diagnostic ignored "-Wswitch" #pragma GCC diagnostic ignored "-Wparentheses" #endif -#include "vma/vk_mem_alloc.h" +#include "vk_mem_alloc.h" #ifdef __unix__ #pragma GCC diagnostic pop #endif diff --git a/graphics/src/vulkan_base.c b/graphics/src/vulkan_base.c index 7cbc461f..e45bcb71 100644 --- a/graphics/src/vulkan_base.c +++ b/graphics/src/vulkan_base.c @@ -15,25 +15,23 @@ #include #include #include -#include +#include +#include +#include +#include +#include "pipeline_builder.h" #include "src/descriptor_builder.h" #include "src/graphics_context.h" #include "utilities/commons.h" #include "utilities/errors_common.h" #include "vulkan/vulkan_core.h" - -#include "vulkan_commons.h" -#include "vulkan_commands.h" #include "vulkan_buffers.h" +#include "vulkan_commands.h" +#include "vulkan_commons.h" #include "vulkan_image.h" #include "vulkan_render_pass.h" #include "vulkan_swapchain.h" -#include "pipeline_builder.h" - -#include -#include -#include #define APPLICATION_NAME "RedScarfEngine PoC" #define ENGINE_NAME "RedScarf Engine" @@ -48,8 +46,9 @@ * @return VkBool32 Should always return VK_FALSE. The VK_TRUE value is reserved for use in layer development */ static VKAPI_ATTR VkBool32 VKAPI_CALL debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, - VkDebugUtilsMessageTypeFlagsEXT message_type, - const VkDebugUtilsMessengerCallbackDataEXT* callback_data, void* user_data) + VkDebugUtilsMessageTypeFlagsEXT message_type, + const VkDebugUtilsMessengerCallbackDataEXT* callback_data, + void* user_data) { (void)message_severity; (void)message_type; @@ -80,9 +79,10 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL debug_callback(VkDebugUtilsMessageSeverity * @param debug_messenger Debug messanger handle * @return VkResult VK_SUCCESS on success */ -static VkResult CreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* create_info, - const VkAllocationCallbacks* allocator, - VkDebugUtilsMessengerEXT* debug_messenger) +static VkResult CreateDebugUtilsMessengerEXT(VkInstance instance, + const VkDebugUtilsMessengerCreateInfoEXT* create_info, + const VkAllocationCallbacks* allocator, + VkDebugUtilsMessengerEXT* debug_messenger) { PFN_vkCreateDebugUtilsMessengerEXT func = NULL; @@ -108,13 +108,12 @@ static rse_err_t setup_debug_messenger(VkInstance instance, VkDebugUtilsMessenge create_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; create_info.pNext = NULL; - create_info.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; + create_info.messageSeverity = + VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; create_info.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; + VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; create_info.pfnUserCallback = debug_callback; create_info.pUserData = NULL; // Optional create_info.flags = 0U; @@ -134,8 +133,9 @@ static rse_err_t setup_debug_messenger(VkInstance instance, VkDebugUtilsMessenge * @param debug_messenger Debug messanger handle * @param allocator Memory allocator */ -static void DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT debug_messenger, - const VkAllocationCallbacks* allocator) +static void DestroyDebugUtilsMessengerEXT(VkInstance instance, + VkDebugUtilsMessengerEXT debug_messenger, + const VkAllocationCallbacks* allocator) { PFN_vkDestroyDebugUtilsMessengerEXT func = (PFN_vkDestroyDebugUtilsMessengerEXT)vkGetInstanceProcAddr(instance, "vkDestroyDebugUtilsMessengerEXT"); @@ -173,7 +173,7 @@ static rse_err_t create_instance(VkInstance* instance) "VK_KHR_xlib_surface", #endif /* WAYLAND */ #elif defined(_WIN32) || defined(WIN32) - "VK_KHR_win32_surface", + "VK_KHR_win32_surface", #endif /* _WIN32 || WIN32 */ "VK_EXT_debug_utils", }; @@ -211,13 +211,13 @@ static rse_err_t create_instance(VkInstance* instance) /* Check if selected layers are supported*/ for (i = 0; i < enabled_instance_layers_count; ++i) { - for(j = 0; i < layersCount; ++j) { - if(strcmp(layer_properties[j].layerName, enabled_instance_layers_names[i]) == 0) { + for (j = 0; i < layersCount; ++j) { + if (strcmp(layer_properties[j].layerName, enabled_instance_layers_names[i]) == 0) { supported = 1; break; } } - if(supported == 0) { + if (supported == 0) { SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Selected layer is not supported: %s", layer_properties[j].layerName); return RSE_ERROR_INTERNAL_ERROR; } @@ -226,14 +226,16 @@ static rse_err_t create_instance(VkInstance* instance) /* Check if selected extensions are supported*/ for (i = 0; i < enabled_instance_extensions_count; ++i) { - for(j = 0; j < extensionCount; ++j) { - if(strcmp(extensions_properties[j].extensionName, enabled_instance_extensions_names[i]) == 0) { + for (j = 0; j < extensionCount; ++j) { + if (strcmp(extensions_properties[j].extensionName, enabled_instance_extensions_names[i]) == 0) { supported = 1; break; } } - if(supported == 0) { - SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Selected extension is not supported: %s", extensions_properties[j].extensionName); + if (supported == 0) { + SDL_LogCritical(SDL_LOG_CATEGORY_GPU, + "Selected extension is not supported: %s", + extensions_properties[j].extensionName); return RSE_ERROR_INTERNAL_ERROR; } supported = 0; @@ -293,7 +295,8 @@ static rse_err_t pick_physical_device(VkInstance instance, VkPhysicalDevice* phy { uint32_t physical_device_count = 0U; VkPhysicalDevice* physical_devices = NULL; - VkPhysicalDeviceProperties device_properties = {0};; + VkPhysicalDeviceProperties device_properties = {0}; + ; VkPhysicalDeviceFeatures device_features = {0}; /* Get number of existing physical devices */ @@ -378,9 +381,12 @@ static rse_err_t create_device(struct graphics_context_t* context) } /* Get information about supported queue families */ - vkGetPhysicalDeviceQueueFamilyProperties(context->vulkan_handles.physical_device, &queue_families_property_count, NULL); + vkGetPhysicalDeviceQueueFamilyProperties(context->vulkan_handles.physical_device, + &queue_families_property_count, + NULL); rse_malloc(queue_family_properties, sizeof(VkQueueFamilyProperties) * queue_families_property_count); - vkGetPhysicalDeviceQueueFamilyProperties(context->vulkan_handles.physical_device, &queue_families_property_count, + vkGetPhysicalDeviceQueueFamilyProperties(context->vulkan_handles.physical_device, + &queue_families_property_count, queue_family_properties); /* Get queue families that support graphics operations AND have most @@ -401,7 +407,10 @@ static rse_err_t create_device(struct graphics_context_t* context) /* Check for family with surface support */ VkBool32 presentSupport = VK_FALSE; - vkGetPhysicalDeviceSurfaceSupportKHR(context->vulkan_handles.physical_device, familyIdx, context->vulkan_handles.surface, &presentSupport); + vkGetPhysicalDeviceSurfaceSupportKHR(context->vulkan_handles.physical_device, + familyIdx, + context->vulkan_handles.surface, + &presentSupport); if (presentSupport) { presentation_familiy_idx = familyIdx; presentation_familiy_found = true; @@ -426,16 +435,17 @@ static rse_err_t create_device(struct graphics_context_t* context) context->queue_family_indices[QUEUE_FAMILY_INDEX_GRAPHICS] = graphics_family_idx; context->queue_family_indices[QUEUE_FAMILY_INDEX_PRESENTATION] = presentation_familiy_idx; - rse_malloc(graphics_familiy_queue_priorities, sizeof(float) * queue_family_properties[graphics_family_idx].queueCount); + rse_malloc(graphics_familiy_queue_priorities, + sizeof(float) * queue_family_properties[graphics_family_idx].queueCount); for (size_t i = 0; i < queue_family_properties[graphics_family_idx].queueCount; i++) { graphics_familiy_queue_priorities[i] = 1.0f; } - rse_malloc(presentation_familiy_queue_priorities, sizeof(float) * queue_family_properties[presentation_familiy_idx].queueCount); + rse_malloc(presentation_familiy_queue_priorities, + sizeof(float) * queue_family_properties[presentation_familiy_idx].queueCount); for (size_t i = 0; i < queue_family_properties[presentation_familiy_idx].queueCount; i++) { - presentation_familiy_queue_priorities[i] = - 1.0f; + presentation_familiy_queue_priorities[i] = 1.0f; } device_queue_createinfos[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; @@ -463,13 +473,19 @@ static rse_err_t create_device(struct graphics_context_t* context) device_create_info.ppEnabledExtensionNames = enabled_device_extensions_names; device_create_info.pEnabledFeatures = NULL; - if (VK_SUCCESS != vkCreateDevice(context->vulkan_handles.physical_device, &device_create_info, NULL, &context->vulkan_handles.device)) { + if (VK_SUCCESS != vkCreateDevice(context->vulkan_handles.physical_device, + &device_create_info, + NULL, + &context->vulkan_handles.device)) { SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Failed to create logical device"); return RSE_ERROR_INTERNAL_ERROR; } vkGetDeviceQueue(context->vulkan_handles.device, graphics_family_idx, 0, &context->vulkan_handles.graphics_queue); - vkGetDeviceQueue(context->vulkan_handles.device, presentation_familiy_idx, 0, &context->vulkan_handles.present_queue); + vkGetDeviceQueue(context->vulkan_handles.device, + presentation_familiy_idx, + 0, + &context->vulkan_handles.present_queue); rse_free(presentation_familiy_queue_priorities); rse_free(graphics_familiy_queue_priorities); @@ -505,7 +521,6 @@ static rse_err_t create_memory_allocator(struct graphics_context_t* context) return RSE_ERROR_NO_ERROR; } - /** * @brief Create a Sync Objects * @@ -522,25 +537,34 @@ static rse_err_t create_sync_objects(struct graphics_context_t* context) fenceInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT; for (size_t i = 0; i < SWAP_BUFFER_COUNT; ++i) { - if (VK_SUCCESS != vkCreateSemaphore(context->vulkan_handles.device, &semaphore_info, NULL, &context->vulkan_handles.image_available_semaphores[i]) || - VK_SUCCESS != vkCreateSemaphore(context->vulkan_handles.device, &semaphore_info, NULL, &context->vulkan_handles.render_finished_semaphores[i]) || - VK_SUCCESS != vkCreateFence(context->vulkan_handles.device, &fenceInfo, NULL, &context->vulkan_handles.in_flight_fences[i])) { - SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Failed to create sync objects."); - return RSE_ERROR_INTERNAL_ERROR; + if (VK_SUCCESS != vkCreateSemaphore(context->vulkan_handles.device, + &semaphore_info, + NULL, + &context->vulkan_handles.image_available_semaphores[i]) || + VK_SUCCESS != vkCreateSemaphore(context->vulkan_handles.device, + &semaphore_info, + NULL, + &context->vulkan_handles.render_finished_semaphores[i]) || + VK_SUCCESS != vkCreateFence(context->vulkan_handles.device, + &fenceInfo, + NULL, + &context->vulkan_handles.in_flight_fences[i])) { + SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Failed to create sync objects."); + return RSE_ERROR_INTERNAL_ERROR; } } return RSE_ERROR_NO_ERROR; } - rse_err_t vulkan_init(struct graphics_context_t* context) { rse_err_t status = RSE_ERROR_NO_ERROR; STATUS_CHECK(create_instance(&context->vulkan_handles.instance)); STATUS_CHECK(setup_debug_messenger(context->vulkan_handles.instance, &context->vulkan_handles.debug_messenger)); - STATUS_CHECK(create_surface(context->vulkan_handles.instance, context->window_handle, &context->vulkan_handles.surface)); + STATUS_CHECK( + create_surface(context->vulkan_handles.instance, context->window_handle, &context->vulkan_handles.surface)); STATUS_CHECK(pick_physical_device(context->vulkan_handles.instance, &context->vulkan_handles.physical_device)); STATUS_CHECK(create_device(context)); STATUS_CHECK(create_memory_allocator(context)); @@ -574,12 +598,20 @@ rse_err_t vulkan_draw_frame(struct graphics_context_t* context) VkPresentInfoKHR present_info = {0}; VkSwapchainKHR swap_chains[1]; - vkWaitForFences(context->vulkan_handles.device, 1, &context->vulkan_handles.in_flight_fences[context->current_frame], VK_TRUE, UINT64_MAX); + vkWaitForFences(context->vulkan_handles.device, + 1, + &context->vulkan_handles.in_flight_fences[context->current_frame], + VK_TRUE, + UINT64_MAX); STATUS_CHECK(buffers_update(context)); - result = vkAcquireNextImageKHR(context->vulkan_handles.device, context->swapchain_data.swapchain, UINT64_MAX, context->vulkan_handles.image_available_semaphores[context->current_frame], - VK_NULL_HANDLE, &image_index); + result = vkAcquireNextImageKHR(context->vulkan_handles.device, + context->swapchain_data.swapchain, + UINT64_MAX, + context->vulkan_handles.image_available_semaphores[context->current_frame], + VK_NULL_HANDLE, + &image_index); if (result == VK_ERROR_OUT_OF_DATE_KHR) { recreate_swapchain(context); @@ -612,7 +644,10 @@ rse_err_t vulkan_draw_frame(struct graphics_context_t* context) submit_info.signalSemaphoreCount = 1; submit_info.pSignalSemaphores = signal_semaphores; - if (vkQueueSubmit(context->vulkan_handles.graphics_queue, 1, &submit_info, context->vulkan_handles.in_flight_fences[context->current_frame]) != VK_SUCCESS) { + if (vkQueueSubmit(context->vulkan_handles.graphics_queue, + 1, + &submit_info, + context->vulkan_handles.in_flight_fences[context->current_frame]) != VK_SUCCESS) { SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Failed to submit draw command buffer!"); return RSE_ERROR_INTERNAL_ERROR; } diff --git a/graphics/src/vulkan_buffers.h b/graphics/src/vulkan_buffers.h index a2e983e0..c0dceb05 100644 --- a/graphics/src/vulkan_buffers.h +++ b/graphics/src/vulkan_buffers.h @@ -2,7 +2,7 @@ #define VULKAN_BUFFERS_H #include -#include +#include #include "graphics_context.h" #include "utilities/commons.h" diff --git a/graphics/src/vulkan_commands.h b/graphics/src/vulkan_commands.h index 53bb52e8..86fd10bf 100644 --- a/graphics/src/vulkan_commands.h +++ b/graphics/src/vulkan_commands.h @@ -12,7 +12,7 @@ #ifndef VULKAN_COMMANDS_H #define VULKAN_COMMANDS_H -#include +#include #include #include "utilities/commons.h" diff --git a/graphics/src/vulkan_commons.h b/graphics/src/vulkan_commons.h index b8bfe577..135bb154 100644 --- a/graphics/src/vulkan_commons.h +++ b/graphics/src/vulkan_commons.h @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include diff --git a/graphics/src/vulkan_image.c b/graphics/src/vulkan_image.c index 65a487fa..9d133a02 100644 --- a/graphics/src/vulkan_image.c +++ b/graphics/src/vulkan_image.c @@ -17,7 +17,7 @@ #include #define STB_IMAGE_IMPLEMENTATION -#include "stb/stb_image.h" +#include "stb_image.h" #define IMAGE_TAKEN 1U #define IMAGE_FREE 0U diff --git a/meson.build b/meson.build index d32e9a96..7aa4b2ea 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('RedScarfEngine', 'werror=true' ]) -# add_project_arguments('-DWAYLAND=1', language : 'c') +add_project_arguments('-DWAYLAND=1', language : 'c') subdir('utilities') subdir('graphics') diff --git a/red_scarf_engine/CMakeLists.txt b/red_scarf_engine/CMakeLists.txt deleted file mode 100644 index bf138996..00000000 --- a/red_scarf_engine/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") - -add_executable(${PROJECT_NAME} src/main.c) - -target_include_directories(${PROJECT_NAME} PRIVATE - ${CMAKE_SOURCE_DIR}) - -target_link_libraries(${PROJECT_NAME} PRIVATE - graphics - utilities) \ No newline at end of file diff --git a/red_scarf_engine/meson.build b/red_scarf_engine/meson.build index a6b78e76..45c96b74 100644 --- a/red_scarf_engine/meson.build +++ b/red_scarf_engine/meson.build @@ -14,9 +14,9 @@ executable( ], dependencies : [ sdl3_dep, + rse_graphics_lib_dep, ], link_with: [ - rse_graphics_lib, rse_events_lib, rse_utilities_lib, ], diff --git a/subprojects/cglm.wrap b/subprojects/cglm.wrap new file mode 100644 index 00000000..19371e98 --- /dev/null +++ b/subprojects/cglm.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = cglm-0.9.6 +source_url = https://github.com/recp/cglm/archive/refs/tags/v0.9.6.tar.gz +source_filename = cglm-0.9.6.tar.gz +source_hash = be5e7d384561eb0fca59724a92b7fb44bf03e588a7eae5123a7d796002928184 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/cglm_0.9.6-1/cglm-0.9.6.tar.gz +wrapdb_version = 0.9.6-1 + +[provide] +cglm = cglm_dep diff --git a/subprojects/packagefiles/stb/meson.build b/subprojects/packagefiles/stb/meson.build new file mode 100644 index 00000000..27b339bd --- /dev/null +++ b/subprojects/packagefiles/stb/meson.build @@ -0,0 +1,7 @@ +project('stb', 'c') + +stb_inc = include_directories('.') + +stb_dep = declare_dependency( + include_directories: stb_inc, +) \ No newline at end of file diff --git a/subprojects/stb.wrap b/subprojects/stb.wrap new file mode 100644 index 00000000..dc481ddf --- /dev/null +++ b/subprojects/stb.wrap @@ -0,0 +1,5 @@ +[wrap-git] +url = https://github.com/nothings/stb.git +revision = HEAD +depth = 1 +patch_directory = stb/ diff --git a/subprojects/vulkan-headers.wrap b/subprojects/vulkan-headers.wrap new file mode 100644 index 00000000..6b6944c3 --- /dev/null +++ b/subprojects/vulkan-headers.wrap @@ -0,0 +1,14 @@ +[wrap-file] +directory = Vulkan-Headers-1.4.346 +source_url = https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.4.346.tar.gz +source_filename = vulkan-headers-1.4.346.tar.gz +source_hash = 5bb77f5d7b460e255a9e51affc00d64354986b55cf577d8eab28529cad01fc80 +source_fallback_url = https://wrapdb.mesonbuild.com/v2/vulkan-headers_1.4.346-1/get_source/vulkan-headers-1.4.346.tar.gz +patch_filename = vulkan-headers_1.4.346-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/vulkan-headers_1.4.346-1/get_patch +patch_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/vulkan-headers_1.4.346-1/vulkan-headers_1.4.346-1_patch.zip +patch_hash = b85cbf6793193b28c5bd80858308b214816e66041b10ec00f0115b19f3a7a60e +wrapdb_version = 1.4.346-1 + +[provide] +dependency_names = VulkanHeaders diff --git a/subprojects/vulkan-memory-allocator.wrap b/subprojects/vulkan-memory-allocator.wrap new file mode 100644 index 00000000..500b6c51 --- /dev/null +++ b/subprojects/vulkan-memory-allocator.wrap @@ -0,0 +1,14 @@ +[wrap-file] +directory = VulkanMemoryAllocator-3.3.0 +source_url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/refs/tags/v3.3.0.tar.gz +source_filename = VulkanMemoryAllocator-3.3.0.tar.gz +source_hash = c4f6bbe6b5a45c2eb610ca9d231158e313086d5b1a40c9922cb42b597419b14e +source_fallback_url = https://wrapdb.mesonbuild.com/v2/vulkan-memory-allocator_3.3.0-1/get_source/VulkanMemoryAllocator-3.3.0.tar.gz +patch_filename = vulkan-memory-allocator_3.3.0-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/vulkan-memory-allocator_3.3.0-1/get_patch +patch_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/vulkan-memory-allocator_3.3.0-1/vulkan-memory-allocator_3.3.0-1_patch.zip +patch_hash = 85f3c1c82f3d1938fa295c80b06fc1c5c001f939f009b566c336a941d5d2d8b5 +wrapdb_version = 3.3.0-1 + +[provide] +dependency_names = VulkanMemoryAllocator diff --git a/subprojects/vulkan-validationlayers.wrap b/subprojects/vulkan-validationlayers.wrap new file mode 100644 index 00000000..d7d2afc0 --- /dev/null +++ b/subprojects/vulkan-validationlayers.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = Vulkan-ValidationLayers-1.2.158 +source_url = https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/v1.2.158.tar.gz +source_filename = vulkan-validationlayers-1.2.158.tar.gz +source_hash = 9d7a6eba2db88b8af6457acce0b638324ca03cde2e9589ae96749114091c6e9e +patch_url = https://wrapdb.mesonbuild.com/v2/vulkan-validationlayers_1.2.158-2/get_patch +patch_filename = vulkan-validationlayers-1.2.158-2-wrap.zip +patch_hash = d38dae45ca6a7124ee8df045a8d5288390ab836b4d28c53234f90baee5c649fc + diff --git a/utilities/meson.build b/utilities/meson.build index 367fbdbe..09f2b353 100644 --- a/utilities/meson.build +++ b/utilities/meson.build @@ -7,8 +7,9 @@ cc = meson.get_compiler('c') sdl3_dep = dependency('sdl3', version : '>=3.4.0') -stb_dep = dependency('stb', - version : '>=2.30.0') +stb = dependency('stb', + fallback: ['stb', 'stb_dep']) + m_dep = cc.find_library('m') rse_utilities_lib = shared_library( @@ -17,7 +18,7 @@ rse_utilities_lib = shared_library( include_directories : ['.'], dependencies : [ sdl3_dep, - stb_dep, + stb, m_dep, ], install : true diff --git a/utilities/src/file_utils.c b/utilities/src/file_utils.c index 0eeff271..5b6a8681 100644 --- a/utilities/src/file_utils.c +++ b/utilities/src/file_utils.c @@ -8,7 +8,6 @@ #include #include #include -#include #include "SDL3/SDL_log.h" #include "commons.h"