code: Add additional logging during init

This commit is contained in:
IndecisiveTurtle 2024-07-01 13:35:35 +03:00 committed by TheTurtle
parent 7c7e9427ba
commit 410ba37ec2
7 changed files with 20 additions and 16 deletions

View File

@ -2462,6 +2462,7 @@ int PS4_SYSV_ABI Func_F916890425496553() {
}
void RegisterlibSceGnmDriver(Core::Loader::SymbolsResolver* sym) {
LOG_INFO(Lib_GnmDriver, "Initializing renderer");
liverpool = std::make_unique<AmdGpu::Liverpool>();
renderer = std::make_unique<Vulkan::RendererVulkan>(*g_window, liverpool.get());

View File

@ -38,6 +38,7 @@
namespace Libraries {
void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
LOG_INFO(Lib_Kernel, "Initializing HLE libraries");
Libraries::Kernel::LibKernel_Register(sym);
Libraries::VideoOut::RegisterLib(sym);
Libraries::GnmDriver::RegisterlibSceGnmDriver(sym);

View File

@ -20,6 +20,9 @@ MemoryManager::MemoryManager() {
const VAddr virtual_base = impl.VirtualBase();
const size_t virtual_size = impl.VirtualSize();
vma_map.emplace(virtual_base, VirtualMemoryArea{virtual_base, virtual_size});
// Log initialization.
LOG_INFO(Kernel_Vmm, "Usable memory address space {}_GB", virtual_size >> 30);
}
MemoryManager::~MemoryManager() = default;

View File

@ -29,12 +29,10 @@ namespace Core {
static constexpr s32 WindowWidth = 1280;
static constexpr s32 WindowHeight = 720;
Emulator::Emulator() : window{WindowWidth, WindowHeight, controller} {
Emulator::Emulator() : memory{Core::Memory::Instance()},
window{WindowWidth, WindowHeight, controller} {
g_window = &window;
// Initialize memory system as early as possible to reserve mappings.
[[maybe_unused]] const auto* memory = Core::Memory::Instance();
// Read configuration file.
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::load(config_dir / "config.toml");

View File

@ -29,6 +29,8 @@ public:
private:
void LoadSystemModules(const std::filesystem::path& file);
Core::MemoryManager* memory;
Input::GameController* controller = Common::Singleton<Input::GameController>::Instance();
Core::Linker* linker = Common::Singleton<Core::Linker>::Instance();
Frontend::WindowSDL window;

View File

@ -49,6 +49,7 @@ Instance::Instance(Frontend::WindowSDL& window, s32 physical_device_index,
}
const std::size_t num_physical_devices = static_cast<u16>(physical_devices.size());
ASSERT_MSG(num_physical_devices > 0, "No physical devices found");
LOG_INFO(Render_Vulkan, "Found {} physical devices", num_physical_devices);
if (physical_device_index < 0) {
std::vector<std::pair<size_t, vk::PhysicalDeviceProperties2>> properties2{};
@ -73,12 +74,10 @@ Instance::Instance(Frontend::WindowSDL& window, s32 physical_device_index,
available_extensions = GetSupportedExtensions(physical_device);
properties = physical_device.getProperties();
if (properties.apiVersion < TargetVulkanApiVersion) {
throw std::runtime_error(fmt::format(
ASSERT_MSG(properties.apiVersion >= TargetVulkanApiVersion,
"Vulkan {}.{} is required, but only {}.{} is supported by device!",
VK_VERSION_MAJOR(TargetVulkanApiVersion), VK_VERSION_MINOR(TargetVulkanApiVersion),
VK_VERSION_MAJOR(properties.apiVersion), VK_VERSION_MINOR(properties.apiVersion)));
}
VK_VERSION_MAJOR(properties.apiVersion), VK_VERSION_MINOR(properties.apiVersion));
CollectDeviceParameters();
CreateDevice();

View File

@ -168,6 +168,8 @@ std::vector<const char*> GetInstanceExtensions(Frontend::WindowSystemType window
vk::UniqueInstance CreateInstance(vk::DynamicLoader& dl, Frontend::WindowSystemType window_type,
bool enable_validation, bool dump_command_buffers) {
LOG_INFO(Render_Vulkan, "Creating vulkan instance");
auto vkGetInstanceProcAddr =
dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);
@ -176,12 +178,10 @@ vk::UniqueInstance CreateInstance(vk::DynamicLoader& dl, Frontend::WindowSystemT
? vk::enumerateInstanceVersion()
: VK_API_VERSION_1_0;
if (available_version < TargetVulkanApiVersion) {
throw std::runtime_error(fmt::format(
ASSERT_MSG(available_version >= TargetVulkanApiVersion,
"Vulkan {}.{} is required, but only {}.{} is supported by instance!",
VK_VERSION_MAJOR(TargetVulkanApiVersion), VK_VERSION_MINOR(TargetVulkanApiVersion),
VK_VERSION_MAJOR(available_version), VK_VERSION_MINOR(available_version)));
}
VK_VERSION_MAJOR(available_version), VK_VERSION_MINOR(available_version));
const auto extensions = GetInstanceExtensions(window_type, true);