|
|
|
@ -66,21 +66,6 @@ std::string BuildCommaSeparatedExtensions(
|
|
|
|
|
return fmt::format("{}", fmt::join(available_extensions, ","));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DebugCallback MakeDebugCallback(const vk::Instance& instance, const vk::InstanceDispatch& dld) {
|
|
|
|
|
if (!Settings::values.renderer_debug) {
|
|
|
|
|
return DebugCallback{};
|
|
|
|
|
}
|
|
|
|
|
const std::optional properties = vk::EnumerateInstanceExtensionProperties(dld);
|
|
|
|
|
const auto it = std::ranges::find_if(*properties, [](const auto& prop) {
|
|
|
|
|
return std::strcmp(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, prop.extensionName) == 0;
|
|
|
|
|
});
|
|
|
|
|
if (it != properties->end()) {
|
|
|
|
|
return CreateDebugUtilsCallback(instance);
|
|
|
|
|
} else {
|
|
|
|
|
return CreateDebugReportCallback(instance);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // Anonymous namespace
|
|
|
|
|
|
|
|
|
|
Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dld,
|
|
|
|
@ -103,7 +88,8 @@ RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_,
|
|
|
|
|
cpu_memory(cpu_memory_), gpu(gpu_), library(OpenLibrary(context.get())),
|
|
|
|
|
instance(CreateInstance(*library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type,
|
|
|
|
|
Settings::values.renderer_debug.GetValue())),
|
|
|
|
|
debug_callback(MakeDebugCallback(instance, dld)),
|
|
|
|
|
debug_messenger(Settings::values.renderer_debug ? CreateDebugUtilsCallback(instance)
|
|
|
|
|
: vk::DebugUtilsMessenger{}),
|
|
|
|
|
surface(CreateSurface(instance, render_window.GetWindowInfo())),
|
|
|
|
|
device(CreateDevice(instance, dld, *surface)), memory_allocator(device), state_tracker(),
|
|
|
|
|
scheduler(device, state_tracker),
|
|
|
|
|