Logging improvements / despam

This commit is contained in:
Henrik Rydgård committed 2025-05-21 21:42:08 +02:00
1 parent 9cf5d1bc25
commit a36d3cf18d
6 files changed
+18 -10

No files matched your search

+4 -6
View File
@@ -1301,7 +1301,7 @@ bool VulkanContext::ChooseQueue() {
// Okay, take the first one then.
swapchainFormat_ = surfFormats_[0].format;
}
INFO_LOG(Log::G3D, "swapchain_format: %d (/%d)", swapchainFormat_, formatCount);
INFO_LOG(Log::G3D, "swapchain_format: %s (%d) (/%d)", VulkanFormatToString(swapchainFormat_), (int)swapchainFormat_, formatCount);
}
vkGetDeviceQueue(device_, graphics_queue_family_index_, 0, &gfx_queue_);
@@ -1388,7 +1388,6 @@ bool VulkanContext::InitSwapchain() {
availablePresentModes_.push_back(presentModes[i]);
}
INFO_LOG(Log::G3D, "Supported present modes: %s", modes.c_str());
for (size_t i = 0; i < presentModeCount; i++) {
bool match = false;
match = match || ((flags_ & VulkanInitFlags::PRESENT_MAILBOX) && presentModes[i] == VK_PRESENT_MODE_MAILBOX_KHR);
@@ -1415,8 +1414,8 @@ bool VulkanContext::InitSwapchain() {
desiredNumberOfSwapChainImages = surfCapabilities_.maxImageCount;
}
INFO_LOG(Log::G3D, "Chosen present mode: %d (%s). numSwapChainImages: %d (max: %d)",
swapchainPresentMode, VulkanPresentModeToString(swapchainPresentMode),
INFO_LOG(Log::G3D, "Supported present modes: %s. Chosen present mode: %d (%s). numSwapChainImages: %d (max: %d)",
modes.c_str(), swapchainPresentMode, VulkanPresentModeToString(swapchainPresentMode),
desiredNumberOfSwapChainImages, surfCapabilities_.maxImageCount);
// We mostly follow the practices from
@@ -1503,7 +1502,6 @@ bool VulkanContext::InitSwapchain() {
// We don't support screenshots on Android if TRANSFER_SRC usage flag is not supported.
if (surfCapabilities_.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
INFO_LOG(Log::G3D, "Swapchain supports TRANSFER_SRC");
swap_chain_info.imageUsage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
}
@@ -1523,7 +1521,7 @@ bool VulkanContext::InitSwapchain() {
ERROR_LOG(Log::G3D, "vkCreateSwapchainKHR failed!");
return false;
}
INFO_LOG(Log::G3D, "Created swapchain: %dx%d", swap_chain_info.imageExtent.width, swap_chain_info.imageExtent.height);
INFO_LOG(Log::G3D, "Created swapchain: %dx%d %s", swap_chain_info.imageExtent.width, swap_chain_info.imageExtent.height, (surfCapabilities_.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) ? "(TRANSFER_SRC_BIT supported)" : "");
return true;
}
-2
View File
@@ -893,8 +893,6 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread)
: vulkan_(vulkan), renderManager_(vulkan, useRenderThread, frameTimeHistory_) {
shaderLanguageDesc_.Init(GLSL_VULKAN);
INFO_LOG(Log::G3D, "Determining Vulkan device caps");
caps_.coordConvention = CoordConvention::Vulkan;
caps_.setMaxFrameLatencySupported = true;
caps_.anisoSupported = vulkan->GetDeviceFeatures().enabled.standard.samplerAnisotropy != 0;
+7
View File
@@ -44,15 +44,22 @@ ScreenManager::~ScreenManager() {
void ScreenManager::switchScreen(Screen *screen) {
// TODO: inputLock_ ?
INFO_LOG(Log::UI, "ScreenManager::switchScreen('%s')", screen->tag());
if (!nextStack_.empty() && screen == nextStack_.front().screen) {
ERROR_LOG(Log::UI, "Already switching to this screen");
return;
}
// Note that if a dialog is found, this will be a silent background switch that
// will only become apparent if the dialog is closed. The previous screen will stick around
// until that switch.
// TODO: is this still true?
if (!nextStack_.empty()) {
for (int i = 0; i < nextStack_.size(); i++) {
INFO_LOG(Log::UI, "NextStack contents[%d].screen->tag(): '%s'", i, nextStack_[i].screen->tag());
}
ERROR_LOG(Log::UI, "Already had a nextStack_! Asynchronous open while doing something? Deleting the new screen.");
delete screen;
return;
+1 -1
View File
@@ -111,7 +111,7 @@ void GPU_Vulkan::LoadCache(const Path &filename) {
// First compile shaders to SPIR-V, then load the pipeline cache and recreate the pipelines.
// It's when recreating the pipelines that the pipeline cache is useful - in the ideal case,
// it can just memcpy the finished shader binaries out of the pipeline cache file.
bool result = shaderManagerVulkan_->LoadCacheFlags(f, &drawEngine_);
bool result = ShaderManagerVulkan::LoadCacheFlags(f, &drawEngine_);
if (!result) {
WARN_LOG(Log::G3D, "ShaderManagerVulkan failed to load cache header.");
}
+1
View File
@@ -643,6 +643,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
fprintf(stderr, "File not found: %s\n", boot_filename.c_str());
#if defined(_WIN32) || defined(__ANDROID__)
// Ignore and proceed.
boot_filename.clear();
#else
// Bail.
exit(1);
@@ -100,7 +100,11 @@ public class SizeManager implements SurfaceHolder.Callback {
getDesiredBackbufferSize(desiredSize);
// Note that desiredSize might be 0,0 here - but that's fine when calling setFixedSize! It means auto.
Log.d(TAG, "Setting fixed size " + desiredSize.x + " x " + desiredSize.y);
if (desiredSize.x == 0) {
Log.d(TAG, "Setting auto surface size (not fixed)");
} else {
Log.d(TAG, "Setting fixed surface size " + desiredSize.x + " x " + desiredSize.y);
}
holder.setFixedSize(desiredSize.x, desiredSize.y);
}