Merge pull request #13287 from hrydgard/log-cleanup

Log system cleanup
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2020-08-15 20:32:01 +02:00
commit 7115c28c29
191 files changed
+1114 -1325

No files matched your search

-2
View File
@@ -822,7 +822,6 @@ elseif(WIN32)
else()
link_directories(dx9sdk/Lib/x86)
endif()
set(nativeExtra ${nativeExtra} ext/native/base/logging.cpp)
elseif(TARGET SDL2::SDL2)
set(TargetBin PPSSPPSDL)
# Require SDL
@@ -934,7 +933,6 @@ add_library(native STATIC
ext/native/base/display.cpp
ext/native/base/display.h
ext/native/base/linked_ptr.h
ext/native/base/logging.h
ext/native/base/stringutil.cpp
ext/native/base/stringutil.h
ext/native/base/timeutil.cpp
+5 -7
View File
@@ -17,9 +17,6 @@
#include "ppsspp_config.h"
#include "base/logging.h"
#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
@@ -31,9 +28,10 @@
#include <sys/mman.h>
#endif
#include "MemoryUtil.h"
#include "ArmEmitter.h"
#include "CPUDetect.h"
#include "Common/Log.h"
#include "Common/MemoryUtil.h"
#include "Common/ArmEmitter.h"
#include "Common/CPUDetect.h"
#ifdef _WIN32
#include "CommonWindows.h"
@@ -1780,7 +1778,7 @@ void ARMXEmitter::VMOV(ARMReg Dest, ARMReg Src)
_assert_msg_(SrcSize == DestSize, "VMOV doesn't support moving different register sizes");
if (SrcSize != DestSize) {
ELOG("SrcSize: %i (%s) DestDize: %i (%s)", SrcSize, ARMRegAsString(Src), DestSize, ARMRegAsString(Dest));
ERROR_LOG(JIT, "SrcSize: %i (%s) DestDize: %i (%s)", SrcSize, ARMRegAsString(Src), DestSize, ARMRegAsString(Dest));
}
Dest = SubBase(Dest);
+5 -5
View File
@@ -28,14 +28,14 @@
#include <memory.h>
#include <set>
#include "base/logging.h"
#include "base/basictypes.h"
#include "file/file_util.h"
#include "Common.h"
#include "CPUDetect.h"
#include "FileUtil.h"
#include "StringUtils.h"
#include "Common/Common.h"
#include "Common/CPUDetect.h"
#include "Common/FileUtil.h"
#include "Common/StringUtils.h"
#if defined(_WIN32) && !defined(__MINGW32__)
#define WIN32_LEAN_AND_MEAN
-1
View File
@@ -17,7 +17,6 @@
#include <memory.h>
#include "base/logging.h"
#include "base/basictypes.h"
#include "Common.h"
#include "CPUDetect.h"
+1 -2
View File
@@ -5,9 +5,8 @@
#include <array>
#include <cstdlib>
#include "Common/GL/GLInterface/EGL.h"
#include "Common/Log.h"
#include "Common/GL/GLInterface/EGL.h"
// Show the current FPS
void cInterfaceEGL::Swap() {
+1 -11
View File
@@ -7,22 +7,12 @@
#include <string>
#include <EGL/egl.h>
#include "Common/Log.h"
#include "Common/GL/GLInterfaceBase.h"
#ifdef __ANDROID__
// On Android, EGL creation is so early that our regular logging system is not
// up and running yet. Use Android logging.
#include "base/logging.h"
#define EGL_ILOG(...) ILOG(__VA_ARGS__)
#define EGL_ELOG(...) ELOG(__VA_ARGS__)
#else
#define EGL_ILOG(...) INFO_LOG(G3D, __VA_ARGS__)
#define EGL_ELOG(...) INFO_LOG(G3D, __VA_ARGS__)
#endif
class cInterfaceEGL : public cInterfaceBase {
public:
+5 -5
View File
@@ -24,14 +24,14 @@
#include "CommonWindows.h"
#endif
#include "base/logging.h"
#include "base/stringutil.h"
#include "base/NativeApp.h"
#include "file/ini_file.h"
#include "input/input_state.h"
#include "ppsspp_config.h"
#include "KeyMap.h"
#include "Common/Log.h"
#include "Common/KeyMap.h"
#include "Core/HLE/sceUtility.h"
#include "Core/Config.h"
@@ -898,10 +898,10 @@ void RestoreDefault() {
} else if (IsXperiaPlay(name)) {
SetDefaultKeyMap(DEFAULT_MAPPING_XPERIA_PLAY, true);
} else if (IsMOQII7S(name)) {
ILOG("MOQI pad map");
INFO_LOG(SYSTEM, "MOQI pad map");
SetDefaultKeyMap(DEFAULT_MAPPING_MOQI_I7S, true);
} else {
ILOG("Default pad map");
INFO_LOG(SYSTEM, "Default pad map");
SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
}
#else
@@ -992,7 +992,7 @@ void NotifyPadConnected(const std::string &name) {
}
void AutoConfForPad(const std::string &name) {
ILOG("Autoconfiguring pad for '%s'", name.c_str());
INFO_LOG(SYSTEM, "Autoconfiguring pad for '%s'", name.c_str());
if (name == "Xbox 360 Pad") {
SetDefaultKeyMap(DEFAULT_MAPPING_X360, true);
} else {
+6 -1
View File
@@ -38,7 +38,7 @@
namespace LogTypes {
enum LOG_TYPE {
SYSTEM = 0,
SYSTEM = 0, // Catch-all for uncategorized things
BOOT,
COMMON,
CPU,
@@ -52,6 +52,8 @@ enum LOG_TYPE {
SASMIX,
SAVESTATE,
FRAMEBUF,
AUDIO,
IO,
SCEAUDIO,
SCECTRL,
@@ -187,3 +189,6 @@ void AndroidAssertLog(const char *func, const char *file, int line, const char *
}
#endif // __ANDROID__
// Just INFO_LOGs on nonWindows. On Windows it outputs to the VS output console.
void OutputDebugStringUTF8(const char *p);
+43 -15
View File
@@ -18,19 +18,21 @@
#include "ppsspp_config.h"
#include <algorithm>
#include <cstring>
#include "base/logging.h"
#include "util/text/utf8.h"
#include "LogManager.h"
#include "ConsoleListener.h"
#include "Timer.h"
#include "FileUtil.h"
#include "StringUtils.h"
#include "Core/Config.h"
#include "Common/LogManager.h"
#include "Common/ConsoleListener.h"
#include "Common/Timer.h"
#include "Common/FileUtil.h"
#include "Common/StringUtils.h"
// Don't need to savestate this.
const char *hleCurrentThreadName = nullptr;
bool *g_bLogEnabledSetting = nullptr;
static const char level_to_char[8] = "-NEWIDV";
#if PPSSPP_PLATFORM(UWP) && defined(_DEBUG)
@@ -40,20 +42,23 @@ static const char level_to_char[8] = "-NEWIDV";
#endif
void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char *file, int line, const char* fmt, ...) {
if (!g_Config.bEnableLogging)
if (g_bLogEnabledSetting && !(*g_bLogEnabledSetting))
return;
va_list args;
va_start(args, fmt);
LogManager *instance = LogManager::GetInstance();
if (instance) {
instance->Log(level, type, file, line, fmt, args);
} else {
// Fall back to printf if we're before the log manager has been initialized.
vprintf(fmt, args);
}
va_end(args);
}
bool GenericLogEnabled(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type) {
if (LogManager::GetInstance())
return g_Config.bEnableLogging && LogManager::GetInstance()->IsEnabled(level, type);
return (*g_bLogEnabledSetting) && LogManager::GetInstance()->IsEnabled(level, type);
return false;
}
@@ -94,6 +99,8 @@ static const LogNameTableEntry logTable[] = {
{LogTypes::SASMIX, "SASMIX"},
{LogTypes::SAVESTATE, "SAVESTATE"},
{LogTypes::FRAMEBUF, "FRAMEBUF"},
{LogTypes::AUDIO, "AUDIO"},
{LogTypes::IO, "IO"},
{LogTypes::SCEAUDIO, "SCEAUDIO"},
{LogTypes::SCECTRL, "SCECTRL"},
@@ -111,11 +118,11 @@ static const LogNameTableEntry logTable[] = {
{LogTypes::SCEMISC, "SCEMISC"},
};
LogManager::LogManager() {
LogManager::LogManager(bool *enabledSetting) {
g_bLogEnabledSetting = enabledSetting;
for (size_t i = 0; i < ARRAY_SIZE(logTable); i++) {
if (i != logTable[i].logType) {
FLOG("Bad logtable at %i", (int)i);
}
_assert_msg_(i == logTable[i].logType, "Bad logtable at %i", (int)i);
truncate_cpy(log_[logTable[i].logType].m_shortName, logTable[i].name);
log_[logTable[i].logType].enabled = true;
#if defined(_DEBUG)
@@ -268,8 +275,8 @@ bool LogManager::IsEnabled(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type)
return true;
}
void LogManager::Init() {
logManager_ = new LogManager();
void LogManager::Init(bool *enabledSetting) {
logManager_ = new LogManager(enabledSetting);
}
void LogManager::Shutdown() {
@@ -325,3 +332,24 @@ void RingbufferLogListener::Log(const LogMessage &message) {
curMessage_ -= MAX_LOGS;
count_++;
}
#ifdef _WIN32
void OutputDebugStringUTF8(const char *p) {
wchar_t temp[4096];
int len = std::min(4095, (int)strlen(p));
int size = (int)MultiByteToWideChar(CP_UTF8, 0, p, len, NULL, 0);
MultiByteToWideChar(CP_UTF8, 0, p, len, temp, size);
temp[size] = 0;
OutputDebugString(temp);
}
#else
void OutputDebugStringUTF8(const char *p) {
INFO_LOG(SYSTEM, "%s", p);
}
#endif
+3 -2
View File
@@ -105,7 +105,7 @@ class ConsoleListener;
class LogManager {
private:
LogManager();
LogManager(bool *enabledSetting);
~LogManager();
// Prevent copies.
@@ -122,6 +122,7 @@ private:
std::mutex log_lock_;
std::mutex listeners_lock_;
std::vector<LogListener*> listeners_;
public:
void AddListener(LogListener *listener);
void RemoveListener(LogListener *listener);
@@ -175,7 +176,7 @@ public:
logManager_ = logManager;
}
static void Init();
static void Init(bool *enabledSetting);
static void Shutdown();
void ChangeFileLog(const char *filename);
+3 -1
View File
@@ -14,7 +14,9 @@
#include <windows.h>
typedef CONTEXT SContext;
#if PPSSPP_ARCH(AMD64)
#if defined(__LIBRETRO__)
#elif PPSSPP_ARCH(AMD64)
#define MACHINE_CONTEXT_SUPPORTED
+9 -9
View File
@@ -19,12 +19,6 @@
#ifdef __ANDROID__
#include "base/logging.h"
#include "base/NativeApp.h"
#include "MemoryUtil.h"
#include "MemArena.h"
#include "StringUtils.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
@@ -33,6 +27,12 @@
#include <linux/ashmem.h>
#include <dlfcn.h>
#include "base/NativeApp.h"
#include "Common/Log.h"
#include "Common/MemoryUtil.h"
#include "Common/MemArena.h"
#include "Common/StringUtils.h"
// Hopefully this ABI will never change...
#define ASHMEM_DEVICE "/dev/ashmem"
@@ -141,14 +141,14 @@ u8* MemArena::Find4GBBase() {
const uint64_t EIGHT_GIGS = 0x200000000ULL;
void *base = mmap(0, EIGHT_GIGS, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
if (base) {
ILOG("base: %p", base);
INFO_LOG(SYSTEM, "base: %p", base);
uint64_t aligned_base = ((uint64_t)base + 0xFFFFFFFF) & ~0xFFFFFFFFULL;
ILOG("aligned_base: %p", (void *)aligned_base);
INFO_LOG(SYSTEM, "aligned_base: %p", (void *)aligned_base);
munmap(base, EIGHT_GIGS);
return reinterpret_cast<u8 *>(aligned_base);
} else {
u8 *hardcoded_ptr = reinterpret_cast<u8*>(0x2300000000ULL);
ILOG("Failed to anonymously map 8GB. Fall back to the hardcoded pointer %p.", hardcoded_ptr);
INFO_LOG(SYSTEM, "Failed to anonymously map 8GB. Fall back to the hardcoded pointer %p.", hardcoded_ptr);
// Just grab some random 4GB...
// This has been known to fail lately though, see issue #12249.
return hardcoded_ptr;
+1 -1
View File
@@ -17,7 +17,7 @@
#include "ppsspp_config.h"
#include "base/logging.h"
#include <cstring>
#include "Common/Common.h"
#include "Common/Log.h"
+4 -6
View File
@@ -15,18 +15,16 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MemoryUtil.h"
#include "MipsEmitter.h"
#include "CPUDetect.h"
#include "Common/Log.h"
#include "Common/MemoryUtil.h"
#include "Common/MipsEmitter.h"
#include "Common/CPUDetect.h"
namespace MIPSGen {
void MIPSEmitter::SetCodePtr(u8 *ptr) {
+2 -2
View File
@@ -20,8 +20,8 @@
#include "ppsspp_config.h"
#include "Common.h"
#include "Common/Log.h"
#include "StringUtils.h"
#include "base/logging.h"
#include "util/text/utf8.h"
bool MsgHandler(const char *caption, const char *text, const char *file, int line, bool yes_no, int Style);
@@ -69,7 +69,7 @@ bool MsgHandler(const char* caption, const char* text, const char *file, int lin
return false;
#else
// Will use android-log if available, printf if not.
ELOG("(%s:%d) %s", file, line, text);
ERROR_LOG(SYSTEM, "(%s:%d) %s", file, line, text);
return false;
#endif
}
+62 -62
View File
@@ -1,12 +1,12 @@
#define __STDC_LIMIT_MACROS
#include <cstdlib>
#include <cstdint>
#include <assert.h>
#include <cstring>
#include <iostream>
#include "base/basictypes.h"
#include "base/display.h"
#include "Common/Log.h"
#include "Common/Vulkan/VulkanContext.h"
#include "Common/Vulkan/VulkanDebug.h"
#include "GPU/Common/ShaderCommon.h"
@@ -139,9 +139,9 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
}
instance_extensions_enabled_.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
extensionsLookup_.EXT_debug_utils = true;
ILOG("Vulkan debug_utils validation enabled.");
INFO_LOG(G3D, "Vulkan debug_utils validation enabled.");
} else {
ELOG("Validation layer extension not available - not enabling Vulkan validation.");
ERROR_LOG(G3D, "Validation layer extension not available - not enabling Vulkan validation.");
flags_ &= ~VULKAN_FLAG_VALIDATE;
}
}
@@ -154,7 +154,7 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
// Validate that all the instance extensions we ask for are actually available.
for (auto ext : instance_extensions_enabled_) {
if (!IsInstanceExtensionAvailable(ext))
WLOG("WARNING: Does not seem that instance extension '%s' is available. Trying to proceed anyway.", ext);
WARN_LOG(G3D, "WARNING: Does not seem that instance extension '%s' is available. Trying to proceed anyway.", ext);
}
VkApplicationInfo app_info{ VK_STRUCTURE_TYPE_APPLICATION_INFO };
@@ -180,7 +180,7 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
#endif
if (res != VK_SUCCESS) {
if (res == VK_ERROR_LAYER_NOT_PRESENT) {
WLOG("Validation on but instance layer not available - dropping layers");
WARN_LOG(G3D, "Validation on but instance layer not available - dropping layers");
// Drop the validation layers and try again.
instance_layer_names_.clear();
device_layer_names_.clear();
@@ -188,9 +188,9 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
inst_info.ppEnabledLayerNames = nullptr;
res = vkCreateInstance(&inst_info, nullptr, &instance_);
if (res != VK_SUCCESS)
ELOG("Failed to create instance even without validation: %d", res);
ERROR_LOG(G3D, "Failed to create instance even without validation: %d", res);
} else {
ELOG("Failed to create instance : %d", res);
ERROR_LOG(G3D, "Failed to create instance : %d", res);
}
}
if (res != VK_SUCCESS) {
@@ -200,7 +200,7 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
VulkanLoadInstanceFunctions(instance_, extensionsLookup_);
if (!CheckLayers(instance_layer_properties_, instance_layer_names_)) {
WLOG("CheckLayers for instance failed");
WARN_LOG(G3D, "CheckLayers for instance failed");
// init_error_ = "Failed to validate instance layers";
// return;
}
@@ -212,14 +212,14 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
res = vkEnumeratePhysicalDevices(instance_, &gpu_count, nullptr);
#endif
if (gpu_count <= 0) {
ELOG("Vulkan driver found but no supported GPU is available");
ERROR_LOG(G3D, "Vulkan driver found but no supported GPU is available");
init_error_ = "No Vulkan physical devices found";
vkDestroyInstance(instance_, nullptr);
instance_ = nullptr;
return VK_ERROR_INITIALIZATION_FAILED;
}
assert(gpu_count > 0);
_dbg_assert_(gpu_count > 0);
physical_devices_.resize(gpu_count);
physicalDeviceProperties_.resize(gpu_count);
res = vkEnumeratePhysicalDevices(instance_, &gpu_count, physical_devices_.data());
@@ -259,7 +259,7 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
}
VulkanContext::~VulkanContext() {
assert(instance_ == VK_NULL_HANDLE);
_dbg_assert_(instance_ == VK_NULL_HANDLE);
}
void VulkanContext::DestroyInstance() {
@@ -290,7 +290,7 @@ void VulkanContext::EndFrame() {
}
void VulkanContext::UpdateInflightFrames(int n) {
assert(n >= 1 && n <= MAX_INFLIGHT_FRAMES);
_dbg_assert_(n >= 1 && n <= MAX_INFLIGHT_FRAMES);
inflightFrames_ = n;
if (curFrame_ >= inflightFrames_) {
curFrame_ = 0;
@@ -508,19 +508,19 @@ int VulkanContext::GetBestPhysicalDevice() {
void VulkanContext::ChooseDevice(int physical_device) {
physical_device_ = physical_device;
ILOG("Chose physical device %d: %p", physical_device, physical_devices_[physical_device]);
INFO_LOG(G3D, "Chose physical device %d: %p", physical_device, physical_devices_[physical_device]);
GetDeviceLayerProperties();
if (!CheckLayers(device_layer_properties_, device_layer_names_)) {
WLOG("CheckLayers for device %d failed", physical_device);
WARN_LOG(G3D, "CheckLayers for device %d failed", physical_device);
}
vkGetPhysicalDeviceQueueFamilyProperties(physical_devices_[physical_device_], &queue_count, nullptr);
assert(queue_count >= 1);
_dbg_assert_(queue_count >= 1);
queueFamilyProperties_.resize(queue_count);
vkGetPhysicalDeviceQueueFamilyProperties(physical_devices_[physical_device_], &queue_count, queueFamilyProperties_.data());
assert(queue_count >= 1);
_dbg_assert_(queue_count >= 1);
// Detect preferred formats, in this order.
static const VkFormat depthStencilFormats[] = {
@@ -539,17 +539,17 @@ void VulkanContext::ChooseDevice(int physical_device) {
}
if (deviceInfo_.preferredDepthStencilFormat == VK_FORMAT_UNDEFINED) {
// WTF? This is bad.
ELOG("Could not find a usable depth stencil format.");
ERROR_LOG(G3D, "Could not find a usable depth stencil format.");
}
// This is as good a place as any to do this.
vkGetPhysicalDeviceMemoryProperties(physical_devices_[physical_device_], &memory_properties);
ILOG("Memory Types (%d):", memory_properties.memoryTypeCount);
INFO_LOG(G3D, "Memory Types (%d):", memory_properties.memoryTypeCount);
for (int i = 0; i < (int)memory_properties.memoryTypeCount; i++) {
// Don't bother printing dummy memory types.
if (!memory_properties.memoryTypes[i].propertyFlags)
continue;
ILOG(" %d: Heap %d; Flags: %s%s%s%s ", i, memory_properties.memoryTypes[i].heapIndex,
INFO_LOG(G3D, " %d: Heap %d; Flags: %s%s%s%s ", i, memory_properties.memoryTypes[i].heapIndex,
(memory_properties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) ? "DEVICE_LOCAL " : "",
(memory_properties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) ? "HOST_VISIBLE " : "",
(memory_properties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) ? "HOST_CACHED " : "",
@@ -611,7 +611,7 @@ bool VulkanContext::EnableDeviceExtension(const char *extension) {
VkResult VulkanContext::CreateDevice() {
if (!init_error_.empty() || physical_device_ < 0) {
ELOG("Vulkan init failed: %s", init_error_.c_str());
ERROR_LOG(G3D, "Vulkan init failed: %s", init_error_.c_str());
return VK_ERROR_INITIALIZATION_FAILED;
}
@@ -627,7 +627,7 @@ VkResult VulkanContext::CreateDevice() {
break;
}
}
assert(found);
_dbg_assert_(found);
extensionsLookup_.KHR_maintenance1 = EnableDeviceExtension(VK_KHR_MAINTENANCE1_EXTENSION_NAME);
extensionsLookup_.KHR_maintenance2 = EnableDeviceExtension(VK_KHR_MAINTENANCE2_EXTENSION_NAME);
@@ -661,11 +661,11 @@ VkResult VulkanContext::CreateDevice() {
VkResult res = vkCreateDevice(physical_devices_[physical_device_], &device_info, nullptr, &device_);
if (res != VK_SUCCESS) {
init_error_ = "Unable to create Vulkan device";
ELOG("Unable to create Vulkan device");
ERROR_LOG(G3D, "Unable to create Vulkan device");
} else {
VulkanLoadDeviceFunctions(device_, extensionsLookup_);
}
ILOG("Device created.\n");
INFO_LOG(G3D, "Device created.\n");
VulkanSetAvailable(true);
return res;
}
@@ -685,10 +685,10 @@ VkResult VulkanContext::InitDebugUtilsCallback() {
VkDebugUtilsMessengerEXT messenger;
VkResult res = vkCreateDebugUtilsMessengerEXT(instance_, &callback1, nullptr, &messenger);
if (res != VK_SUCCESS) {
ELOG("Failed to register debug callback with vkCreateDebugUtilsMessengerEXT");
ERROR_LOG(G3D, "Failed to register debug callback with vkCreateDebugUtilsMessengerEXT");
// Do error handling for VK_ERROR_OUT_OF_MEMORY
} else {
ILOG("Debug callback registered with vkCreateDebugUtilsMessengerEXT.");
INFO_LOG(G3D, "Debug callback registered with vkCreateDebugUtilsMessengerEXT.");
utils_callbacks.push_back(messenger);
}
return res;
@@ -711,12 +711,12 @@ VkResult VulkanContext::InitSurface(WindowSystem winsys, void *data1, void *data
VkResult VulkanContext::ReinitSurface() {
if (surface_ != VK_NULL_HANDLE) {
ILOG("Destroying Vulkan surface (%d, %d)", swapChainExtent_.width, swapChainExtent_.height);
INFO_LOG(G3D, "Destroying Vulkan surface (%d, %d)", swapChainExtent_.width, swapChainExtent_.height);
vkDestroySurfaceKHR(instance_, surface_, nullptr);
surface_ = VK_NULL_HANDLE;
}
ILOG("Creating Vulkan surface for window (%p %p)", winsysData1_, winsysData2_);
INFO_LOG(G3D, "Creating Vulkan surface for window (%p %p)", winsysData1_, winsysData2_);
VkResult retval = VK_SUCCESS;
@@ -842,7 +842,7 @@ bool VulkanContext::ChooseQueue() {
// Generate error if could not find both a graphics and a present queue
if (graphicsQueueNodeIndex == UINT32_MAX || presentQueueNodeIndex == UINT32_MAX) {
ELOG("Could not find a graphics and a present queue");
ERROR_LOG(G3D, "Could not find a graphics and a present queue");
return false;
}
@@ -858,7 +858,7 @@ bool VulkanContext::ChooseQueue() {
std::vector<VkSurfaceFormatKHR> surfFormats(formatCount);
res = vkGetPhysicalDeviceSurfaceFormatsKHR(physical_devices_[physical_device_], surface_, &formatCount, surfFormats.data());
assert(res == VK_SUCCESS);
_dbg_assert_(res == VK_SUCCESS);
if (res != VK_SUCCESS) {
return false;
}
@@ -866,7 +866,7 @@ bool VulkanContext::ChooseQueue() {
// the surface has no preferred format. Otherwise, at least one
// supported format will be returned.
if (formatCount == 0 || (formatCount == 1 && surfFormats[0].format == VK_FORMAT_UNDEFINED)) {
ILOG("swapchain_format: Falling back to B8G8R8A8_UNORM");
INFO_LOG(G3D, "swapchain_format: Falling back to B8G8R8A8_UNORM");
swapchainFormat_ = VK_FORMAT_B8G8R8A8_UNORM;
} else {
swapchainFormat_ = VK_FORMAT_UNDEFINED;
@@ -884,7 +884,7 @@ bool VulkanContext::ChooseQueue() {
// Okay, take the first one then.
swapchainFormat_ = surfFormats[0].format;
}
ILOG("swapchain_format: %d (/%d)", swapchainFormat_, formatCount);
INFO_LOG(G3D, "swapchain_format: %d (/%d)", swapchainFormat_, formatCount);
}
vkGetDeviceQueue(device_, graphics_queue_family_index_, 0, &gfx_queue_);
@@ -915,20 +915,20 @@ static std::string surface_transforms_to_string(VkSurfaceTransformFlagsKHR trans
bool VulkanContext::InitSwapchain() {
VkResult res = vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physical_devices_[physical_device_], surface_, &surfCapabilities_);
assert(res == VK_SUCCESS);
_dbg_assert_(res == VK_SUCCESS);
uint32_t presentModeCount;
res = vkGetPhysicalDeviceSurfacePresentModesKHR(physical_devices_[physical_device_], surface_, &presentModeCount, nullptr);
assert(res == VK_SUCCESS);
_dbg_assert_(res == VK_SUCCESS);
VkPresentModeKHR *presentModes = new VkPresentModeKHR[presentModeCount];
assert(presentModes);
_dbg_assert_(presentModes);
res = vkGetPhysicalDeviceSurfacePresentModesKHR(physical_devices_[physical_device_], surface_, &presentModeCount, presentModes);
assert(res == VK_SUCCESS);
_dbg_assert_(res == VK_SUCCESS);
swapChainExtent_.width = clamp(surfCapabilities_.currentExtent.width, surfCapabilities_.minImageExtent.width, surfCapabilities_.maxImageExtent.width);
swapChainExtent_.height = clamp(surfCapabilities_.currentExtent.height, surfCapabilities_.minImageExtent.height, surfCapabilities_.maxImageExtent.height);
ILOG("surfCapabilities_.current: %dx%d min: %dx%d max: %dx%d computed: %dx%d",
INFO_LOG(G3D, "surfCapabilities_.current: %dx%d min: %dx%d max: %dx%d computed: %dx%d",
surfCapabilities_.currentExtent.width, surfCapabilities_.currentExtent.height,
surfCapabilities_.minImageExtent.width, surfCapabilities_.minImageExtent.height,
surfCapabilities_.maxImageExtent.width, surfCapabilities_.maxImageExtent.height,
@@ -944,7 +944,7 @@ bool VulkanContext::InitSwapchain() {
modes += ", ";
}
}
ILOG("Supported present modes: %s", modes.c_str());
INFO_LOG(G3D, "Supported present modes: %s", modes.c_str());
for (size_t i = 0; i < presentModeCount; i++) {
bool match = false;
match = match || ((flags_ & VULKAN_FLAG_PRESENT_MAILBOX) && presentModes[i] == VK_PRESENT_MODE_MAILBOX_KHR);
@@ -976,7 +976,7 @@ bool VulkanContext::InitSwapchain() {
desiredNumberOfSwapChainImages = surfCapabilities_.maxImageCount;
}
ILOG("Chosen present mode: %d (%s). numSwapChainImages: %d/%d",
INFO_LOG(G3D, "Chosen present mode: %d (%s). numSwapChainImages: %d/%d",
swapchainPresentMode, PresentModeString(swapchainPresentMode),
desiredNumberOfSwapChainImages, surfCapabilities_.maxImageCount);
@@ -1011,7 +1011,7 @@ bool VulkanContext::InitSwapchain() {
std::swap(swapChainExtent_.width, swapChainExtent_.height);
break;
default:
assert(false);
_dbg_assert_(false);
}
} else {
// Let the OS rotate the image (potentially slow on many Android devices)
@@ -1020,10 +1020,10 @@ bool VulkanContext::InitSwapchain() {
std::string preTransformStr = surface_transforms_to_string(preTransform);
ILOG("Transform supported: %s current: %s chosen: %s", supportedTransforms.c_str(), currentTransform.c_str(), preTransformStr.c_str());
INFO_LOG(G3D, "Transform supported: %s current: %s chosen: %s", supportedTransforms.c_str(), currentTransform.c_str(), preTransformStr.c_str());
if (physicalDeviceProperties_[physical_device_].properties.vendorID == VULKAN_VENDOR_IMGTEC) {
ILOG("Applying PowerVR hack (rounding off the width!)");
INFO_LOG(G3D, "Applying PowerVR hack (rounding off the width!)");
// Swap chain width hack to avoid issue #11743 (PowerVR driver bug).
// To keep the size consistent even with pretransform, do this after the swap. Should be fine.
// This is fixed in newer PowerVR drivers but I don't know the cutoff.
@@ -1068,10 +1068,10 @@ bool VulkanContext::InitSwapchain() {
res = vkCreateSwapchainKHR(device_, &swap_chain_info, NULL, &swapchain_);
if (res != VK_SUCCESS) {
ELOG("vkCreateSwapchainKHR failed!");
ERROR_LOG(G3D, "vkCreateSwapchainKHR failed!");
return false;
}
ILOG("Created swapchain: %dx%d", swap_chain_info.imageExtent.width, swap_chain_info.imageExtent.height);
INFO_LOG(G3D, "Created swapchain: %dx%d", swap_chain_info.imageExtent.width, swap_chain_info.imageExtent.height);
return true;
}
@@ -1092,13 +1092,13 @@ void VulkanContext::PerformPendingDeletes() {
void VulkanContext::DestroyDevice() {
if (swapchain_) {
ELOG("DestroyDevice: Swapchain should have been destroyed.");
ERROR_LOG(G3D, "DestroyDevice: Swapchain should have been destroyed.");
}
if (surface_) {
ELOG("DestroyDevice: Surface should have been destroyed.");
ERROR_LOG(G3D, "DestroyDevice: Surface should have been destroyed.");
}
ILOG("VulkanContext::DestroyDevice (performing deletes)");
INFO_LOG(G3D, "VulkanContext::DestroyDevice (performing deletes)");
PerformPendingDeletes();
vkDestroyDevice(device_, nullptr);
@@ -1274,22 +1274,22 @@ const char *VulkanResultToString(VkResult res) {
}
void VulkanDeleteList::Take(VulkanDeleteList &del) {
assert(cmdPools_.empty());
assert(descPools_.empty());
assert(modules_.empty());
assert(buffers_.empty());
assert(bufferViews_.empty());
assert(images_.empty());
assert(imageViews_.empty());
assert(deviceMemory_.empty());
assert(samplers_.empty());
assert(pipelines_.empty());
assert(pipelineCaches_.empty());
assert(renderPasses_.empty());
assert(framebuffers_.empty());
assert(pipelineLayouts_.empty());
assert(descSetLayouts_.empty());
assert(callbacks_.empty());
_dbg_assert_(cmdPools_.empty());
_dbg_assert_(descPools_.empty());
_dbg_assert_(modules_.empty());
_dbg_assert_(buffers_.empty());
_dbg_assert_(bufferViews_.empty());
_dbg_assert_(images_.empty());
_dbg_assert_(imageViews_.empty());
_dbg_assert_(deviceMemory_.empty());
_dbg_assert_(samplers_.empty());
_dbg_assert_(pipelines_.empty());
_dbg_assert_(pipelineCaches_.empty());
_dbg_assert_(renderPasses_.empty());
_dbg_assert_(framebuffers_.empty());
_dbg_assert_(pipelineLayouts_.empty());
_dbg_assert_(descSetLayouts_.empty());
_dbg_assert_(callbacks_.empty());
cmdPools_ = std::move(del.cmdPools_);
descPools_ = std::move(del.descPools_);
modules_ = std::move(del.modules_);
+1 -1
View File
@@ -1,11 +1,11 @@
#pragma once
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <utility>
#include "base/logging.h"
#include "Common/Vulkan/VulkanLoader.h"
#include "Common/Vulkan/VulkanDebug.h"
+3 -3
View File
@@ -19,7 +19,7 @@
#include <cassert>
#include <sstream>
#include "base/logging.h"
#include "Common/Log.h"
#include "Common/Vulkan/VulkanContext.h"
#include "Common/Vulkan/VulkanDebug.h"
@@ -79,9 +79,9 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback(
#else
// TODO: Improve.
if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) {
ELOG("VKDEBUG: %s", msg.c_str());
ERROR_LOG(G3D, "VKDEBUG: %s", msg.c_str());
} else {
WLOG("VKDEBUG: %s", msg.c_str());
WARN_LOG(G3D, "VKDEBUG: %s", msg.c_str());
}
#endif
+5 -5
View File
@@ -67,7 +67,7 @@ bool VulkanTexture::CreateDirect(VkCommandBuffer cmd, VulkanDeviceAllocator *all
VkResult res = vkCreateImage(vulkan_->GetDevice(), &image_create_info, NULL, &image_);
if (res != VK_SUCCESS) {
_assert_(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS);
ELOG("vkCreateImage failed: %s", VulkanResultToString(res));
ERROR_LOG(G3D, "vkCreateImage failed: %s", VulkanResultToString(res));
return false;
}
@@ -82,7 +82,7 @@ bool VulkanTexture::CreateDirect(VkCommandBuffer cmd, VulkanDeviceAllocator *all
allocator_ = allocator;
offset_ = allocator_->Allocate(mem_reqs, &mem_, Tag());
if (offset_ == VulkanDeviceAllocator::ALLOCATE_FAILED) {
ELOG("Image memory allocation failed (mem_reqs.size=%d, typebits=%08x", (int)mem_reqs.size, (int)mem_reqs.memoryTypeBits);
ERROR_LOG(G3D, "Image memory allocation failed (mem_reqs.size=%d, typebits=%08x", (int)mem_reqs.size, (int)mem_reqs.memoryTypeBits);
// Destructor will take care of the image.
return false;
}
@@ -103,7 +103,7 @@ bool VulkanTexture::CreateDirect(VkCommandBuffer cmd, VulkanDeviceAllocator *all
res = vkAllocateMemory(vulkan_->GetDevice(), &mem_alloc, NULL, &mem_);
if (res != VK_SUCCESS) {
ELOG("vkAllocateMemory failed: %s", VulkanResultToString(res));
ERROR_LOG(G3D, "vkAllocateMemory failed: %s", VulkanResultToString(res));
_assert_msg_(res != VK_ERROR_TOO_MANY_OBJECTS, "Too many Vulkan memory objects!");
_assert_(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS);
return false;
@@ -114,7 +114,7 @@ bool VulkanTexture::CreateDirect(VkCommandBuffer cmd, VulkanDeviceAllocator *all
res = vkBindImageMemory(vulkan_->GetDevice(), image_, mem_, offset_);
if (res != VK_SUCCESS) {
ELOG("vkBindImageMemory failed: %s", VulkanResultToString(res));
ERROR_LOG(G3D, "vkBindImageMemory failed: %s", VulkanResultToString(res));
// This leaks the image and memory. Should not really happen though...
_assert_(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS);
return false;
@@ -156,7 +156,7 @@ bool VulkanTexture::CreateDirect(VkCommandBuffer cmd, VulkanDeviceAllocator *all
res = vkCreateImageView(vulkan_->GetDevice(), &view_info, NULL, &view_);
if (res != VK_SUCCESS) {
ELOG("vkCreateImageView failed: %s", VulkanResultToString(res));
ERROR_LOG(G3D, "vkCreateImageView failed: %s", VulkanResultToString(res));
// This leaks the image.
_assert_(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS);
return false;
+36 -35
View File
@@ -18,8 +18,9 @@
#include "Common/Vulkan/VulkanLoader.h"
#include <vector>
#include <string>
#include <cstring>
#include "base/logging.h"
#include "Common/Log.h"
#include "base/basictypes.h"
#include "base/NativeApp.h"
@@ -224,9 +225,9 @@ const char *VulkanResultToString(VkResult res);
bool g_vulkanAvailabilityChecked = false;
bool g_vulkanMayBeAvailable = false;
#define LOAD_INSTANCE_FUNC(instance, x) x = (PFN_ ## x)vkGetInstanceProcAddr(instance, #x); if (!x) {ILOG("Missing (instance): %s", #x);}
#define LOAD_DEVICE_FUNC(instance, x) x = (PFN_ ## x)vkGetDeviceProcAddr(instance, #x); if (!x) {ILOG("Missing (device): %s", #x);}
#define LOAD_GLOBAL_FUNC(x) x = (PFN_ ## x)dlsym(vulkanLibrary, #x); if (!x) {ILOG("Missing (global): %s", #x);}
#define LOAD_INSTANCE_FUNC(instance, x) x = (PFN_ ## x)vkGetInstanceProcAddr(instance, #x); if (!x) {INFO_LOG(G3D, "Missing (instance): %s", #x);}
#define LOAD_DEVICE_FUNC(instance, x) x = (PFN_ ## x)vkGetDeviceProcAddr(instance, #x); if (!x) {INFO_LOG(G3D, "Missing (device): %s", #x);}
#define LOAD_GLOBAL_FUNC(x) x = (PFN_ ## x)dlsym(vulkanLibrary, #x); if (!x) {INFO_LOG(G3D,"Missing (global): %s", #x);}
#define LOAD_GLOBAL_FUNC_LOCAL(lib, x) (PFN_ ## x)dlsym(lib, #x);
@@ -259,20 +260,20 @@ bool VulkanMayBeAvailable() {
std::string name = System_GetProperty(SYSPROP_NAME);
for (const char *blacklisted_name : device_name_blacklist) {
if (!strcmp(name.c_str(), blacklisted_name)) {
ILOG("VulkanMayBeAvailable: Device blacklisted ('%s')", name.c_str());
INFO_LOG(G3D, "VulkanMayBeAvailable: Device blacklisted ('%s')", name.c_str());
g_vulkanAvailabilityChecked = true;
g_vulkanMayBeAvailable = false;
return false;
}
}
ILOG("VulkanMayBeAvailable: Device allowed ('%s')", name.c_str());
INFO_LOG(G3D, "VulkanMayBeAvailable: Device allowed ('%s')", name.c_str());
#ifndef _WIN32
void *lib = nullptr;
for (int i = 0; i < ARRAY_SIZE(so_names); i++) {
lib = dlopen(so_names[i], RTLD_NOW | RTLD_LOCAL);
if (lib) {
ILOG("VulkanMayBeAvailable: Library loaded ('%s')", so_names[i]);
INFO_LOG(G3D, "VulkanMayBeAvailable: Library loaded ('%s')", so_names[i]);
break;
}
}
@@ -281,7 +282,7 @@ bool VulkanMayBeAvailable() {
HINSTANCE lib = LoadLibrary(L"vulkan-1.dll");
#endif
if (!lib) {
ILOG("Vulkan loader: Library not available");
INFO_LOG(G3D, "Vulkan loader: Library not available");
g_vulkanAvailabilityChecked = true;
g_vulkanMayBeAvailable = false;
return false;
@@ -321,32 +322,32 @@ bool VulkanMayBeAvailable() {
#endif
if (!localEnumerateInstanceExtensionProperties || !localCreateInstance || !localEnumerate || !localDestroyInstance || !localGetPhysicalDeviceProperties) {
WLOG("VulkanMayBeAvailable: Function pointer missing, bailing");
WARN_LOG(G3D, "VulkanMayBeAvailable: Function pointer missing, bailing");
goto bail;
}
ILOG("VulkanMayBeAvailable: Enumerating instance extensions");
INFO_LOG(G3D, "VulkanMayBeAvailable: Enumerating instance extensions");
res = localEnumerateInstanceExtensionProperties(nullptr, &instanceExtCount, nullptr);
// Maximum paranoia.
if (res != VK_SUCCESS) {
ELOG("Enumerating VK extensions failed (%s)", VulkanResultToString(res));
ERROR_LOG(G3D, "Enumerating VK extensions failed (%s)", VulkanResultToString(res));
goto bail;
}
if (instanceExtCount == 0) {
ELOG("No VK instance extensions - won't be able to present.");
ERROR_LOG(G3D, "No VK instance extensions - won't be able to present.");
goto bail;
}
ILOG("VulkanMayBeAvailable: Instance extension count: %d", instanceExtCount);
INFO_LOG(G3D, "VulkanMayBeAvailable: Instance extension count: %d", instanceExtCount);
instanceExts.resize(instanceExtCount);
res = localEnumerateInstanceExtensionProperties(nullptr, &instanceExtCount, instanceExts.data());
if (res != VK_SUCCESS) {
ELOG("Enumerating VK extensions failed (%s)", VulkanResultToString(res));
ERROR_LOG(G3D, "Enumerating VK extensions failed (%s)", VulkanResultToString(res));
goto bail;
}
for (auto iter : instanceExts) {
ILOG("VulkanMaybeAvailable: Instance extension found: %s (%08x)", iter.extensionName, iter.specVersion);
INFO_LOG(G3D, "VulkanMaybeAvailable: Instance extension found: %s (%08x)", iter.extensionName, iter.specVersion);
if (platformSurfaceExtension && !strcmp(iter.extensionName, platformSurfaceExtension)) {
ILOG("VulkanMayBeAvailable: Found platform surface extension '%s'", platformSurfaceExtension);
INFO_LOG(G3D, "VulkanMayBeAvailable: Found platform surface extension '%s'", platformSurfaceExtension);
instanceExtensions[ci.enabledExtensionCount++] = platformSurfaceExtension;
platformSurfaceExtensionFound = true;
break;
@@ -357,19 +358,19 @@ bool VulkanMayBeAvailable() {
}
if (platformSurfaceExtension) {
if (!platformSurfaceExtensionFound || !surfaceExtensionFound) {
ELOG("Platform surface extension not found");
ERROR_LOG(G3D, "Platform surface extension not found");
goto bail;
}
} else {
if (!surfaceExtensionFound) {
ELOG("Surface extension not found");
ERROR_LOG(G3D, "Surface extension not found");
goto bail;
}
}
// This can't happen unless the driver is double-reporting a surface extension.
if (ci.enabledExtensionCount > 2) {
ELOG("Unexpected number of enabled instance extensions");
ERROR_LOG(G3D, "Unexpected number of enabled instance extensions");
goto bail;
}
@@ -382,27 +383,27 @@ bool VulkanMayBeAvailable() {
info.pEngineName = "VulkanCheckerEngine";
ci.pApplicationInfo = &info;
ci.flags = 0;
ILOG("VulkanMayBeAvailable: Calling vkCreateInstance");
INFO_LOG(G3D, "VulkanMayBeAvailable: Calling vkCreateInstance");
res = localCreateInstance(&ci, nullptr, &instance);
if (res != VK_SUCCESS) {
instance = nullptr;
ELOG("VulkanMayBeAvailable: Failed to create vulkan instance (%s)", VulkanResultToString(res));
ERROR_LOG(G3D, "VulkanMayBeAvailable: Failed to create vulkan instance (%s)", VulkanResultToString(res));
goto bail;
}
ILOG("VulkanMayBeAvailable: Vulkan test instance created successfully.");
INFO_LOG(G3D, "VulkanMayBeAvailable: Vulkan test instance created successfully.");
res = localEnumerate(instance, &physicalDeviceCount, nullptr);
if (res != VK_SUCCESS) {
ELOG("VulkanMayBeAvailable: Failed to count physical devices (%s)", VulkanResultToString(res));
ERROR_LOG(G3D, "VulkanMayBeAvailable: Failed to count physical devices (%s)", VulkanResultToString(res));
goto bail;
}
if (physicalDeviceCount == 0) {
ELOG("VulkanMayBeAvailable: No physical Vulkan devices (count = 0).");
ERROR_LOG(G3D, "VulkanMayBeAvailable: No physical Vulkan devices (count = 0).");
goto bail;
}
devices.resize(physicalDeviceCount);
res = localEnumerate(instance, &physicalDeviceCount, devices.data());
if (res != VK_SUCCESS) {
ELOG("VulkanMayBeAvailable: Failed to enumerate physical devices (%s)", VulkanResultToString(res));
ERROR_LOG(G3D, "VulkanMayBeAvailable: Failed to enumerate physical devices (%s)", VulkanResultToString(res));
goto bail;
}
anyGood = false;
@@ -416,24 +417,24 @@ bool VulkanMayBeAvailable() {
anyGood = true;
break;
default:
ILOG("VulkanMayBeAvailable: Ineligible device found and ignored: '%s'", props.deviceName);
INFO_LOG(G3D, "VulkanMayBeAvailable: Ineligible device found and ignored: '%s'", props.deviceName);
break;
}
// TODO: Should also check queuefamilyproperties for a GRAPHICS queue family? Oh well.
}
if (!anyGood) {
WLOG("VulkanMayBeAvailable: Found Vulkan API, but no good Vulkan device!");
WARN_LOG(G3D, "VulkanMayBeAvailable: Found Vulkan API, but no good Vulkan device!");
g_vulkanMayBeAvailable = false;
} else {
ILOG("VulkanMayBeAvailable: Found working Vulkan API!");
INFO_LOG(G3D, "VulkanMayBeAvailable: Found working Vulkan API!");
g_vulkanMayBeAvailable = true;
}
bail:
g_vulkanAvailabilityChecked = true;
if (instance) {
ILOG("VulkanMayBeAvailable: Destroying instance");
INFO_LOG(G3D, "VulkanMayBeAvailable: Destroying instance");
localDestroyInstance(instance, nullptr);
}
if (lib) {
@@ -443,7 +444,7 @@ bail:
FreeLibrary(lib);
#endif
} else {
ELOG("Vulkan with working device not detected.");
ERROR_LOG(G3D, "Vulkan with working device not detected.");
}
return g_vulkanMayBeAvailable;
}
@@ -454,7 +455,7 @@ bool VulkanLoad() {
for (int i = 0; i < ARRAY_SIZE(so_names); i++) {
vulkanLibrary = dlopen(so_names[i], RTLD_NOW | RTLD_LOCAL);
if (vulkanLibrary) {
ILOG("VulkanLoad: Found library '%s'", so_names[i]);
INFO_LOG(G3D, "VulkanLoad: Found library '%s'", so_names[i]);
break;
}
}
@@ -475,10 +476,10 @@ bool VulkanLoad() {
LOAD_GLOBAL_FUNC(vkEnumerateInstanceLayerProperties);
if (vkCreateInstance && vkGetInstanceProcAddr && vkGetDeviceProcAddr && vkEnumerateInstanceExtensionProperties && vkEnumerateInstanceLayerProperties) {
WLOG("VulkanLoad: Base functions loaded.");
WARN_LOG(G3D, "VulkanLoad: Base functions loaded.");
return true;
} else {
ELOG("VulkanLoad: Failed to load Vulkan base functions.");
ERROR_LOG(G3D, "VulkanLoad: Failed to load Vulkan base functions.");
#ifndef _WIN32
dlclose(vulkanLibrary);
#else
@@ -548,14 +549,14 @@ void VulkanLoadInstanceFunctions(VkInstance instance, const VulkanExtensions &en
LOAD_INSTANCE_FUNC(instance, vkSetDebugUtilsObjectTagEXT);
}
WLOG("Vulkan instance functions loaded.");
WARN_LOG(G3D, "Vulkan instance functions loaded.");
}
// On some implementations, loading functions (that have Device as their first parameter) via vkGetDeviceProcAddr may
// increase performance - but then these function pointers will only work on that specific device. Thus, this loader is not very
// good for multi-device - not likely we'll ever try that anyway though.
void VulkanLoadDeviceFunctions(VkDevice device, const VulkanExtensions &enabledExtensions) {
WLOG("Vulkan device functions loaded.");
WARN_LOG(G3D, "Vulkan device functions loaded.");
LOAD_DEVICE_FUNC(device, vkQueueSubmit);
LOAD_DEVICE_FUNC(device, vkQueueWaitIdle);
+20 -19
View File
@@ -18,19 +18,20 @@
// Additionally, Common/Vulkan/* , including this file, are also licensed
// under the public domain.
#include "Common/Log.h"
#include "Common/Vulkan/VulkanMemory.h"
#include "base/timeutil.h"
#include "math/math_util.h"
#include "Common/Log.h"
#include "Common/Vulkan/VulkanMemory.h"
VulkanPushBuffer::VulkanPushBuffer(VulkanContext *vulkan, size_t size, VkBufferUsageFlags usage, VkMemoryPropertyFlags memoryPropertyMask)
: vulkan_(vulkan), memoryPropertyMask_(memoryPropertyMask), size_(size), usage_(usage) {
bool res = AddBuffer();
assert(res);
_assert_(res);
}
VulkanPushBuffer::~VulkanPushBuffer() {
assert(buffers_.empty());
_assert_(buffers_.empty());
}
bool VulkanPushBuffer::AddBuffer() {
@@ -68,7 +69,7 @@ bool VulkanPushBuffer::AddBuffer() {
}
res = vkBindBufferMemory(device, info.buffer, info.deviceMemory, 0);
if (VK_SUCCESS != res) {
ELOG("vkBindBufferMemory failed! result=%d", (int)res);
ERROR_LOG(G3D, "vkBindBufferMemory failed! result=%d", (int)res);
vkFreeMemory(device, info.deviceMemory, nullptr);
vkDestroyBuffer(device, info.buffer, nullptr);
return false;
@@ -100,7 +101,7 @@ void VulkanPushBuffer::NextBuffer(size_t minSize) {
}
bool res = AddBuffer();
assert(res);
_assert_(res);
if (!res) {
// Let's try not to crash at least?
buf_ = 0;
@@ -124,7 +125,7 @@ void VulkanPushBuffer::Defragment(VulkanContext *vulkan) {
size_ = newSize;
bool res = AddBuffer();
assert(res);
_assert_(res);
}
size_t VulkanPushBuffer::GetTotalSize() const {
@@ -139,7 +140,7 @@ void VulkanPushBuffer::Map() {
_dbg_assert_(!writePtr_);
VkResult res = vkMapMemory(vulkan_->GetDevice(), buffers_[buf_].deviceMemory, 0, size_, 0, (void **)(&writePtr_));
_dbg_assert_(writePtr_);
assert(VK_SUCCESS == res);
_assert_(VK_SUCCESS == res);
}
void VulkanPushBuffer::Unmap() {
@@ -161,12 +162,12 @@ void VulkanPushBuffer::Unmap() {
VulkanDeviceAllocator::VulkanDeviceAllocator(VulkanContext *vulkan, size_t minSlabSize, size_t maxSlabSize)
: vulkan_(vulkan), minSlabSize_(minSlabSize), maxSlabSize_(maxSlabSize) {
assert((minSlabSize_ & (SLAB_GRAIN_SIZE - 1)) == 0);
_assert_((minSlabSize_ & (SLAB_GRAIN_SIZE - 1)) == 0);
}
VulkanDeviceAllocator::~VulkanDeviceAllocator() {
assert(destroyed_);
assert(slabs_.empty());
_assert_(destroyed_);
_assert_(slabs_.empty());
}
void VulkanDeviceAllocator::Destroy() {
@@ -183,7 +184,7 @@ void VulkanDeviceAllocator::Destroy() {
}
}
assert(slab.deviceMemory);
_assert_(slab.deviceMemory);
vulkan_->Delete().QueueDeleteDeviceMemory(slab.deviceMemory);
}
slabs_.clear();
@@ -191,11 +192,11 @@ void VulkanDeviceAllocator::Destroy() {
}
size_t VulkanDeviceAllocator::Allocate(const VkMemoryRequirements &reqs, VkDeviceMemory *deviceMemory, const std::string &tag) {
assert(!destroyed_);
_assert_(!destroyed_);
uint32_t memoryTypeIndex;
bool pass = vulkan_->MemoryTypeFromProperties(reqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, &memoryTypeIndex);
if (!pass) {
ELOG("Failed to pick an appropriate memory type (req: %08x)", reqs.memoryTypeBits);
ERROR_LOG(G3D, "Failed to pick an appropriate memory type (req: %08x)", reqs.memoryTypeBits);
return ALLOCATE_FAILED;
}
@@ -244,7 +245,7 @@ size_t VulkanDeviceAllocator::Allocate(const VkMemoryRequirements &reqs, VkDevic
}
bool VulkanDeviceAllocator::AllocateFromSlab(Slab &slab, size_t &start, size_t blocks, const std::string &tag) {
assert(!destroyed_);
_assert_(!destroyed_);
bool matched = true;
if (start + blocks > slab.usage.size()) {
@@ -320,7 +321,7 @@ void VulkanDeviceAllocator::DoTouch(VkDeviceMemory deviceMemory, size_t offset)
}
void VulkanDeviceAllocator::Free(VkDeviceMemory deviceMemory, size_t offset) {
assert(!destroyed_);
_assert_(!destroyed_);
_assert_msg_(!slabs_.empty(), "No slabs - can't be anything to free! double-freed?");
@@ -401,7 +402,7 @@ void VulkanDeviceAllocator::ExecuteFree(FreeInfo *userdata) {
}
bool VulkanDeviceAllocator::AllocateSlab(VkDeviceSize minBytes, int memoryTypeIndex) {
assert(!destroyed_);
_assert_(!destroyed_);
if (!slabs_.empty() && minSlabSize_ < maxSlabSize_) {
// We're allocating an additional slab, so rachet up its size.
// TODO: Maybe should not do this when we are allocating a new slab due to memoryTypeIndex not matching?
@@ -420,7 +421,7 @@ bool VulkanDeviceAllocator::AllocateSlab(VkDeviceSize minBytes, int memoryTypeIn
VkResult res = vkAllocateMemory(vulkan_->GetDevice(), &alloc, NULL, &deviceMemory);
if (res != VK_SUCCESS) {
// If it's something else, we used it wrong?
assert(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS);
_assert_(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS);
// Okay, so we ran out of memory.
return false;
}
@@ -464,7 +465,7 @@ void VulkanDeviceAllocator::ReportOldUsage() {
}
void VulkanDeviceAllocator::Decimate() {
assert(!destroyed_);
_assert_(!destroyed_);
bool foundFree = false;
if (TRACK_TOUCH) {
-68
View File
@@ -1,68 +0,0 @@
// Copyright (C) 2003 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <memory.h>
#include "base/logging.h"
#include "base/basictypes.h"
#include "Common.h"
#include "CPUDetect.h"
#include "StringUtils.h"
CPUInfo cpu_info;
CPUInfo::CPUInfo() {
Detect();
}
// Detects the various cpu features
void CPUInfo::Detect()
{
memset(this, 0, sizeof(*this));
num_cores = 3;
strcpy(cpu_string, "Xenon");
strcpy(brand_string, "Microsoft");
memset(cpu_string, 0, sizeof(cpu_string));
HTT = true;
logical_cpu_count = 2;
}
// Turn the cpu info into a string we can show
std::string CPUInfo::Summarize()
{
std::string sum;
if (num_cores == 1)
sum = StringFromFormat("%s, %i core", cpu_string, num_cores);
else
{
sum = StringFromFormat("%s, %i cores", cpu_string, num_cores);
if (HTT) sum += StringFromFormat(" (%i logical threads per physical core)", logical_cpu_count);
}
if (bSSE) sum += ", SSE";
if (bSSE2) sum += ", SSE2";
if (bSSE3) sum += ", SSE3";
if (bSSSE3) sum += ", SSSE3";
if (bSSE4_1) sum += ", SSE4.1";
if (bSSE4_2) sum += ", SSE4.2";
if (HTT) sum += ", HTT";
if (bAVX) sum += ", AVX";
if (bAES) sum += ", AES";
if (bLongMode) sum += ", 64-bit support";
return sum;
}
+1 -1
View File
@@ -527,7 +527,7 @@ static int DefaultInternalResolution() {
#else
int longestDisplaySide = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES));
int scale = longestDisplaySide >= 1000 ? 2 : 1;
ILOG("Longest display side: %d pixels. Choosing scale %d", longestDisplaySide, scale);
INFO_LOG(G3D, "Longest display side: %d pixels. Choosing scale %d", longestDisplaySide, scale);
return scale;
#endif
}
+1 -1
View File
@@ -190,7 +190,7 @@ bool UpdateScreenScale(int width, int height) {
dp_yres = new_dp_yres;
pixel_xres = width;
pixel_yres = height;
ILOG("pixel_res: %dx%d. Calling NativeResized()", pixel_xres, pixel_yres);
INFO_LOG(G3D, "pixel_res: %dx%d. Calling NativeResized()", pixel_xres, pixel_yres);
NativeResized();
return true;
}
-1
View File
@@ -20,7 +20,6 @@
#include <cstdio>
#include <mutex>
#include "base/logging.h"
#include "profiler/profiler.h"
#include "Common/MsgHandler.h"
+3 -1
View File
@@ -19,9 +19,11 @@
#include <cassert>
#include <string>
#include "json/json_reader.h"
#include "json/json_writer.h"
#include "net/websocket_server.h"
#include "Common/Log.h"
#include "ppsspp_config.h"
@@ -54,7 +56,7 @@ struct DebuggerErrorEvent {
LogTypes::LOG_LEVELS level;
std::string ticketRaw;
operator std::string() {
operator std::string() const {
JsonWriter j;
j.begin();
j.writeString("event", "error");
+2 -2
View File
@@ -16,7 +16,7 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "i18n/i18n.h"
#include "base/logging.h"
#include "Common/Log.h"
#include "Common/Serialize/Serializer.h"
#include "Common/Serialize/SerializeFuncs.h"
#include "Common/StringUtils.h"
@@ -213,7 +213,7 @@ void SavedataParam::Init()
if (handle >= 0) {
pspFileSystem.CloseFile(handle);
} else {
ELOG("Failed to create .nomedia file");
ERROR_LOG(IO, "Failed to create .nomedia file");
}
#endif
}
-1
View File
@@ -22,7 +22,6 @@
#include <string>
#include <vector>
#include "Common/Log.h"
#include "Common/CommonTypes.h"
class PointerWrap;
+1 -1
View File
@@ -20,10 +20,10 @@
#include <vector>
#include <string>
#include "base/logging.h"
#include "base/timeutil.h"
#include "profiler/profiler.h"
#include "Common/Log.h"
#include "Common/Serialize/SerializeFuncs.h"
#include "Core/Config.h"
#include "Core/Core.h"
-1
View File
@@ -20,7 +20,6 @@
#include <unordered_map>
#include "base/basictypes.h"
#include "base/logging.h"
#include "Common/Log.h"
#include "Core/Config.h"
#include "Core/Debugger/Breakpoints.h"
-4
View File
@@ -26,10 +26,6 @@
#include <sys/time.h>
#endif
// TODO: Move the relevant parts into common. Don't want the core
// to be dependent on "native", I think. Or maybe should get rid of common
// and move everything into native...
#include "base/logging.h"
#include "base/timeutil.h"
#include "i18n/i18n.h"
#include "profiler/profiler.h"
+1 -1
View File
@@ -1799,7 +1799,7 @@ void __KernelGPUReplay() {
// Special ABI: s0 and s1 are the "args". Not null terminated.
const char *filenamep = Memory::GetCharPointer(currentMIPS->r[MIPS_REG_S1]);
if (!filenamep) {
ERROR_LOG(SYSTEM, "Failed to load dump filename");
ERROR_LOG(G3D, "Failed to load dump filename");
Core_Stop();
return;
}
-2
View File
@@ -21,8 +21,6 @@
#include <mutex>
#include <set>
#include "base/logging.h"
#include "Common/CommonTypes.h"
#include "Common/LogManager.h"
#include "Common/Serialize/Serializer.h"
+2 -2
View File
@@ -35,11 +35,11 @@
#include <cstring>
#include <atomic>
#include "base/logging.h"
#include "base/timeutil.h"
#include "base/NativeApp.h"
#include "Common/Serialize/Serializer.h"
#include "Common/MathUtil.h"
#include "Common/Log.h"
#include "Core/Config.h"
#include "Core/ConfigValues.h"
#include "Core/HW/StereoResampler.h"
@@ -71,7 +71,7 @@ StereoResampler::StereoResampler()
// If framerate is "close"...
if (refresh != 60.0f && refresh > 50.0f && refresh < 70.0f) {
int input_sample_rate = (int)(44100 * (refresh / 60.0f));
ILOG("StereoResampler: Adjusting target sample rate to %dHz", input_sample_rate);
INFO_LOG(AUDIO, "StereoResampler: Adjusting target sample rate to %dHz", input_sample_rate);
m_input_sample_rate = input_sample_rate;
}
+2 -4
View File
@@ -30,7 +30,6 @@
#include <cmath>
#include "base/logging.h"
#include "math/math_util.h"
#include "Common/CPUDetect.h"
@@ -55,8 +54,7 @@
// #define CONDITIONAL_DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define CONDITIONAL_DISABLE(flag) if (jo.Disabled(JitDisable::flag)) { Comp_Generic(op); return; }
#define DISABLE { fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define DISABLE_UNKNOWN_PREFIX { WLOG("DISABLE: Unknown Prefix in %s", __FUNCTION__); fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define DISABLE_UNKNOWN_PREFIX { WARN_LOG(JIT, "DISABLE: Unknown Prefix in %s", __FUNCTION__); fpr.ReleaseSpillLocksAndDiscardTemps(); Comp_Generic(op); return; }
#define _RS MIPS_GET_RS(op)
#define _RT MIPS_GET_RT(op)
@@ -864,7 +862,7 @@ void ArmJit::CompNEON_Vmmul(MIPSOpcode op) {
bool overlap = GetMatrixOverlap(_VD, _VS, msz) || GetMatrixOverlap(_VD, _VT, msz);
if (overlap) {
// Later. Fortunately, the VFPU also seems to prohibit overlap for matrix mul.
ILOG("Matrix overlap, ignoring.");
INFO_LOG(JIT, "Matrix overlap, ignoring.");
DISABLE;
}
+6 -7
View File
@@ -30,7 +30,6 @@
#include <cmath>
#include "base/logging.h"
#include "math/math_util.h"
#include "Common/CPUDetect.h"
@@ -271,7 +270,7 @@ ArmJit::DestARMReg ArmJit::NEONMapPrefixD(int vreg, VectorSize sz, int mapFlags)
dest.backingRd = dest.rd;
} else {
// Allocate a temporary register.
ELOG("PREFIXD: Write mask allocated! %i/%i", writeMask, full_mask);
ERROR_LOG(JIT, "PREFIXD: Write mask allocated! %i/%i", writeMask, full_mask);
dest.rd = fpr.QAllocTemp(sz);
dest.backingRd = fpr.QMapReg(vreg, sz, mapFlags & ~MAP_NOINIT); // Force initialization of the backing reg.
}
@@ -295,12 +294,12 @@ void ArmJit::NEONApplyPrefixD(DestARMReg dest) {
if (sat1_mask && sat3_mask) {
// Why would anyone do this?
ELOG("PREFIXD: Can't have both sat[0-1] and sat[-1-1] at the same time yet");
ERROR_LOG(JIT, "PREFIXD: Can't have both sat[0-1] and sat[-1-1] at the same time yet");
}
if (sat1_mask) {
if (sat1_mask != full_mask) {
ELOG("PREFIXD: Can't have partial sat1 mask yet (%i vs %i)", sat1_mask, full_mask);
ERROR_LOG(JIT, "PREFIXD: Can't have partial sat1 mask yet (%i vs %i)", sat1_mask, full_mask);
}
if (IsD(dest.rd)) {
VMOV_immf(D0, 0.0);
@@ -317,7 +316,7 @@ void ArmJit::NEONApplyPrefixD(DestARMReg dest) {
if (sat3_mask && sat1_mask != full_mask) {
if (sat3_mask != full_mask) {
ELOG("PREFIXD: Can't have partial sat3 mask yet (%i vs %i)", sat3_mask, full_mask);
ERROR_LOG(JIT, "PREFIXD: Can't have partial sat3 mask yet (%i vs %i)", sat3_mask, full_mask);
}
if (IsD(dest.rd)) {
VMOV_immf(D0, 0.0);
@@ -341,11 +340,11 @@ void ArmJit::NEONApplyPrefixD(DestARMReg dest) {
int writeMask = (~(js.prefixD >> 8)) & 0xF;
if (writeMask == 3) {
ILOG("Doing writemask = 3");
INFO_LOG(JIT, "Doing writemask = 3");
VMOV(D_0(dest.rd), D_0(dest.backingRd));
} else {
// TODO
ELOG("PREFIXD: Arbitrary write masks not supported (%i / %i)", writeMask, full_mask);
ERROR_LOG(JIT, "PREFIXD: Arbitrary write masks not supported (%i / %i)", writeMask, full_mask);
VMOV(dest.backingRd, dest.rd);
}
}
+4 -3
View File
@@ -18,8 +18,9 @@
#include "ppsspp_config.h"
#if PPSSPP_ARCH(ARM)
#include "base/logging.h"
#include "profiler/profiler.h"
#include "Common/Log.h"
#include "Common/Serialize/Serializer.h"
#include "Common/Serialize/SerializeFuncs.h"
@@ -61,13 +62,13 @@ void DisassembleArm(const u8 *data, int size) {
int reg1 = (next & 0x0000F000) >> 12;
if (reg0 == reg1) {
sprintf(temp, "%08x MOV32 %s, %04x%04x", (u32)inst, ArmRegName(reg0), hi, low);
ILOG("A: %s", temp);
INFO_LOG(JIT, "A: %s", temp);
i += 4;
continue;
}
}
ArmDis((u32)codePtr, inst, temp, sizeof(temp), true);
ILOG("A: %s", temp);
INFO_LOG(JIT, "A: %s", temp);
}
}
+6 -6
View File
@@ -17,8 +17,8 @@
#include <cstring>
#include "base/logging.h"
#include "Common/CPUDetect.h"
#include "Common/Log.h"
#include "Core/MIPS/MIPS.h"
#include "Core/MIPS/ARM/ArmRegCacheFPU.h"
#include "Core/MIPS/ARM/ArmJit.h"
@@ -463,13 +463,13 @@ void ArmRegCacheFPU::FlushAll() {
if (ar[a].isDirty) {
if (m == -1) {
ILOG("ARM reg %i is dirty but has no mipsreg", a);
INFO_LOG(JIT, "ARM reg %i is dirty but has no mipsreg", a);
continue;
}
int c = FlushGetSequential(a, GetNumARMFPURegs());
if (c == 1) {
// ILOG("Got single register: %i (%i)", a, m);
// INFO_LOG(JIT, "Got single register: %i (%i)", a, m);
emit_->VSTR((ARMReg)(a + S0), CTXREG, GetMipsRegOffset(m));
} else if (c == 2) {
// Probably not worth using VSTMIA for two.
@@ -477,9 +477,9 @@ void ArmRegCacheFPU::FlushAll() {
emit_->VSTR((ARMReg)(a + S0), CTXREG, offset);
emit_->VSTR((ARMReg)(a + 1 + S0), CTXREG, offset + 4);
} else {
// ILOG("Got sequence: %i at %i (%i)", c, a, m);
// INFO_LOG(JIT, "Got sequence: %i at %i (%i)", c, a, m);
emit_->ADDI2R(SCRATCHREG1, CTXREG, GetMipsRegOffset(m), SCRATCHREG2);
// ILOG("VSTMIA R0, %i, %i", a, c);
// INFO_LOG(JIT, "VSTMIA R0, %i, %i", a, c);
emit_->VSTMIA(SCRATCHREG1, false, (ARMReg)(S0 + a), c);
}
@@ -908,7 +908,7 @@ ARMReg ArmRegCacheFPU::QMapReg(int vreg, VectorSize sz, int flags) {
// We didn't find the extra register, but we got a list of regs to flush. Flush 'em.
// Here we can check for opportunities to do a "transpose-flush" of row vectors, etc.
if (!quadsToFlush.empty()) {
ILOG("New mapping %s collided with %i quads, flushing them.", GetVectorNotation(vreg, sz), (int)quadsToFlush.size());
INFO_LOG(JIT, "New mapping %s collided with %d quads, flushing them.", GetVectorNotation(vreg, sz), (int)quadsToFlush.size());
}
for (size_t i = 0; i < quadsToFlush.size(); i++) {
QFlush(quadsToFlush[i]);
+6 -7
View File
@@ -18,15 +18,14 @@
#include "ppsspp_config.h"
#if PPSSPP_ARCH(ARM64)
#include "base/logging.h"
#include "Common/Log.h"
#include "Common/MemoryUtil.h"
#include "Common/CPUDetect.h"
#include "Common/Arm64Emitter.h"
#include "Core/MemMap.h"
#include "Core/MIPS/MIPS.h"
#include "Core/System.h"
#include "Core/CoreTiming.h"
#include "Common/MemoryUtil.h"
#include "Common/CPUDetect.h"
#include "Common/Arm64Emitter.h"
#include "Core/MIPS/ARM64/Arm64Jit.h"
#include "Core/MIPS/JitCommon/JitCommon.h"
@@ -77,9 +76,9 @@ extern volatile CoreState coreState;
void ShowPC(u32 downcount, void *membase, void *jitbase) {
static int count = 0;
if (currentMIPS) {
ELOG("ShowPC : %08x Downcount : %08x %d %p %p", currentMIPS->pc, downcount, count, membase, jitbase);
ERROR_LOG(JIT, "ShowPC : %08x Downcount : %08x %d %p %p", currentMIPS->pc, downcount, count, membase, jitbase);
} else {
ELOG("Universe corrupt?");
ERROR_LOG(JIT, "Universe corrupt?");
}
//if (count > 2000)
// exit(0);
+10 -10
View File
@@ -18,8 +18,8 @@
#include "ppsspp_config.h"
#if PPSSPP_ARCH(ARM64)
#include "base/logging.h"
#include "profiler/profiler.h"
#include "Common/Log.h"
#include "Common/Serialize/Serializer.h"
#include "Common/Serialize/SerializeFuncs.h"
#include "Common/CPUDetect.h"
@@ -49,17 +49,17 @@ using namespace Arm64JitConstants;
static void DisassembleArm64Print(const u8 *data, int size) {
std::vector<std::string> lines = DisassembleArm64(data, size);
for (auto s : lines) {
ILOG("%s", s.c_str());
INFO_LOG(JIT, "%s", s.c_str());
}
/*
ILOG("+++");
INFO_LOG(JIT, "+++");
// A format friendly to Online Disassembler which gets endianness wrong
for (size_t i = 0; i < lines.size(); i++) {
uint32_t opcode = ((const uint32_t *)data)[i];
ILOG("%d/%d: %08x", (int)(i+1), (int)lines.size(), swap32(opcode));
INFO_LOG(JIT, "%d/%d: %08x", (int)(i+1), (int)lines.size(), swap32(opcode));
}
ILOG("===");
ILOG("===");*/
INFO_LOG(JIT, "===");
INFO_LOG(JIT, "===");*/
}
static u32 JitBreakpoint() {
@@ -169,7 +169,7 @@ void Arm64Jit::FlushPrefixV() {
}
void Arm64Jit::ClearCache() {
ILOG("ARM64Jit: Clearing the cache!");
INFO_LOG(JIT, "ARM64Jit: Clearing the cache!");
blocks.Clear();
ClearCodeSpace(jitStartOffset);
FlushIcacheSection(region + jitStartOffset, region + region_size - jitStartOffset);
@@ -361,16 +361,16 @@ const u8 *Arm64Jit::DoJit(u32 em_address, JitBlock *b) {
char temp[256];
if (logBlocks > 0 && dontLogBlocks == 0) {
ILOG("=============== mips %d ===============", blocks.GetNumBlocks());
INFO_LOG(JIT, "=============== mips %d ===============", blocks.GetNumBlocks());
for (u32 cpc = em_address; cpc != GetCompilerPC() + 4; cpc += 4) {
MIPSDisAsm(Memory::Read_Opcode_JIT(cpc), cpc, temp, true);
ILOG("M: %08x %s", cpc, temp);
INFO_LOG(JIT, "M: %08x %s", cpc, temp);
}
}
b->codeSize = GetCodePtr() - b->normalEntry;
if (logBlocks > 0 && dontLogBlocks == 0) {
ILOG("=============== ARM (%d instructions -> %d bytes) ===============", js.numInstructions, b->codeSize);
INFO_LOG(JIT, "=============== ARM (%d instructions -> %d bytes) ===============", js.numInstructions, b->codeSize);
DisassembleArm64Print(b->normalEntry, GetCodePtr() - b->normalEntry);
}
if (logBlocks > 0)
+10 -10
View File
@@ -18,7 +18,7 @@
#include "ppsspp_config.h"
#if PPSSPP_ARCH(ARM64)
#include "base/logging.h"
#include "Common/Log.h"
#include "Core/MemMap.h"
#include "Core/MIPS/ARM64/Arm64RegCache.h"
#include "Core/MIPS/ARM64/Arm64Jit.h"
@@ -150,7 +150,7 @@ bool Arm64RegCache::IsMappedAsPointer(MIPSGPReg mipsReg) {
return ar[mr[mipsReg].reg].pointerified;
} else if (mr[mipsReg].loc == ML_ARMREG_IMM) {
if (ar[mr[mipsReg].reg].pointerified) {
ELOG("Really shouldn't be pointerified here");
ERROR_LOG(JIT, "Really shouldn't be pointerified here");
}
} else if (mr[mipsReg].loc == ML_ARMREG_AS_PTR) {
return true;
@@ -164,7 +164,7 @@ void Arm64RegCache::MarkDirty(ARM64Reg reg) {
void Arm64RegCache::SetRegImm(ARM64Reg reg, u64 imm) {
if (reg == INVALID_REG) {
ELOG("SetRegImm to invalid register: at %08x", js_->compilerPC);
ERROR_LOG(JIT, "SetRegImm to invalid register: at %08x", js_->compilerPC);
return;
}
// On ARM64, at least Cortex A57, good old MOVT/MOVW (MOVK in 64-bit) is really fast.
@@ -174,7 +174,7 @@ void Arm64RegCache::SetRegImm(ARM64Reg reg, u64 imm) {
void Arm64RegCache::MapRegTo(ARM64Reg reg, MIPSGPReg mipsReg, int mapFlags) {
if (mr[mipsReg].isStatic) {
ELOG("Cannot MapRegTo static register %d", mipsReg);
ERROR_LOG(JIT, "Cannot MapRegTo static register %d", mipsReg);
return;
}
ar[reg].isDirty = (mapFlags & MAP_DIRTY) ? true : false;
@@ -450,7 +450,7 @@ Arm64Gen::ARM64Reg Arm64RegCache::MapRegAsPointer(MIPSGPReg reg) {
ar[a].pointerified = true;
}
} else {
ELOG("MapRegAsPointer : MapReg failed to allocate a register?");
ERROR_LOG(JIT, "MapRegAsPointer : MapReg failed to allocate a register?");
}
return retval;
}
@@ -506,7 +506,7 @@ void Arm64RegCache::MapDirtyDirtyInIn(MIPSGPReg rd1, MIPSGPReg rd2, MIPSGPReg rs
void Arm64RegCache::FlushArmReg(ARM64Reg r) {
if (r == INVALID_REG) {
ELOG("FlushArmReg called on invalid register %d", r);
ERROR_LOG(JIT, "FlushArmReg called on invalid register %d", r);
return;
}
if (ar[r].mipsReg == MIPS_REG_INVALID) {
@@ -517,7 +517,7 @@ void Arm64RegCache::FlushArmReg(ARM64Reg r) {
return;
}
if (mr[ar[r].mipsReg].isStatic) {
ELOG("Cannot FlushArmReg a statically mapped register");
ERROR_LOG(JIT, "Cannot FlushArmReg a statically mapped register");
return;
}
auto &mreg = mr[ar[r].mipsReg];
@@ -629,7 +629,7 @@ ARM64Reg Arm64RegCache::ARM64RegForFlush(MIPSGPReg r) {
void Arm64RegCache::FlushR(MIPSGPReg r) {
if (mr[r].isStatic) {
ELOG("Cannot flush static reg %d", r);
ERROR_LOG(JIT, "Cannot flush static reg %d", r);
return;
}
@@ -753,7 +753,7 @@ void Arm64RegCache::FlushAll() {
} else if (mr[i].loc == ML_ARMREG_IMM) {
// The register already contains the immediate.
if (ar[armReg].pointerified) {
ELOG("ML_ARMREG_IMM but pointerified. Wrong.");
ERROR_LOG(JIT, "ML_ARMREG_IMM but pointerified. Wrong.");
ar[armReg].pointerified = false;
}
mr[i].loc = ML_ARMREG;
@@ -762,7 +762,7 @@ void Arm64RegCache::FlushAll() {
mr[i].loc = ML_ARMREG;
}
if (i != MIPS_REG_ZERO && mr[i].reg == INVALID_REG) {
ELOG("ARM reg of static %i is invalid", i);
ERROR_LOG(JIT, "ARM reg of static %i is invalid", i);
continue;
}
} else {
+3 -3
View File
@@ -20,8 +20,8 @@
#include <cstring>
#include "base/logging.h"
#include "Common/CPUDetect.h"
#include "Common/Log.h"
#include "Core/Reporting.h"
#include "Core/MIPS/MIPS.h"
#include "Core/MIPS/ARM64/Arm64RegCacheFPU.h"
@@ -400,7 +400,7 @@ void Arm64RegCacheFPU::FlushAll() {
if (ar[a].isDirty) {
if (m == -1) {
ILOG("ARM reg %i is dirty but has no mipsreg", a);
INFO_LOG(JIT, "ARM reg %d is dirty but has no mipsreg", a);
continue;
}
@@ -423,7 +423,7 @@ void Arm64RegCacheFPU::FlushAll() {
// Sanity check
for (int i = 0; i < numARMFpuReg_; i++) {
if (ar[i].mipsReg != -1) {
ERROR_LOG(JIT, "Flush fail: ar[%i].mipsReg=%i", i, ar[i].mipsReg);
ERROR_LOG(JIT, "Flush fail: ar[%d].mipsReg=%d", i, ar[i].mipsReg);
}
}
pendingFlush = false;
+2 -3
View File
@@ -15,13 +15,12 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include "Common/Log.h"
#include "Common/MemoryUtil.h"
#include "Core/MemMap.h"
#include "Core/MIPS/MIPS.h"
#include "Core/System.h"
#include "Core/CoreTiming.h"
#include "Common/MemoryUtil.h"
#include "Core/MIPS/IR/IRJit.h"
#include "Core/MIPS/JitCommon/JitCommon.h"
+1 -2
View File
@@ -15,8 +15,7 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include "Common/Log.h"
#include "Common/Serialize/Serializer.h"
#include "Common/Serialize/SerializeFuncs.h"
#include "Core/Debugger/Breakpoints.h"
+4 -2
View File
@@ -16,9 +16,11 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <set>
#include "base/logging.h"
#include "ext/xxhash.h"
#include "profiler/profiler.h"
#include "Common/Log.h"
#include "Common/Serialize/Serializer.h"
#include "Common/StringUtils.h"
@@ -61,7 +63,7 @@ void IRJit::UpdateFCR31() {
}
void IRJit::ClearCache() {
ILOG("IRJit: Clearing the cache!");
INFO_LOG(JIT, "IRJit: Clearing the cache!");
blocks_.Clear();
}
-1
View File
@@ -18,7 +18,6 @@
#include "ppsspp_config.h"
#if PPSSPP_ARCH(MIPS)
#include "base/logging.h"
#include "profiler/profiler.h"
#include "Common/Serialize/Serializer.h"
#include "Core/Reporting.h"
-1
View File
@@ -28,7 +28,6 @@
#include "Core/CoreTiming.h"
#include "Core/Reporting.h"
#include "Core/Debugger/Breakpoints.h"
#include "base/logging.h"
#include "JitCommon/JitCommon.h"
-1
View File
@@ -15,7 +15,6 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include "Common/Serialize/Serializer.h"
#include "Core/Reporting.h"
#include "Core/Config.h"
+1 -1
View File
@@ -25,10 +25,10 @@
#include <limits>
#include <emmintrin.h>
#include "base/logging.h"
#include "math/math_util.h"
#include "Common/CPUDetect.h"
#include "Common/Log.h"
#include "Core/Compatibility.h"
#include "Core/Config.h"
#include "Core/MemMap.h"
+7 -13
View File
@@ -71,13 +71,12 @@ private:
static bool WriteScreenshotToJPEG(const char *filename, int width, int height, int num_channels, const uint8_t *image_data, const jpge::params &comp_params) {
JPEGFileStream dst_stream(filename);
if (!dst_stream.Valid()) {
ERROR_LOG(SYSTEM, "Unable to open screenshot file for writing.");
ERROR_LOG(IO, "Unable to open screenshot file for writing.");
return false;
}
jpge::jpeg_encoder dst_image;
if (!dst_image.init(&dst_stream, width, height, num_channels, comp_params)) {
ERROR_LOG(SYSTEM, "Screenshot JPEG encode init failed.");
return false;
}
@@ -85,12 +84,10 @@ static bool WriteScreenshotToJPEG(const char *filename, int width, int height, i
for (int i = 0; i < height; i++) {
const uint8_t *buf = image_data + i * width * num_channels;
if (!dst_image.process_scanline(buf)) {
ERROR_LOG(SYSTEM, "Screenshot JPEG encode scanline failed.");
return false;
}
}
if (!dst_image.process_scanline(NULL)) {
ERROR_LOG(SYSTEM, "Screenshot JPEG encode scanline flush failed.");
return false;
}
}
@@ -106,18 +103,15 @@ static bool WriteScreenshotToJPEG(const char *filename, int width, int height, i
static bool WriteScreenshotToPNG(png_imagep image, const char *filename, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap) {
FILE *fp = File::OpenCFile(filename, "wb");
if (!fp) {
ERROR_LOG(SYSTEM, "Unable to open screenshot file for writing.");
ERROR_LOG(IO, "Unable to open screenshot file for writing.");
return false;
}
if (png_image_write_to_stdio(image, fp, convert_to_8bit, buffer, row_stride, colormap)) {
if (fclose(fp) != 0) {
ERROR_LOG(SYSTEM, "Screenshot file write failed.");
return false;
}
fclose(fp);
return true;
} else {
ERROR_LOG(SYSTEM, "Screenshot PNG encode failed.");
ERROR_LOG(IO, "Screenshot PNG encode failed.");
fclose(fp);
remove(filename);
return false;
@@ -347,7 +341,7 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
delete [] flipbuffer;
if (!success) {
ERROR_LOG(SYSTEM, "Failed to write screenshot.");
ERROR_LOG(IO, "Failed to write screenshot.");
}
return success;
}
@@ -368,7 +362,7 @@ bool Save888RGBScreenshot(const char *filename, ScreenshotFormat fmt, const u8 *
png_image_free(&png);
if (png.warning_or_error >= 2) {
ERROR_LOG(SYSTEM, "Saving screenshot to PNG produced errors.");
ERROR_LOG(IO, "Saving screenshot to PNG produced errors.");
success = false;
}
return success;
@@ -397,7 +391,7 @@ bool Save8888RGBAScreenshot(const char *filename, const u8 *buffer, int w, int h
png_image_free(&png);
if (png.warning_or_error >= 2) {
ERROR_LOG(SYSTEM, "Saving screenshot to PNG produced errors.");
ERROR_LOG(IO, "Saving screenshot to PNG produced errors.");
success = false;
}
return success;
+2 -5
View File
@@ -380,15 +380,12 @@ void TextureReplacer::PopulateReplacement(ReplacedTexture *result, u64 cachekey,
static bool WriteTextureToPNG(png_imagep image, const std::string &filename, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap) {
FILE *fp = File::OpenCFile(filename, "wb");
if (!fp) {
ERROR_LOG(SYSTEM, "Unable to open texture file for writing.");
ERROR_LOG(IO, "Unable to open texture file for writing.");
return false;
}
if (png_image_write_to_stdio(image, fp, convert_to_8bit, buffer, row_stride, colormap)) {
if (fclose(fp) != 0) {
ERROR_LOG(SYSTEM, "Texture file write failed.");
return false;
}
fclose(fp);
return true;
} else {
ERROR_LOG(SYSTEM, "Texture PNG encode failed.");
+1 -1
View File
@@ -601,7 +601,7 @@ bool GameManager::InstallZippedISO(struct zip *z, int isoFileIndex, std::string
std::string outputISOFilename = g_Config.currentDirectory + "/" + fn.substr(nameOffset);
size_t bytesCopied = 0;
if (ExtractFile(z, isoFileIndex, outputISOFilename, &bytesCopied, allBytes)) {
ILOG("Successfully extracted ISO file to '%s'", outputISOFilename.c_str());
INFO_LOG(IO, "Successfully extracted ISO file to '%s'", outputISOFilename.c_str());
}
zip_close(z);
if (deleteAfter) {
+2 -4
View File
@@ -11,9 +11,7 @@
constexpr size_t WaveFileWriter::BUFFER_SIZE;
WaveFileWriter::WaveFileWriter()
{
}
WaveFileWriter::WaveFileWriter() {}
WaveFileWriter::~WaveFileWriter()
{
@@ -30,7 +28,7 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
file.Open(filename, "wb");
if (!file) {
ERROR_LOG(SYSTEM, "The file %s could not be opened for writing. Please check if it's already opened by another program.", filename.c_str());
ERROR_LOG(IO, "The file %s could not be opened for writing. Please check if it's already opened by another program.", filename.c_str());
return false;
}
+2 -1
View File
@@ -887,7 +887,8 @@ void FramebufferManagerCommon::CopyDisplayToOutput(bool reallyDirty) {
if (vfb) {
// Okay, we found one above.
INFO_LOG_REPORT_ONCE(displayoffset, HLE, "Rendering from framebuf with offset %08x -> %08x+%dx%d", addr, vfb->fb_address, offsetX, offsetY);
// Log should be "Displaying from framebuf" but not worth changing the report.
INFO_LOG_REPORT_ONCE(displayoffset, FRAMEBUF, "Rendering from framebuf with offset %08x -> %08x+%dx%d", addr, vfb->fb_address, offsetX, offsetY);
}
}
+7 -7
View File
@@ -34,10 +34,10 @@
#undef free
#endif
#include "base/logging.h"
#include "base/basictypes.h"
#include "base/stringutil.h"
#include "ShaderTranslation.h"
#include "Common/Log.h"
#include "GPU/Common/ShaderTranslation.h"
#include "ext/glslang/SPIRV/GlslangToSpv.h"
#include "thin3d/thin3d.h"
#include "gfx_es2/gpu_features.h"
@@ -211,7 +211,7 @@ bool ConvertToVulkanGLSL(std::string *dest, TranslatedShaderMetadata *destMetada
}
// DUMPLOG(src.c_str());
// ILOG("---->");
// INFO_LOG(SYSTEM, "---->");
// DUMPLOG(LineNumberString(out.str()).c_str());
*dest = out.str();
@@ -252,8 +252,8 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, TranslatedShade
shaderStrings[0] = src.c_str();
shader.setStrings(shaderStrings, 1);
if (!shader.parse(&Resources, 100, EProfile::ECompatibilityProfile, false, false, messages)) {
ELOG("%s", shader.getInfoLog());
ELOG("%s", shader.getInfoDebugLog());
ERROR_LOG(G3D, "%s", shader.getInfoLog());
ERROR_LOG(G3D, "%s", shader.getInfoDebugLog());
if (errorMessage) {
*errorMessage = shader.getInfoLog();
(*errorMessage) += shader.getInfoDebugLog();
@@ -265,8 +265,8 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, TranslatedShade
program.addShader(&shader);
if (!program.link(messages)) {
ELOG("%s", shader.getInfoLog());
ELOG("%s", shader.getInfoDebugLog());
ERROR_LOG(G3D, "%s", shader.getInfoLog());
ERROR_LOG(G3D, "%s", shader.getInfoDebugLog());
if (errorMessage) {
*errorMessage = shader.getInfoLog();
(*errorMessage) += shader.getInfoDebugLog();
+1 -1
View File
@@ -18,8 +18,8 @@
#pragma once
#include <cstring>
#include "base/basictypes.h"
#include "Common/Log.h"
#include "Common/CommonTypes.h"
#include "Core/Reporting.h"
#include "GPU/ge_constants.h"
+1 -1
View File
@@ -16,6 +16,7 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "ppsspp_config.h"
#if PPSSPP_ARCH(ARM)
// This allows highlighting to work. Yay.
@@ -25,7 +26,6 @@
#include <stddef.h>
#include "base/logging.h"
#include "Common/CPUDetect.h"
#include "Core/Config.h"
#include "Core/Reporting.h"
+4 -4
View File
@@ -23,8 +23,8 @@
#define ARM64
#endif
#include "base/logging.h"
#include "Common/CPUDetect.h"
#include "Common/Log.h"
#include "Core/Config.h"
#include "Core/Reporting.h"
#include "Common/Arm64Emitter.h"
@@ -287,12 +287,12 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
if (log) {
char temp[1024] = { 0 };
dec.ToString(temp);
ILOG("=== %s (%d bytes) ===", temp, (int)(GetCodePtr() - start));
INFO_LOG(JIT, "=== %s (%d bytes) ===", temp, (int)(GetCodePtr() - start));
std::vector<std::string> lines = DisassembleArm64(start, (int)(GetCodePtr() - start));
for (auto line : lines) {
ILOG("%s", line.c_str());
INFO_LOG(JIT, "%s", line.c_str());
}
ILOG("==========");
INFO_LOG(JIT, "==========");
}
*jittedSize = (int)(GetCodePtr() - start);
+1 -1
View File
@@ -19,8 +19,8 @@
#include <cstdio>
#include "base/basictypes.h"
#include "base/logging.h"
#include "Common/Log.h"
#include "Common/CPUDetect.h"
#include "Common/ColorConv.h"
#include "Core/Config.h"
+1
View File
@@ -18,6 +18,7 @@
#pragma once
#include <cstring>
#include "ppsspp_config.h"
#include "base/basictypes.h"
#include "Common/Hashmaps.h"
-1
View File
@@ -18,7 +18,6 @@
//TODO: Doesn't build, FIXME!
#if 0
#include "base/logging.h"
#include "Common/CPUDetect.h"
#include "Core/Config.h"
#include "Core/Reporting.h"
+2 -2
View File
@@ -13,10 +13,10 @@
#include "thin3d/d3d11_loader.h"
#endif
#include "base/logging.h"
#include "base/stringutil.h"
#include "D3D11Util.h"
#include "Common/Log.h"
static std::vector<uint8_t> CompileShaderToBytecode(const char *code, size_t codeSize, const char *target, UINT flags) {
ID3DBlob *compiledCode = nullptr;
@@ -25,7 +25,7 @@ static std::vector<uint8_t> CompileShaderToBytecode(const char *code, size_t cod
std::string errors;
if (errorMsgs) {
errors = std::string((const char *)errorMsgs->GetBufferPointer(), errorMsgs->GetBufferSize());
ELOG("%s: %s", SUCCEEDED(result) ? "warnings" : "errors", errors.c_str());
ERROR_LOG(G3D, "%s: %s", SUCCEEDED(result) ? "warnings" : "errors", errors.c_str());
OutputDebugStringA(LineNumberString(code).c_str());
errorMsgs->Release();
}
-1
View File
@@ -19,7 +19,6 @@
#include <d3d11.h>
#include "base/basictypes.h"
#include "base/logging.h"
#include "Common/Log.h"
#include "Common/ColorConv.h"
#include "Common/StringUtils.h"
+1 -1
View File
@@ -17,9 +17,9 @@
#include <algorithm>
#include "base/logging.h"
#include "base/timeutil.h"
#include "Common/Log.h"
#include "Common/MemoryUtil.h"
#include "Core/MemMap.h"
#include "Core/System.h"
+1 -1
View File
@@ -36,10 +36,10 @@
#include <set>
#include "Common/Log.h"
#include "Common/Serialize/Serializer.h"
#include "Common/GraphicsContext.h"
#include "base/NativeApp.h"
#include "base/logging.h"
#include "profiler/profiler.h"
#include "i18n/i18n.h"
#include "Core/Debugger/Breakpoints.h"
+1 -1
View File
@@ -22,12 +22,12 @@
#include <map>
#include "base/logging.h"
#include "math/lin/matrix4x4.h"
#include "math/math_util.h"
#include "math/dataconv.h"
#include "thin3d/thin3d.h"
#include "util/text/utf8.h"
#include "Common/Log.h"
#include "Common/Common.h"
#include "Core/Config.h"
#include "Core/Reporting.h"
+2 -2
View File
@@ -17,9 +17,9 @@
#include <d3d11.h>
#include "base/logging.h"
#include "ext/native/thin3d/thin3d.h"
#include "Common/Log.h"
#include "Core/Reporting.h"
#include "GPU/Common/StencilCommon.h"
#include "GPU/D3D11/FramebufferManagerD3D11.h"
-1
View File
@@ -18,7 +18,6 @@
#include <map>
#include <d3d9.h>
#include "base/logging.h"
#include "thin3d/thin3d.h"
#include "Common/Log.h"
#include "Common/StringUtils.h"
+1 -1
View File
@@ -15,9 +15,9 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include "base/timeutil.h"
#include "Common/Log.h"
#include "Common/MemoryUtil.h"
#include "Core/MemMap.h"
#include "Core/System.h"
-1
View File
@@ -20,7 +20,6 @@
#include "Common/Serialize/Serializer.h"
#include "Common/GraphicsContext.h"
#include "base/NativeApp.h"
#include "base/logging.h"
#include "profiler/profiler.h"
#include "i18n/i18n.h"
#include "Core/Debugger/Breakpoints.h"
+2 -1
View File
@@ -21,8 +21,8 @@
#include <cmath>
#include <map>
#include "gfx/d3d9_shader.h"
#include "base/logging.h"
#include "base/stringutil.h"
#include "i18n/i18n.h"
#include "math/lin/matrix4x4.h"
@@ -32,6 +32,7 @@
#include "util/text/utf8.h"
#include "Common/Common.h"
#include "Common/Log.h"
#include "Core/Config.h"
#include "Core/Host.h"
#include "Core/Reporting.h"
-2
View File
@@ -17,8 +17,6 @@
#include <d3d9.h>
#include "base/logging.h"
#include "gfx/d3d9_state.h"
#include "ext/native/thin3d/thin3d.h"
#include "Core/Reporting.h"
-1
View File
@@ -17,7 +17,6 @@
#include <map>
#include "base/logging.h"
#include "Common/Log.h"
#include "Common/StringUtils.h"
#include "Core/Reporting.h"
-1
View File
@@ -15,7 +15,6 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include "base/timeutil.h"
#include "Common/MemoryUtil.h"
+1 -1
View File
@@ -18,8 +18,8 @@
#include <cstdio>
#include <sstream>
#include "Common/Log.h"
#include "Common/StringUtils.h"
#include "base/logging.h"
#include "gfx_es2/gpu_features.h"
#include "Core/Reporting.h"
#include "Core/Config.h"
+3 -3
View File
@@ -15,10 +15,10 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include "profiler/profiler.h"
#include "i18n/i18n.h"
#include "Common/Log.h"
#include "Common/Serialize/Serializer.h"
#include "Common/FileUtil.h"
#include "Common/GraphicsContext.h"
@@ -310,7 +310,7 @@ void GPU_GLES::BuildReportingInfo() {
}
void GPU_GLES::DeviceLost() {
ILOG("GPU_GLES: DeviceLost");
INFO_LOG(G3D, "GPU_GLES: DeviceLost");
// Simply drop all caches and textures.
// FBOs appear to survive? Or no?
@@ -328,7 +328,7 @@ void GPU_GLES::DeviceLost() {
void GPU_GLES::DeviceRestore() {
draw_ = (Draw::DrawContext *)PSP_CoreParameter().graphicsContext->GetDrawContext();
ILOG("GPU_GLES: DeviceRestore");
INFO_LOG(G3D, "GPU_GLES: DeviceRestore");
UpdateCmdInfo();
UpdateVsyncInterval(true);
+1 -1
View File
@@ -24,7 +24,6 @@
#include <map>
#include "math/dataconv.h"
#include "base/logging.h"
#include "base/timeutil.h"
#include "gfx/gl_debug_log.h"
#include "gfx_es2/gpu_features.h"
@@ -35,6 +34,7 @@
#include "thin3d/thin3d.h"
#include "thin3d/GLRenderManager.h"
#include "Common/Log.h"
#include "Common/FileUtil.h"
#include "Core/Config.h"
#include "Core/Host.h"
+1 -1
View File
@@ -17,12 +17,12 @@
#include <cassert>
#include "base/logging.h"
#include "base/timeutil.h"
#include "math/dataconv.h"
#include "profiler/profiler.h"
#include "thin3d/VulkanRenderManager.h"
#include "Common/Log.h"
#include "Common/MemoryUtil.h"
#include "Core/MemMap.h"
#include "Core/System.h"
+3 -2
View File
@@ -18,9 +18,10 @@
#include <cstdio>
#include <sstream>
#include "Common/StringUtils.h"
#include "base/logging.h"
#include "gfx_es2/gpu_features.h"
#include "Common/Log.h"
#include "Common/StringUtils.h"
#include "Core/Reporting.h"
#include "Core/Config.h"
#include "GPU/Common/GPUStateUtils.h"
+3 -3
View File
@@ -18,10 +18,10 @@
#include <thread>
#include "base/logging.h"
#include "base/timeutil.h"
#include "profiler/profiler.h"
#include "Common/Log.h"
#include "Common/Serialize/Serializer.h"
#include "Common/FileUtil.h"
#include "Common/GraphicsContext.h"
@@ -471,7 +471,7 @@ void GPU_Vulkan::ExecuteOp(u32 op, u32 diff) {
}
void GPU_Vulkan::InitDeviceObjects() {
ILOG("GPU_Vulkan::InitDeviceObjects");
INFO_LOG(G3D, "GPU_Vulkan::InitDeviceObjects");
// Initialize framedata
for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) {
assert(!frameData_[i].push_);
@@ -495,7 +495,7 @@ void GPU_Vulkan::InitDeviceObjects() {
}
void GPU_Vulkan::DestroyDeviceObjects() {
ILOG("GPU_Vulkan::DestroyDeviceObjects");
INFO_LOG(G3D, "GPU_Vulkan::DestroyDeviceObjects");
for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) {
if (frameData_[i].push_) {
frameData_[i].push_->Destroy(vulkan_);
+1 -1
View File
@@ -19,7 +19,6 @@
//#define SHADERLOG
#endif
#include "base/logging.h"
#include "base/stringutil.h"
#include "math/lin/matrix4x4.h"
#include "math/math_util.h"
@@ -27,6 +26,7 @@
#include "profiler/profiler.h"
#include "thin3d/thin3d.h"
#include "util/text/utf8.h"
#include "Common/Vulkan/VulkanContext.h"
#include "Common/Vulkan/VulkanMemory.h"
#include "Common/Log.h"
+2 -2
View File
@@ -15,10 +15,10 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include "ext/native/thin3d/thin3d.h"
#include "ext/native/thin3d/VulkanRenderManager.h"
#include "Common/Log.h"
#include "Core/Reporting.h"
#include "GPU/Common/StencilCommon.h"
#include "GPU/Vulkan/FramebufferManagerVulkan.h"
+15 -15
View File
@@ -71,23 +71,23 @@ static void InitSDLAudioDevice() {
if (!g_Config.sAudioDevice.empty()) {
audioDev = SDL_OpenAudioDevice(g_Config.sAudioDevice.c_str(), 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
if (audioDev <= 0) {
WLOG("Failed to open preferred audio device %s", g_Config.sAudioDevice.c_str());
WARN_LOG(AUDIO, "Failed to open preferred audio device %s", g_Config.sAudioDevice.c_str());
}
}
if (audioDev <= 0) {
audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
}
if (audioDev <= 0) {
ELOG("Failed to open audio: %s", SDL_GetError());
ERROR_LOG(AUDIO, "Failed to open audio: %s", SDL_GetError());
} else {
if (g_retFmt.samples != fmt.samples) // Notify, but still use it
ELOG("Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples);
ERROR_LOG(AUDIO, "Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples);
if (g_retFmt.format != fmt.format || g_retFmt.channels != fmt.channels) {
ELOG("Sound buffer format does not match requested format.");
ELOG("Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq);
ELOG("Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format);
ELOG("Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels);
ELOG("Provided output format does not match requirement, turning audio off");
ERROR_LOG(AUDIO, "Sound buffer format does not match requested format.");
ERROR_LOG(AUDIO, "Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq);
ERROR_LOG(AUDIO, "Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format);
ERROR_LOG(AUDIO, "Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels);
ERROR_LOG(AUDIO, "Provided output format does not match requirement, turning audio off");
SDL_CloseAudioDevice(audioDev);
}
SDL_PauseAudioDevice(audioDev, 0);
@@ -343,9 +343,9 @@ MainUI::MainUI(QWidget *parent)
}
MainUI::~MainUI() {
ILOG("MainUI::Destructor");
INFO_LOG(SYSTEM, "MainUI::Destructor");
if (emuThreadState != (int)EmuThreadState::DISABLED) {
ILOG("EmuThreadStop");
INFO_LOG(SYSTEM, "EmuThreadStop");
EmuThreadStop();
while (graphicsContext->ThreadFrame()) {
// Need to keep eating frames to allow the EmuThread to exit correctly.
@@ -525,7 +525,7 @@ bool MainUI::event(QEvent *e) {
void MainUI::initializeGL() {
if (g_Config.iGPUBackend != (int)GPUBackend::OPENGL) {
ILOG("Only GL supported under Qt - switching.");
INFO_LOG(SYSTEM, "Only GL supported under Qt - switching.");
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
}
@@ -545,12 +545,12 @@ void MainUI::initializeGL() {
#endif
if (g_Config.iGPUBackend == (int)GPUBackend::OPENGL) {
// OpenGL uses a background thread to do the main processing and only renders on the gl thread.
ILOG("Initializing GL graphics context");
INFO_LOG(SYSTEM, "Initializing GL graphics context");
graphicsContext = new QtGLGraphicsContext();
ILOG("Using thread, starting emu thread");
INFO_LOG(SYSTEM, "Using thread, starting emu thread");
EmuThreadStart();
} else {
ILOG("Not using thread, backend=%d", (int)g_Config.iGPUBackend);
INFO_LOG(SYSTEM, "Not using thread, backend=%d", (int)g_Config.iGPUBackend);
}
graphicsContext->ThreadStart();
}
@@ -714,7 +714,7 @@ int main(int argc, char *argv[])
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
int ret = mainInternal(a);
ILOG("Left mainInternal here.");
INFO_LOG(SYSTEM, "Left mainInternal here.");
#ifdef SDL
if (audioDev > 0) {
-1
View File
@@ -23,7 +23,6 @@ QTM_USE_NAMESPACE
#include <thread>
#include "base/display.h"
#include "base/logging.h"
#include "base/timeutil.h"
#include "file/zip_read.h"
#include "gfx/gl_common.h"
-1
View File
@@ -5,7 +5,6 @@
#endif
#import <QuartzCore/CAMetalLayer.h>
#include "base/logging.h"
#include "SDLCocoaMetalLayer.h"
void *makeWindowMetalCompatible(void *window) {
+1 -1
View File
@@ -425,7 +425,7 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode, std:
});
renderManager_->SetSwapIntervalFunction([&](int interval) {
ILOG("SDL SwapInterval: %d", interval);
INFO_LOG(G3D, "SDL SwapInterval: %d", interval);
SDL_GL_SetSwapInterval(interval);
});
window_ = window;
+15 -16
View File
@@ -22,7 +22,6 @@ SDLJoystick *joystick = NULL;
#include <locale>
#include "base/display.h"
#include "base/logging.h"
#include "base/timeutil.h"
#include "ext/glslang/glslang/Public/ShaderLang.h"
#include "image/png_load.h"
@@ -110,24 +109,24 @@ static void InitSDLAudioDevice(const std::string &name = "") {
if (!startDevice.empty()) {
audioDev = SDL_OpenAudioDevice(startDevice.c_str(), 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
if (audioDev <= 0) {
WLOG("Failed to open audio device: %s", startDevice.c_str());
WARN_LOG(AUDIO, "Failed to open audio device: %s", startDevice.c_str());
}
}
if (audioDev <= 0) {
ILOG("SDL: Trying a different audio device");
INFO_LOG(AUDIO, "SDL: Trying a different audio device");
audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &g_retFmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
}
if (audioDev <= 0) {
ELOG("Failed to open audio device: %s", SDL_GetError());
ERROR_LOG(AUDIO, "Failed to open audio device: %s", SDL_GetError());
} else {
if (g_retFmt.samples != fmt.samples) // Notify, but still use it
ELOG("Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples);
ERROR_LOG(AUDIO, "Output audio samples: %d (requested: %d)", g_retFmt.samples, fmt.samples);
if (g_retFmt.format != fmt.format || g_retFmt.channels != fmt.channels) {
ELOG("Sound buffer format does not match requested format.");
ELOG("Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq);
ELOG("Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format);
ELOG("Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels);
ELOG("Provided output format does not match requirement, turning audio off");
ERROR_LOG(AUDIO, "Sound buffer format does not match requested format.");
ERROR_LOG(AUDIO, "Output audio freq: %d (requested: %d)", g_retFmt.freq, fmt.freq);
ERROR_LOG(AUDIO, "Output audio format: %d (requested: %d)", g_retFmt.format, fmt.format);
ERROR_LOG(AUDIO, "Output audio channels: %d (requested: %d)", g_retFmt.channels, fmt.channels);
ERROR_LOG(AUDIO, "Provided output format does not match requirement, turning audio off");
SDL_CloseAudioDevice(audioDev);
}
SDL_PauseAudioDevice(audioDev, 0);
@@ -206,7 +205,7 @@ void LaunchBrowser(const char *url) {
webWifiCreate(&conf, NULL, url, uuid, 0);
webWifiShow(&conf, NULL);
#elif defined(MOBILE_DEVICE)
ILOG("Would have gone to %s but LaunchBrowser is not implemented on this platform", url);
INFO_LOG(SYSTEM, "Would have gone to %s but LaunchBrowser is not implemented on this platform", url);
#elif defined(_WIN32)
std::wstring wurl = ConvertUTF8ToWString(url);
ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL);
@@ -217,7 +216,7 @@ void LaunchBrowser(const char *url) {
std::string command = std::string("xdg-open ") + url;
int err = system(command.c_str());
if (err) {
ILOG("Would have gone to %s but xdg-utils seems not to be installed", url)
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", url);
}
#endif
}
@@ -229,7 +228,7 @@ void LaunchMarket(const char *url) {
webWifiCreate(&conf, NULL, url, uuid, 0);
webWifiShow(&conf, NULL);
#elif defined(MOBILE_DEVICE)
ILOG("Would have gone to %s but LaunchMarket is not implemented on this platform", url);
INFO_LOG(SYSTEM, "Would have gone to %s but LaunchMarket is not implemented on this platform", url);
#elif defined(_WIN32)
std::wstring wurl = ConvertUTF8ToWString(url);
ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL);
@@ -240,14 +239,14 @@ void LaunchMarket(const char *url) {
std::string command = std::string("xdg-open ") + url;
int err = system(command.c_str());
if (err) {
ILOG("Would have gone to %s but xdg-utils seems not to be installed", url)
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", url);
}
#endif
}
void LaunchEmail(const char *email_address) {
#if defined(MOBILE_DEVICE)
ILOG("Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address);
INFO_LOG(SYSTEM, "Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address);
#elif defined(_WIN32)
std::wstring mailto = std::wstring(L"mailto:") + ConvertUTF8ToWString(email_address);
ShellExecute(NULL, L"open", mailto.c_str(), NULL, NULL, SW_SHOWNORMAL);
@@ -258,7 +257,7 @@ void LaunchEmail(const char *email_address) {
std::string command = std::string("xdg-email ") + email_address;
int err = system(command.c_str());
if (err) {
ILOG("Would have gone to %s but xdg-utils seems not to be installed", email_address)
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", email_address);
}
#endif
}
+8 -8
View File
@@ -1,12 +1,12 @@
#include <string>
#include <mutex>
#include "base/logging.h"
#include "base/timeutil.h"
#include "file/chunk_file.h"
#include "file/vfs.h"
#include "ui/root.h"
#include "Common/Log.h"
#include "Common/Serialize/SerializeFuncs.h"
#include "Common/CommonTypes.h"
#include "Common/FixedSizeQueue.h"
@@ -84,9 +84,9 @@ void WavData::Read(RIFFReader &file_) {
}
}
file_.Ascend();
// ILOG("got fmt data: %i", samplesPerSec);
// INFO_LOG(AUDIO, "got fmt data: %i", samplesPerSec);
} else {
ELOG("Error - no format chunk in wav");
ERROR_LOG(AUDIO, "Error - no format chunk in wav");
file_.Ascend();
return;
}
@@ -142,20 +142,20 @@ void WavData::Read(RIFFReader &file_) {
if (num_channels == 1 || num_channels == 2) {
file_.ReadData(raw_data, numBytes);
} else {
ELOG("Error - bad blockalign or channels");
ERROR_LOG(AUDIO, "Error - bad blockalign or channels");
free(raw_data);
raw_data = nullptr;
return;
}
file_.Ascend();
} else {
ELOG("Error - no data chunk in wav");
ERROR_LOG(AUDIO, "Error - no data chunk in wav");
file_.Ascend();
return;
}
file_.Ascend();
} else {
ELOG("Could not descend into RIFF file.");
ERROR_LOG(AUDIO, "Could not descend into RIFF file.");
return;
}
sample_rate = samplesPerSec;
@@ -178,7 +178,7 @@ public:
if (wave_.codec == PSP_CODEC_AT3) {
decoder_->SetExtraData(&wave_.at3_extradata[2], 14, wave_.raw_bytes_per_frame);
}
ILOG("read ATRAC, frames: %d, rate %d", wave_.numFrames, wave_.sample_rate);
INFO_LOG(AUDIO, "read ATRAC, frames: %d, rate %d", wave_.numFrames, wave_.sample_rate);
}
~AT3PlusReader() {
@@ -269,7 +269,7 @@ BackgroundAudio::Sample *BackgroundAudio::LoadSample(const std::string &path) {
delete [] data;
if (wave.num_channels != 2 || wave.sample_rate != 44100 || wave.raw_bytes_per_frame != 4) {
ELOG("Wave format not supported for mixer playback. Must be 16-bit raw stereo. '%s'", path.c_str());
ERROR_LOG(AUDIO, "Wave format not supported for mixer playback. Must be 16-bit raw stereo. '%s'", path.c_str());
return nullptr;
}
+4 -4
View File
@@ -20,7 +20,6 @@
#include <mutex>
#include "base/colorutil.h"
#include "base/logging.h"
#include "base/display.h"
#include "gfx/texture_atlas.h"
#include "i18n/i18n.h"
@@ -35,6 +34,7 @@
#include "Core/Host.h"
#include "Core/HLE/sceCtrl.h"
#include "Core/System.h"
#include "Common/Log.h"
#include "Common/KeyMap.h"
#include "Core/Config.h"
#include "UI/ControlMappingScreen.h"
@@ -582,7 +582,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) {
bool found = false;
for (int i = 0; i < MAX_TOUCH_POINTS; i++) {
if (touches_[i].id == touch.id) {
WLOG("Double touch");
WARN_LOG(SYSTEM, "Double touch");
touches_[i].x = touch.x;
touches_[i].y = touch.y;
found = true;
@@ -609,7 +609,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) {
}
}
if (!found) {
WLOG("Move without touch down: %d", touch.id);
WARN_LOG(SYSTEM, "Move without touch down: %d", touch.id);
}
}
if (touch.flags & TOUCH_UP) {
@@ -622,7 +622,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) {
}
}
if (!found) {
WLOG("Touch release without touch down");
WARN_LOG(SYSTEM, "Touch release without touch down");
}
}
return true;
+1
View File
@@ -16,6 +16,7 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <algorithm>
#include "ui/ui_context.h"
#include "UI/DisplayLayoutEditor.h"
+4 -4
View File
@@ -20,7 +20,6 @@
#include <algorithm>
#include "base/display.h"
#include "base/logging.h"
#include "base/timeutil.h"
#include "profiler/profiler.h"
@@ -38,6 +37,7 @@
#include "i18n/i18n.h"
#include "Common/KeyMap.h"
#include "Common/Log.h"
#ifndef MOBILE_DEVICE
#include "Core/AVIDump.h"
@@ -404,7 +404,7 @@ void EmuScreen::sendMessage(const char *message, const char *value) {
std::string resetError;
if (!PSP_InitStart(PSP_CoreParameter(), &resetError)) {
ELOG("Error resetting: %s", resetError.c_str());
ERROR_LOG(LOADER, "Error resetting: %s", resetError.c_str());
stopRender_ = true;
screenManager()->switchScreen(new MainScreen());
System_SendMessage("event", "failstartgame");
@@ -856,7 +856,7 @@ void EmuScreen::pspKey(int pspKeyCode, int flags) {
onVKeyUp(pspKeyCode);
}
} else {
// ILOG("pspKey %i %i", pspKeyCode, flags);
// INFO_LOG(SYSTEM, "pspKey %i %i", pspKeyCode, flags);
if (flags & KEY_DOWN)
__CtrlButtonDown(pspKeyCode);
if (flags & KEY_UP)
@@ -1231,7 +1231,7 @@ void EmuScreen::checkPowerDown() {
if (PSP_IsInited()) {
PSP_Shutdown();
}
ILOG("SELF-POWERDOWN!");
INFO_LOG(SYSTEM, "SELF-POWERDOWN!");
screenManager()->switchScreen(new MainScreen());
bootPending_ = false;
invalid_ = true;
+2 -2
View File
@@ -22,13 +22,13 @@
#include <memory>
#include <algorithm>
#include "base/logging.h"
#include "base/timeutil.h"
#include "base/stringutil.h"
#include "file/file_util.h"
#include "file/zip_read.h"
#include "thin3d/thin3d.h"
#include "thread/prioritizedworkqueue.h"
#include "Common/FileUtil.h"
#include "Common/StringUtils.h"
#include "Core/FileSystems/ISOFileSystem.h"
@@ -634,7 +634,7 @@ handleELF:
info_->pending = false;
info_->working = false;
// ILOG("Completed writing info for %s", info_->GetTitle().c_str());
// INFO_LOG(SYSTEM, "Completed writing info for %s", info_->GetTitle().c_str());
}
float priority() override {
+5 -5
View File
@@ -998,19 +998,19 @@ UI::EventReturn GameSettingsScreen::OnHardwareTransform(UI::EventParams &e) {
}
UI::EventReturn GameSettingsScreen::OnScreenRotation(UI::EventParams &e) {
ILOG("New display rotation: %d", g_Config.iScreenRotation);
ILOG("Sending rotate");
INFO_LOG(SYSTEM, "New display rotation: %d", g_Config.iScreenRotation);
INFO_LOG(SYSTEM, "Sending rotate");
System_SendMessage("rotate", "");
ILOG("Got back from rotate");
INFO_LOG(SYSTEM, "Got back from rotate");
return UI::EVENT_DONE;
}
void RecreateActivity() {
const int SYSTEM_JELLYBEAN = 16;
if (System_GetPropertyInt(SYSPROP_SYSTEMVERSION) >= SYSTEM_JELLYBEAN) {
ILOG("Sending recreate");
INFO_LOG(SYSTEM, "Sending recreate");
System_SendMessage("recreate", "");
ILOG("Got back from recreate");
INFO_LOG(SYSTEM, "Got back from recreate");
} else {
auto gr = GetI18NCategory("Graphics");
System_SendMessage("toast", gr->T("Must Restart", "You must restart PPSSPP for this change to take effect"));
-1
View File
@@ -15,7 +15,6 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/logging.h"
#include "i18n/i18n.h"
#include "ui/ui.h"
#include "ui/view.h"
+40 -36
View File
@@ -44,7 +44,6 @@
#endif
#include "base/display.h"
#include "base/logging.h"
#include "base/stringutil.h"
#include "base/timeutil.h"
#include "base/NativeApp.h"
@@ -68,12 +67,16 @@
#include "ui/view.h"
#include "util/text/utf8.h"
#include "android/jni/app-android.h"
#include "Common/CPUDetect.h"
#include "Common/FileUtil.h"
#include "Common/KeyMap.h"
#include "Common/LogManager.h"
#include "Common/MemArena.h"
#include "Common/GraphicsContext.h"
#include "Common/OSVersion.h"
#include "Core/Config.h"
#include "Core/ConfigValues.h"
#include "Core/Core.h"
@@ -91,8 +94,8 @@
#include "Core/Util/GameManager.h"
#include "Core/Util/AudioFormat.h"
#include "Core/WebServer.h"
#include "GPU/GPUInterface.h"
#include "GPU/GPUInterface.h"
#include "UI/BackgroundAudio.h"
#include "UI/ControlMappingScreen.h"
#include "UI/DiscordIntegration.h"
@@ -106,10 +109,6 @@
#include "UI/TiltEventProcessor.h"
#include "UI/TextureUtil.h"
#if !defined(MOBILE_DEVICE)
#include "Common/KeyMap.h"
#endif
#if !defined(MOBILE_DEVICE) && defined(USING_QT_UI)
#include "Qt/QtHost.h"
#endif
@@ -181,7 +180,7 @@ WindowsAudioBackend *winAudioBackend;
std::thread *graphicsLoadThread;
class AndroidLogger : public LogListener {
class PrintfLogger : public LogListener {
public:
void Log(const LogMessage &message) override {
// Log with simplified headers as Android already provides timestamp etc.
@@ -189,17 +188,17 @@ public:
case LogTypes::LVERBOSE:
case LogTypes::LDEBUG:
case LogTypes::LINFO:
ILOG("[%s] %s", message.log, message.msg.c_str());
printf("INFO [%s] %s", message.log, message.msg.c_str());
break;
case LogTypes::LERROR:
ELOG("[%s] %s", message.log, message.msg.c_str());
printf("ERR [%s] %s", message.log, message.msg.c_str());
break;
case LogTypes::LWARNING:
WLOG("[%s] %s", message.log, message.msg.c_str());
printf("WARN [%s] %s", message.log, message.msg.c_str());
break;
case LogTypes::LNOTICE:
default:
ILOG("[%s] !!! %s", message.log, message.msg.c_str());
printf("NOTE [%s] !!! %s", message.log, message.msg.c_str());
break;
}
}
@@ -212,7 +211,7 @@ int Win32Mix(short *buffer, int numSamples, int bits, int rate, int channels) {
#endif
// globals
static AndroidLogger *logger = nullptr;
static LogListener *logger = nullptr;
std::string boot_filename = "";
void NativeHost::InitSound() {
@@ -235,7 +234,7 @@ void QtHost::ShutdownSound() { }
std::string NativeQueryConfig(std::string query) {
char temp[128];
if (query == "screenRotation") {
ILOG("g_Config.screenRotation = %d", g_Config.iScreenRotation);
INFO_LOG(G3D, "g_Config.screenRotation = %d", g_Config.iScreenRotation);
snprintf(temp, sizeof(temp), "%d", g_Config.iScreenRotation);
return std::string(temp);
} else if (query == "immersiveMode") {
@@ -355,7 +354,7 @@ static void PostLoadConfig() {
void CreateDirectoriesAndroid() {
// On Android, create a PSP directory tree in the external_dir,
// to hopefully reduce confusion a bit.
ILOG("Creating %s", (g_Config.memStickDirectory + "PSP").c_str());
INFO_LOG(IO, "Creating %s", (g_Config.memStickDirectory + "PSP").c_str());
File::CreateFullPath(g_Config.memStickDirectory + "PSP");
File::CreateFullPath(GetSysDirectory(DIRECTORY_SAVEDATA));
File::CreateFullPath(GetSysDirectory(DIRECTORY_SAVESTATE));
@@ -529,7 +528,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
}
if (!LogManager::GetInstance())
LogManager::Init();
LogManager::Init(&g_Config.bEnableLogging);
#ifndef _WIN32
g_Config.AddSearchPath(user_data_path);
@@ -606,21 +605,21 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
// don't already have one.
if (!gotBootFilename) {
gotBootFilename = true;
ILOG("Boot filename found in args: '%s'", argv[i]);
INFO_LOG(SYSTEM, "Boot filename found in args: '%s'", argv[i]);
bool okToLoad = true;
bool okToCheck = true;
if (System_GetPropertyBool(SYSPROP_SUPPORTS_PERMISSIONS)) {
PermissionStatus status = System_GetPermissionStatus(SYSTEM_PERMISSION_STORAGE);
if (status == PERMISSION_STATUS_DENIED) {
ELOG("Storage permission denied. Launching without argument.");
ERROR_LOG(IO, "Storage permission denied. Launching without argument.");
okToLoad = false;
okToCheck = false;
} else if (status != PERMISSION_STATUS_GRANTED) {
ELOG("Storage permission not granted. Launching without argument check.");
ERROR_LOG(IO, "Storage permission not granted. Launching without argument check.");
okToCheck = false;
} else {
ILOG("Storage permission granted.");
INFO_LOG(IO, "Storage permission granted.");
}
}
if (okToLoad) {
@@ -659,10 +658,13 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
PostLoadConfig();
#if defined(__ANDROID__) || (defined(MOBILE_DEVICE) && !defined(_DEBUG))
#if PPSSPP_PLATFORM(ANDROID)
logger = new AndroidLogger();
logman->AddListener(logger);
#elif (defined(MOBILE_DEVICE) && !defined(_DEBUG))
// Enable basic logging for any kind of mobile device, since LogManager doesn't.
// The MOBILE_DEVICE/_DEBUG condition matches LogManager.cpp.
logger = new AndroidLogger();
logger = new PrintfLogger();
logman->AddListener(logger);
#endif
@@ -810,7 +812,7 @@ void RenderOverlays(UIContext *dc, void *userdata);
bool CreateGlobalPipelines();
bool NativeInitGraphics(GraphicsContext *graphicsContext) {
ILOG("NativeInitGraphics");
INFO_LOG(SYSTEM, "NativeInitGraphics");
// We set this now so any resize during init is processed later.
resized = false;
@@ -879,7 +881,7 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
gpu->DeviceRestore();
}
ILOG("NativeInitGraphics completed");
INFO_LOG(SYSTEM, "NativeInitGraphics completed");
return true;
}
@@ -929,7 +931,7 @@ void NativeShutdownGraphics() {
if (gpu)
gpu->DeviceLost();
ILOG("NativeShutdownGraphics");
INFO_LOG(SYSTEM, "NativeShutdownGraphics");
#if PPSSPP_PLATFORM(WINDOWS)
delete winAudioBackend;
@@ -971,7 +973,7 @@ void NativeShutdownGraphics() {
texColorPipeline = nullptr;
}
ILOG("NativeShutdownGraphics done");
INFO_LOG(SYSTEM, "NativeShutdownGraphics done");
}
void TakeScreenshot() {
@@ -1088,7 +1090,7 @@ void NativeRender(GraphicsContext *graphicsContext) {
}
if (resized) {
ILOG("Resized flag set - recalculating bounds");
INFO_LOG(G3D, "Resized flag set - recalculating bounds");
resized = false;
if (uiContext) {
@@ -1117,7 +1119,7 @@ void NativeRender(GraphicsContext *graphicsContext) {
NativeMessageReceived("gpu_resized", "");
#endif
} else {
// ILOG("Polling graphics context");
// INFO_LOG(G3D, "Polling graphics context");
graphicsContext->Poll();
}
@@ -1177,7 +1179,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) {
// Ideally we should simply reinitialize graphics to the mode from the config, but there are potential issues
// and I can't risk it before 1.9.0.
int gpuBackend = g_Config.iGPUBackend;
ILOG("Reloading config after storage permission grant.");
INFO_LOG(IO, "Reloading config after storage permission grant.");
g_Config.Reload();
PostLoadConfig();
g_Config.iGPUBackend = gpuBackend;
@@ -1216,16 +1218,16 @@ void NativeUpdate() {
bool NativeIsAtTopLevel() {
// This might need some synchronization?
if (!screenManager) {
ELOG("No screen manager active");
ERROR_LOG(SYSTEM, "No screen manager active");
return false;
}
Screen *currentScreen = screenManager->topScreen();
if (currentScreen) {
bool top = currentScreen->isTopLevel();
ILOG("Screen toplevel: %i", (int)top);
INFO_LOG(SYSTEM, "Screen toplevel: %i", (int)top);
return currentScreen->isTopLevel();
} else {
ELOG("No current screen");
ERROR_LOG(SYSTEM, "No current screen");
return false;
}
}
@@ -1244,7 +1246,7 @@ bool NativeTouch(const TouchInput &touch) {
}
bool NativeKey(const KeyInput &key) {
// ILOG("Key code: %i flags: %i", key.keyCode, key.flags);
// INFO_LOG(SYSTEM, "Key code: %i flags: %i", key.keyCode, key.flags);
#if !defined(MOBILE_DEVICE)
if (g_Config.bPauseExitsEmulator) {
static std::vector<int> pspKeys;
@@ -1362,7 +1364,7 @@ void NativeInputBoxReceived(std::function<void(bool, const std::string &)> cb, b
void NativeResized() {
// NativeResized can come from any thread so we just set a flag, then process it later.
ILOG("NativeResized - setting flag");
INFO_LOG(G3D, "NativeResized - setting flag");
resized = true;
}
@@ -1396,7 +1398,7 @@ void NativeShutdown() {
moncleanup();
#endif
ILOG("NativeShutdown called");
INFO_LOG(SYSTEM, "NativeShutdown called");
ShutdownWebServer();
@@ -1406,8 +1408,10 @@ void NativeShutdown() {
g_Discord.Shutdown();
delete logger;
logger = nullptr;
if (logger) {
delete logger;
logger = nullptr;
}
// Previously we did exit() here on Android but that makes it hard to do things like restart on backend change.
// I think we handle most globals correctly or correct-enough now.
+2 -2
View File
@@ -370,7 +370,7 @@ void StoreScreen::update() {
RecreateViews();
} else {
// Failed to contact store. Don't do anything.
ELOG("Download failed : error code %d", listing_->ResultCode());
ERROR_LOG(IO, "Download failed : error code %d", listing_->ResultCode());
connectionError_ = true;
loading_ = false;
RecreateViews();
@@ -398,7 +398,7 @@ void StoreScreen::ParseListing(std::string json) {
using namespace json;
JsonReader reader(json.c_str(), json.size());
if (!reader.ok() || !reader.root()) {
ELOG("Error parsing JSON from store");
ERROR_LOG(IO, "Error parsing JSON from store");
connectionError_ = true;
RecreateViews();
return;
+10 -10
View File
@@ -43,7 +43,7 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty
type = DetectImageFileType(data, size);
}
if (type == TYPE_UNKNOWN) {
ELOG("File (size: %d) has unknown format", (int)size);
ERROR_LOG(G3D, "File (size: %d) has unknown format", (int)size);
return false;
}
@@ -63,11 +63,11 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty
*num_levels = 1;
*fmt = Draw::DataFormat::R8G8B8A8_UNORM;
if (!image[0]) {
ELOG("WTF");
ERROR_LOG(IO, "WTF");
return false;
}
} else {
ELOG("PNG load failed");
ERROR_LOG(IO, "PNG load failed");
return false;
}
break;
@@ -85,7 +85,7 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty
break;
default:
ELOG("Unsupported image format %d", (int)type);
ERROR_LOG(IO, "Unsupported image format %d", (int)type);
return false;
}
@@ -111,7 +111,7 @@ bool ManagedTexture::LoadFromFileData(const uint8_t *data, size_t dataSize, Imag
}
if (num_levels < 0 || num_levels >= 16) {
ELOG("Invalid num_levels: %d. Falling back to one. Image: %dx%d", num_levels, width[0], height[0]);
ERROR_LOG(IO, "Invalid num_levels: %d. Falling back to one. Image: %dx%d", num_levels, width[0], height[0]);
num_levels = 1;
}
@@ -149,7 +149,7 @@ bool ManagedTexture::LoadFromFile(const std::string &filename, ImageFileType typ
uint8_t *buffer = VFSReadFile(filename.c_str(), &fileSize);
if (!buffer) {
filename_ = "";
ELOG("Failed to read file '%s'", filename.c_str());
ERROR_LOG(IO, "Failed to read file '%s'", filename.c_str());
return false;
}
bool retval = LoadFromFileData(buffer, fileSize, type, generateMips, filename.c_str());
@@ -157,7 +157,7 @@ bool ManagedTexture::LoadFromFile(const std::string &filename, ImageFileType typ
filename_ = filename;
} else {
filename_ = "";
ELOG("Failed to load texture '%s'", filename.c_str());
ERROR_LOG(IO, "Failed to load texture '%s'", filename.c_str());
}
delete[] buffer;
return retval;
@@ -176,14 +176,14 @@ std::unique_ptr<ManagedTexture> CreateTextureFromFile(Draw::DrawContext *draw, c
}
void ManagedTexture::DeviceLost() {
ILOG("ManagedTexture::DeviceLost(%s)", filename_.c_str());
INFO_LOG(G3D, "ManagedTexture::DeviceLost(%s)", filename_.c_str());
if (texture_)
texture_->Release();
texture_ = nullptr;
}
void ManagedTexture::DeviceRestored(Draw::DrawContext *draw) {
ILOG("ManagedTexture::DeviceRestored(%s)", filename_.c_str());
INFO_LOG(G3D, "ManagedTexture::DeviceRestored(%s)", filename_.c_str());
_assert_(!texture_);
draw_ = draw;
// Vulkan: Can't load textures before the first frame has started.
@@ -194,7 +194,7 @@ void ManagedTexture::DeviceRestored(Draw::DrawContext *draw) {
Draw::Texture *ManagedTexture::GetTexture() {
if (loadPending_) {
if (!LoadFromFile(filename_, ImageFileType::DETECT, generateMips_)) {
ELOG("ManagedTexture failed: '%s'", filename_.c_str());
ERROR_LOG(IO, "ManagedTexture failed: '%s'", filename_.c_str());
}
loadPending_ = false;
}
+3 -4
View File
@@ -1,11 +1,10 @@
#define _USE_MATH_DEFINES
#include <cmath>
#include "UI/TiltEventProcessor.h"
#include "Core/Config.h"
#include "Core/HLE/sceCtrl.h"
#include "math.h"
#include "base/logging.h"
#include "UI/TiltEventProcessor.h"
using namespace TiltEventProcessor;
+1 -1
View File
@@ -448,7 +448,7 @@ UI::EventReturn TouchControlLayoutScreen::OnVisibility(UI::EventParams &e) {
}
UI::EventReturn TouchControlLayoutScreen::OnReset(UI::EventParams &e) {
ILOG("Resetting touch control layout");
INFO_LOG(G3D, "Resetting touch control layout");
g_Config.ResetControlLayout();
const Bounds &bounds = screenManager()->getUIContext()->GetBounds();
InitPadLayout(bounds.w, bounds.h);
-2
View File
@@ -385,7 +385,6 @@
<ClInclude Include="..\..\ext\native\base\colorutil.h" />
<ClInclude Include="..\..\ext\native\base\display.h" />
<ClInclude Include="..\..\ext\native\base\linked_ptr.h" />
<ClInclude Include="..\..\ext\native\base\logging.h" />
<ClInclude Include="..\..\ext\native\base\NativeApp.h" />
<ClInclude Include="..\..\ext\native\base\NKCodeFromQt.h" />
<ClInclude Include="..\..\ext\native\base\NKCodeFromSDL.h" />
@@ -479,7 +478,6 @@
<ClCompile Include="..\..\ext\native\base\buffer.cpp" />
<ClCompile Include="..\..\ext\native\base\colorutil.cpp" />
<ClCompile Include="..\..\ext\native\base\display.cpp" />
<ClCompile Include="..\..\ext\native\base\logging.cpp" />
<ClCompile Include="..\..\ext\native\base\stringutil.cpp" />
<ClCompile Include="..\..\ext\native\base\timeutil.cpp" />
<ClCompile Include="..\..\ext\native\data\base64.cpp" />
Loaded 100 of 191 files, more files were not shown because too many files have changed in this diff. Show more