LibGfx: Use reinterpret_cast instead of C style in create_vulkan_context

This commit is contained in:
Aliaksandr Kalenik 2025-08-19 17:23:49 +02:00 committed by Alexander Kalenik
commit 3ec37978e6
Notes: github-actions[bot] 2025-08-19 18:46:31 +00:00

View file

@ -168,11 +168,11 @@ ErrorOr<VulkanContext> create_vulkan_context()
VkCommandPool command_pool = TRY(create_command_pool(logical_device, graphics_queue_family)); VkCommandPool command_pool = TRY(create_command_pool(logical_device, graphics_queue_family));
VkCommandBuffer command_buffer = TRY(allocate_command_buffer(logical_device, command_pool)); VkCommandBuffer command_buffer = TRY(allocate_command_buffer(logical_device, command_pool));
PFN_vkGetMemoryFdKHR pfn_vk_get_memory_fd_khr = (PFN_vkGetMemoryFdKHR)vkGetDeviceProcAddr(logical_device, "vkGetMemoryFdKHR"); auto pfn_vk_get_memory_fd_khr = reinterpret_cast<PFN_vkGetMemoryFdKHR>(vkGetDeviceProcAddr(logical_device, "vkGetMemoryFdKHR"));
if (pfn_vk_get_memory_fd_khr == nullptr) { if (pfn_vk_get_memory_fd_khr == nullptr) {
return Error::from_string_literal("vkGetMemoryFdKHR unavailable"); return Error::from_string_literal("vkGetMemoryFdKHR unavailable");
} }
PFN_vkGetImageDrmFormatModifierPropertiesEXT pfn_vk_get_image_drm_format_modifier_properties_khr = (PFN_vkGetImageDrmFormatModifierPropertiesEXT)vkGetDeviceProcAddr(logical_device, "vkGetImageDrmFormatModifierPropertiesEXT"); auto pfn_vk_get_image_drm_format_modifier_properties_khr = reinterpret_cast<PFN_vkGetImageDrmFormatModifierPropertiesEXT>(vkGetDeviceProcAddr(logical_device, "vkGetImageDrmFormatModifierPropertiesEXT"));
if (pfn_vk_get_image_drm_format_modifier_properties_khr == nullptr) { if (pfn_vk_get_image_drm_format_modifier_properties_khr == nullptr) {
return Error::from_string_literal("vkGetImageDrmFormatModifierPropertiesEXT unavailable"); return Error::from_string_literal("vkGetImageDrmFormatModifierPropertiesEXT unavailable");
} }