Use fmt::format for LOGERROR

The format string can be checked at compile time. It will be easier to
transition to `std::format`.
This commit is contained in:
phosit committed 2026-10-05 20:29:26 +02:00
1 parent ba158aa3ff
commit 369a7e7e5d
115 files changed
+631 -454

No files matched your search

+5 -5
View File
@@ -174,7 +174,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback(
LOGMESSAGE("Vulkan: {}", callbackData->pMessage);
}
else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT)
LOGERROR("Vulkan: %s", callbackData->pMessage);
LOGERROR("Vulkan: {}", callbackData->pMessage);
return VK_FALSE;
}
@@ -305,7 +305,7 @@ std::unique_ptr<CDevice> CDevice::Create(SDL_Window* window)
else if (createInstanceResult == VK_ERROR_LAYER_NOT_PRESENT)
LOGERROR("Can't create Vulkan instance: layer not present.");
else
LOGERROR("Unknown error during Vulkan instance creation: %d (%s)",
LOGERROR("Unknown error during Vulkan instance creation: {} ({})",
static_cast<int>(createInstanceResult), Utilities::GetVkResultName(createInstanceResult));
return nullptr;
}
@@ -530,7 +530,7 @@ std::unique_ptr<CDevice> CDevice::Create(SDL_Window* window)
else if (createDeviceResult == VK_ERROR_EXTENSION_NOT_PRESENT)
LOGERROR("Can't create Vulkan device: extension not present.");
else
LOGERROR("Unknown error during Vulkan device creation: %d (%s)",
LOGERROR("Unknown error during Vulkan device creation: {} ({})",
static_cast<int>(createDeviceResult), Utilities::GetVkResultName(createDeviceResult));
return nullptr;
}
@@ -572,8 +572,8 @@ std::unique_ptr<CDevice> CDevice::Create(SDL_Window* window)
vmaCreateAllocator(&allocatorCreateInfo, &device->m_VMAAllocator);
if (createVMAAllocatorResult != VK_SUCCESS)
{
LOGERROR("Failed to create VMA allocator: %d (%s)",
static_cast<int>(createVMAAllocatorResult), Utilities::GetVkResultName(createVMAAllocatorResult));
LOGERROR("Failed to create VMA allocator: {} ({})", static_cast<int>(createVMAAllocatorResult),
Utilities::GetVkResultName(createVMAAllocatorResult));
return nullptr;
}