Open github-actions[bot] opened 2 months ago
app_info.applicationVersion \= ...
https://github.com/mge-engine/mge/blob/344ac4b7cae078a7e8196c088d61d4b57cd4b2d2/src/modules/vulkan/render_system.cpp#L161
#else # error Missing port #endif VkBool32 render_system::debug_message_callback( VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT type, const VkDebugUtilsMessengerCallbackDataEXT* data, void* userdata) { // TODO: more detailed debug message reporting bool stop_on_error = MGE_PARAMETER(vulkan, stop_on_validation_error).get(); bool is_error = false; switch (severity) { default: case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT: MGE_DEBUG_TRACE(VULKAN) << data->pMessage; break; case VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT: MGE_INFO_TRACE(VULKAN) << data->pMessage; break; case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT: MGE_WARNING_TRACE(VULKAN) << data->pMessage; break; case VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT: MGE_ERROR_TRACE(VULKAN) << data->pMessage; is_error = true; break; } if (is_error && stop_on_error) { return VK_TRUE; } else { return VK_FALSE; } } void render_system::create_instance() { auto application_name = mge::executable_name(); VkApplicationInfo application_info = {}; application_info.pApplicationName = application_name.c_str(); // TODO: manage application version // app_info.applicationVersion = ... application_info.pEngineName = "mge"; // TODO: manage engine (library version) // app_info.engineVersion = ... application_info.apiVersion = VK_API_VERSION_1_3; // TODO: manage instance layers and extensions externally std::vector<const char*> extensions; std::vector<const char*> layers; for (const auto& e : s_default_extensions) { extensions.push_back(e); } if (debug()) { MGE_DEBUG_TRACE(VULKAN) << "Enabling Vulkan instance debug extensions"; extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); layers.push_back("VK_LAYER_KHRONOS_validation"); } VkInstanceCreateInfo instance_create_info = {}; instance_create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; instance_create_info.pApplicationInfo = &application_info; instance_create_info.enabledExtensionCount = static_cast<uint32_t>(extensions.size()); instance_create_info.ppEnabledExtensionNames = extensions.data(); instance_create_info.enabledLayerCount = static_cast<uint32_t>(layers.size()); instance_create_info.ppEnabledLayerNames = layers.data(); // need to create always as it has to be in scope VkDebugUtilsMessengerCreateInfoEXT debug_create_info = {}; if (debug()) { MGE_DEBUG_TRACE(VULKAN) << "Attaching debug message callback"; debug_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT; debug_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; debug_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; debug_create_info.pfnUserCallback = debug_message_callback; instance_create_info.pNext = &debug_create_info; } // TODO: manage memory allocation for instance CHECK_VK_CALL( vkCreateInstance(&instance_create_info, nullptr, &m_instance)); resolve_instance_functions(); if (debug() && vkCreateDebugUtilsMessengerEXT) { CHECK_VK_CALL(vkCreateDebugUtilsMessengerEXT(m_instance, &debug_create_info, nullptr, &m_debug_messenger)); } } void render_system::resolve_layer_properties() { uint32_t count = 0; CHECK_VK_CALL(vkEnumerateInstanceLayerProperties(&count, nullptr)); m_layer_properties.resize(count); CHECK_VK_CALL( vkEnumerateInstanceLayerProperties(&count, m_layer_properties.data())); MGE_DEBUG_TRACE(VULKAN) << "Found " << count << " layers:"; for (const auto& layer : m_layer_properties) { MGE_DEBUG_TRACE(VULKAN) << " " << layer.layerName << ": " << layer.description; uint32_t extension_count = 0; CHECK_VK_CALL( vkEnumerateInstanceExtensionProperties(layer.layerName, &extension_count, nullptr)); if (extension_count) { std::vector<VkExtensionProperties> properties(extension_count); CHECK_VK_CALL( vkEnumerateInstanceExtensionProperties(layer.layerName, &extension_count, properties.data())); MGE_DEBUG_TRACE(VULKAN) << " Extensions:"; for (const auto& prop : properties) { MGE_DEBUG_TRACE(VULKAN) << " " << prop.extensionName; } m_instance_extensions[layer.layerName] = std::move(properties); } } }
app_info.applicationVersion \= ...
https://github.com/mge-engine/mge/blob/344ac4b7cae078a7e8196c088d61d4b57cd4b2d2/src/modules/vulkan/render_system.cpp#L161