Remove base/logging.h in a whole lot more places.

This commit is contained in:
Henrik Rydgård 2020-08-15 16:13:24 +02:00
parent 5eb13378c6
commit c41f875df4
36 changed files with 136 additions and 127 deletions

View file

@ -527,7 +527,7 @@ static int DefaultInternalResolution() {
#else #else
int longestDisplaySide = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES)); int longestDisplaySide = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES));
int scale = longestDisplaySide >= 1000 ? 2 : 1; 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; return scale;
#endif #endif
} }

View file

@ -190,7 +190,7 @@ bool UpdateScreenScale(int width, int height) {
dp_yres = new_dp_yres; dp_yres = new_dp_yres;
pixel_xres = width; pixel_xres = width;
pixel_yres = height; 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(); NativeResized();
return true; return true;
} }

View file

@ -62,13 +62,13 @@ void DisassembleArm(const u8 *data, int size) {
int reg1 = (next & 0x0000F000) >> 12; int reg1 = (next & 0x0000F000) >> 12;
if (reg0 == reg1) { if (reg0 == reg1) {
sprintf(temp, "%08x MOV32 %s, %04x%04x", (u32)inst, ArmRegName(reg0), hi, low); 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; i += 4;
continue; continue;
} }
} }
ArmDis((u32)codePtr, inst, temp, sizeof(temp), true); ArmDis((u32)codePtr, inst, temp, sizeof(temp), true);
ILOG("A: %s", temp); INFO_LOG(JIT, "A: %s", temp);
} }
} }

View file

@ -400,7 +400,7 @@ void Arm64RegCacheFPU::FlushAll() {
if (ar[a].isDirty) { if (ar[a].isDirty) {
if (m == -1) { if (m == -1) {
INFO_LOG(JIT, "ARM reg %i is dirty but has no mipsreg", a); INFO_LOG(JIT, "ARM reg %d is dirty but has no mipsreg", a);
continue; continue;
} }
@ -423,7 +423,7 @@ void Arm64RegCacheFPU::FlushAll() {
// Sanity check // Sanity check
for (int i = 0; i < numARMFpuReg_; i++) { for (int i = 0; i < numARMFpuReg_; i++) {
if (ar[i].mipsReg != -1) { 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; pendingFlush = false;

View file

@ -252,8 +252,8 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, TranslatedShade
shaderStrings[0] = src.c_str(); shaderStrings[0] = src.c_str();
shader.setStrings(shaderStrings, 1); shader.setStrings(shaderStrings, 1);
if (!shader.parse(&Resources, 100, EProfile::ECompatibilityProfile, false, false, messages)) { if (!shader.parse(&Resources, 100, EProfile::ECompatibilityProfile, false, false, messages)) {
ELOG("%s", shader.getInfoLog()); ERROR_LOG(G3D, "%s", shader.getInfoLog());
ELOG("%s", shader.getInfoDebugLog()); ERROR_LOG(G3D, "%s", shader.getInfoDebugLog());
if (errorMessage) { if (errorMessage) {
*errorMessage = shader.getInfoLog(); *errorMessage = shader.getInfoLog();
(*errorMessage) += shader.getInfoDebugLog(); (*errorMessage) += shader.getInfoDebugLog();
@ -265,8 +265,8 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, TranslatedShade
program.addShader(&shader); program.addShader(&shader);
if (!program.link(messages)) { if (!program.link(messages)) {
ELOG("%s", shader.getInfoLog()); ERROR_LOG(G3D, "%s", shader.getInfoLog());
ELOG("%s", shader.getInfoDebugLog()); ERROR_LOG(G3D, "%s", shader.getInfoDebugLog());
if (errorMessage) { if (errorMessage) {
*errorMessage = shader.getInfoLog(); *errorMessage = shader.getInfoLog();
(*errorMessage) += shader.getInfoDebugLog(); (*errorMessage) += shader.getInfoDebugLog();

View file

@ -23,6 +23,7 @@
#include <map> #include <map>
#include "gfx/d3d9_shader.h" #include "gfx/d3d9_shader.h"
#include "base/logging.h" // For OutputDebugStringUTF8
#include "base/stringutil.h" #include "base/stringutil.h"
#include "i18n/i18n.h" #include "i18n/i18n.h"
#include "math/lin/matrix4x4.h" #include "math/lin/matrix4x4.h"
@ -32,6 +33,7 @@
#include "util/text/utf8.h" #include "util/text/utf8.h"
#include "Common/Common.h" #include "Common/Common.h"
#include "Common/Log.h"
#include "Core/Config.h" #include "Core/Config.h"
#include "Core/Host.h" #include "Core/Host.h"
#include "Core/Reporting.h" #include "Core/Reporting.h"

View file

@ -17,6 +17,7 @@
#include <d3d9.h> #include <d3d9.h>
#include "base/logging.h" // For OutputDebugStringUTF8
#include "gfx/d3d9_state.h" #include "gfx/d3d9_state.h"
#include "ext/native/thin3d/thin3d.h" #include "ext/native/thin3d/thin3d.h"
#include "Core/Reporting.h" #include "Core/Reporting.h"

View file

@ -310,7 +310,7 @@ void GPU_GLES::BuildReportingInfo() {
} }
void GPU_GLES::DeviceLost() { void GPU_GLES::DeviceLost() {
ILOG("GPU_GLES: DeviceLost"); INFO_LOG(G3D, "GPU_GLES: DeviceLost");
// Simply drop all caches and textures. // Simply drop all caches and textures.
// FBOs appear to survive? Or no? // FBOs appear to survive? Or no?
@ -328,7 +328,7 @@ void GPU_GLES::DeviceLost() {
void GPU_GLES::DeviceRestore() { void GPU_GLES::DeviceRestore() {
draw_ = (Draw::DrawContext *)PSP_CoreParameter().graphicsContext->GetDrawContext(); draw_ = (Draw::DrawContext *)PSP_CoreParameter().graphicsContext->GetDrawContext();
ILOG("GPU_GLES: DeviceRestore"); INFO_LOG(G3D, "GPU_GLES: DeviceRestore");
UpdateCmdInfo(); UpdateCmdInfo();
UpdateVsyncInterval(true); UpdateVsyncInterval(true);

View file

@ -471,7 +471,7 @@ void GPU_Vulkan::ExecuteOp(u32 op, u32 diff) {
} }
void GPU_Vulkan::InitDeviceObjects() { void GPU_Vulkan::InitDeviceObjects() {
ILOG("GPU_Vulkan::InitDeviceObjects"); INFO_LOG(G3D, "GPU_Vulkan::InitDeviceObjects");
// Initialize framedata // Initialize framedata
for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) { for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) {
assert(!frameData_[i].push_); assert(!frameData_[i].push_);
@ -495,7 +495,7 @@ void GPU_Vulkan::InitDeviceObjects() {
} }
void GPU_Vulkan::DestroyDeviceObjects() { void GPU_Vulkan::DestroyDeviceObjects() {
ILOG("GPU_Vulkan::DestroyDeviceObjects"); INFO_LOG(G3D, "GPU_Vulkan::DestroyDeviceObjects");
for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) { for (int i = 0; i < VulkanContext::MAX_INFLIGHT_FRAMES; i++) {
if (frameData_[i].push_) { if (frameData_[i].push_) {
frameData_[i].push_->Destroy(vulkan_); frameData_[i].push_->Destroy(vulkan_);

View file

@ -5,7 +5,6 @@
#endif #endif
#import <QuartzCore/CAMetalLayer.h> #import <QuartzCore/CAMetalLayer.h>
#include "base/logging.h"
#include "SDLCocoaMetalLayer.h" #include "SDLCocoaMetalLayer.h"
void *makeWindowMetalCompatible(void *window) { void *makeWindowMetalCompatible(void *window) {

View file

@ -84,9 +84,9 @@ void WavData::Read(RIFFReader &file_) {
} }
} }
file_.Ascend(); file_.Ascend();
// ILOG("got fmt data: %i", samplesPerSec); // INFO_LOG(AUDIO, "got fmt data: %i", samplesPerSec);
} else { } else {
ELOG("Error - no format chunk in wav"); ERROR_LOG(AUDIO, "Error - no format chunk in wav");
file_.Ascend(); file_.Ascend();
return; return;
} }
@ -142,20 +142,20 @@ void WavData::Read(RIFFReader &file_) {
if (num_channels == 1 || num_channels == 2) { if (num_channels == 1 || num_channels == 2) {
file_.ReadData(raw_data, numBytes); file_.ReadData(raw_data, numBytes);
} else { } else {
ELOG("Error - bad blockalign or channels"); ERROR_LOG(AUDIO, "Error - bad blockalign or channels");
free(raw_data); free(raw_data);
raw_data = nullptr; raw_data = nullptr;
return; return;
} }
file_.Ascend(); file_.Ascend();
} else { } else {
ELOG("Error - no data chunk in wav"); ERROR_LOG(AUDIO, "Error - no data chunk in wav");
file_.Ascend(); file_.Ascend();
return; return;
} }
file_.Ascend(); file_.Ascend();
} else { } else {
ELOG("Could not descend into RIFF file."); ERROR_LOG(AUDIO, "Could not descend into RIFF file.");
return; return;
} }
sample_rate = samplesPerSec; sample_rate = samplesPerSec;
@ -269,7 +269,7 @@ BackgroundAudio::Sample *BackgroundAudio::LoadSample(const std::string &path) {
delete [] data; delete [] data;
if (wave.num_channels != 2 || wave.sample_rate != 44100 || wave.raw_bytes_per_frame != 4) { 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; return nullptr;
} }

View file

@ -34,6 +34,7 @@
#include "Core/Host.h" #include "Core/Host.h"
#include "Core/HLE/sceCtrl.h" #include "Core/HLE/sceCtrl.h"
#include "Core/System.h" #include "Core/System.h"
#include "Common/Log.h"
#include "Common/KeyMap.h" #include "Common/KeyMap.h"
#include "Core/Config.h" #include "Core/Config.h"
#include "UI/ControlMappingScreen.h" #include "UI/ControlMappingScreen.h"
@ -581,7 +582,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) {
bool found = false; bool found = false;
for (int i = 0; i < MAX_TOUCH_POINTS; i++) { for (int i = 0; i < MAX_TOUCH_POINTS; i++) {
if (touches_[i].id == touch.id) { if (touches_[i].id == touch.id) {
WLOG("Double touch"); WARN_LOG(SYSTEM, "Double touch");
touches_[i].x = touch.x; touches_[i].x = touch.x;
touches_[i].y = touch.y; touches_[i].y = touch.y;
found = true; found = true;
@ -608,7 +609,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) {
} }
} }
if (!found) { 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) { if (touch.flags & TOUCH_UP) {
@ -621,7 +622,7 @@ bool TouchTestScreen::touch(const TouchInput &touch) {
} }
} }
if (!found) { if (!found) {
WLOG("Touch release without touch down"); WARN_LOG(SYSTEM, "Touch release without touch down");
} }
} }
return true; return true;

View file

@ -998,19 +998,19 @@ UI::EventReturn GameSettingsScreen::OnHardwareTransform(UI::EventParams &e) {
} }
UI::EventReturn GameSettingsScreen::OnScreenRotation(UI::EventParams &e) { UI::EventReturn GameSettingsScreen::OnScreenRotation(UI::EventParams &e) {
ILOG("New display rotation: %d", g_Config.iScreenRotation); INFO_LOG(SYSTEM, "New display rotation: %d", g_Config.iScreenRotation);
ILOG("Sending rotate"); INFO_LOG(SYSTEM, "Sending rotate");
System_SendMessage("rotate", ""); System_SendMessage("rotate", "");
ILOG("Got back from rotate"); INFO_LOG(SYSTEM, "Got back from rotate");
return UI::EVENT_DONE; return UI::EVENT_DONE;
} }
void RecreateActivity() { void RecreateActivity() {
const int SYSTEM_JELLYBEAN = 16; const int SYSTEM_JELLYBEAN = 16;
if (System_GetPropertyInt(SYSPROP_SYSTEMVERSION) >= SYSTEM_JELLYBEAN) { if (System_GetPropertyInt(SYSPROP_SYSTEMVERSION) >= SYSTEM_JELLYBEAN) {
ILOG("Sending recreate"); INFO_LOG(SYSTEM, "Sending recreate");
System_SendMessage("recreate", ""); System_SendMessage("recreate", "");
ILOG("Got back from recreate"); INFO_LOG(SYSTEM, "Got back from recreate");
} else { } else {
auto gr = GetI18NCategory("Graphics"); auto gr = GetI18NCategory("Graphics");
System_SendMessage("toast", gr->T("Must Restart", "You must restart PPSSPP for this change to take effect")); System_SendMessage("toast", gr->T("Must Restart", "You must restart PPSSPP for this change to take effect"));

View file

@ -370,7 +370,7 @@ void StoreScreen::update() {
RecreateViews(); RecreateViews();
} else { } else {
// Failed to contact store. Don't do anything. // 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; connectionError_ = true;
loading_ = false; loading_ = false;
RecreateViews(); RecreateViews();
@ -398,7 +398,7 @@ void StoreScreen::ParseListing(std::string json) {
using namespace json; using namespace json;
JsonReader reader(json.c_str(), json.size()); JsonReader reader(json.c_str(), json.size());
if (!reader.ok() || !reader.root()) { if (!reader.ok() || !reader.root()) {
ELOG("Error parsing JSON from store"); ERROR_LOG(IO, "Error parsing JSON from store");
connectionError_ = true; connectionError_ = true;
RecreateViews(); RecreateViews();
return; return;

View file

@ -43,7 +43,7 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty
type = DetectImageFileType(data, size); type = DetectImageFileType(data, size);
} }
if (type == TYPE_UNKNOWN) { 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; return false;
} }
@ -63,11 +63,11 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty
*num_levels = 1; *num_levels = 1;
*fmt = Draw::DataFormat::R8G8B8A8_UNORM; *fmt = Draw::DataFormat::R8G8B8A8_UNORM;
if (!image[0]) { if (!image[0]) {
ELOG("WTF"); ERROR_LOG(IO, "WTF");
return false; return false;
} }
} else { } else {
ELOG("PNG load failed"); ERROR_LOG(IO, "PNG load failed");
return false; return false;
} }
break; break;
@ -85,7 +85,7 @@ static bool LoadTextureLevels(const uint8_t *data, size_t size, ImageFileType ty
break; break;
default: default:
ELOG("Unsupported image format %d", (int)type); ERROR_LOG(IO, "Unsupported image format %d", (int)type);
return false; return false;
} }
@ -111,7 +111,7 @@ bool ManagedTexture::LoadFromFileData(const uint8_t *data, size_t dataSize, Imag
} }
if (num_levels < 0 || num_levels >= 16) { 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; num_levels = 1;
} }
@ -149,7 +149,7 @@ bool ManagedTexture::LoadFromFile(const std::string &filename, ImageFileType typ
uint8_t *buffer = VFSReadFile(filename.c_str(), &fileSize); uint8_t *buffer = VFSReadFile(filename.c_str(), &fileSize);
if (!buffer) { if (!buffer) {
filename_ = ""; filename_ = "";
ELOG("Failed to read file '%s'", filename.c_str()); ERROR_LOG(IO, "Failed to read file '%s'", filename.c_str());
return false; return false;
} }
bool retval = LoadFromFileData(buffer, fileSize, type, generateMips, filename.c_str()); 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; filename_ = filename;
} else { } else {
filename_ = ""; filename_ = "";
ELOG("Failed to load texture '%s'", filename.c_str()); ERROR_LOG(IO, "Failed to load texture '%s'", filename.c_str());
} }
delete[] buffer; delete[] buffer;
return retval; return retval;
@ -176,14 +176,14 @@ std::unique_ptr<ManagedTexture> CreateTextureFromFile(Draw::DrawContext *draw, c
} }
void ManagedTexture::DeviceLost() { void ManagedTexture::DeviceLost() {
ILOG("ManagedTexture::DeviceLost(%s)", filename_.c_str()); INFO_LOG(G3D, "ManagedTexture::DeviceLost(%s)", filename_.c_str());
if (texture_) if (texture_)
texture_->Release(); texture_->Release();
texture_ = nullptr; texture_ = nullptr;
} }
void ManagedTexture::DeviceRestored(Draw::DrawContext *draw) { void ManagedTexture::DeviceRestored(Draw::DrawContext *draw) {
ILOG("ManagedTexture::DeviceRestored(%s)", filename_.c_str()); INFO_LOG(G3D, "ManagedTexture::DeviceRestored(%s)", filename_.c_str());
_assert_(!texture_); _assert_(!texture_);
draw_ = draw; draw_ = draw;
// Vulkan: Can't load textures before the first frame has started. // 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() { Draw::Texture *ManagedTexture::GetTexture() {
if (loadPending_) { if (loadPending_) {
if (!LoadFromFile(filename_, ImageFileType::DETECT, generateMips_)) { if (!LoadFromFile(filename_, ImageFileType::DETECT, generateMips_)) {
ELOG("ManagedTexture failed: '%s'", filename_.c_str()); ERROR_LOG(IO, "ManagedTexture failed: '%s'", filename_.c_str());
} }
loadPending_ = false; loadPending_ = false;
} }

View file

@ -448,7 +448,7 @@ UI::EventReturn TouchControlLayoutScreen::OnVisibility(UI::EventParams &e) {
} }
UI::EventReturn TouchControlLayoutScreen::OnReset(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(); g_Config.ResetControlLayout();
const Bounds &bounds = screenManager()->getUIContext()->GetBounds(); const Bounds &bounds = screenManager()->getUIContext()->GetBounds();
InitPadLayout(bounds.w, bounds.h); InitPadLayout(bounds.w, bounds.h);

View file

@ -1,7 +1,6 @@
#include "pch.h" #include "pch.h"
#include "ppltasks.h" #include "ppltasks.h"
#include "base/logging.h"
#include "thread/threadutil.h" #include "thread/threadutil.h"
#include "StorageFolderBrowser.h" #include "StorageFolderBrowser.h"

View file

@ -104,7 +104,7 @@ static void EmuThreadStop() {
static void EmuThreadJoin() { static void EmuThreadJoin() {
emuThread.join(); emuThread.join();
emuThread = std::thread(); emuThread = std::thread();
ILOG("EmuThreadJoin - joined"); INFO_LOG(SYSTEM, "EmuThreadJoin - joined");
} }
void MainThreadFunc() { void MainThreadFunc() {

View file

@ -71,7 +71,7 @@ bool D3D9Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) {
hD3D9_ = LoadLibrary(TEXT("d3d9.dll")); hD3D9_ = LoadLibrary(TEXT("d3d9.dll"));
if (!hD3D9_) { if (!hD3D9_) {
ELOG("Missing d3d9.dll"); ERROR_LOG(G3D, "Missing d3d9.dll");
*error_message = "D3D9.dll missing - try reinstalling DirectX."; *error_message = "D3D9.dll missing - try reinstalling DirectX.";
return false; return false;
} }

View file

@ -190,10 +190,7 @@ void internal_profiler_leave(int thread_id, int category) {
void internal_profiler_end_frame() { void internal_profiler_end_frame() {
int thread_id = internal_profiler_find_thread(); int thread_id = internal_profiler_find_thread();
if (profiler.depth[thread_id] != 0) { _assert_msg_(profiler.depth[thread_id] == 0, "Can't be inside a profiler scope at end of frame!");
// Threads may be off, but they'll fall into another frame.
FLOG("Can't be inside a profiler scope at end of frame!");
}
profiler.curFrameStart = real_time_now(); profiler.curFrameStart = real_time_now();
profiler.historyPos++; profiler.historyPos++;
profiler.historyPos &= (HISTORY_SIZE - 1); profiler.historyPos &= (HISTORY_SIZE - 1);

View file

@ -114,7 +114,7 @@ void GLRenderManager::ThreadStart(Draw::DrawContext *draw) {
renderThreadId = std::this_thread::get_id(); renderThreadId = std::this_thread::get_id();
if (newInflightFrames_ != -1) { if (newInflightFrames_ != -1) {
ILOG("Updating inflight frames to %d", newInflightFrames_); INFO_LOG(G3D, "Updating inflight frames to %d", newInflightFrames_);
inflightFrames_ = newInflightFrames_; inflightFrames_ = newInflightFrames_;
newInflightFrames_ = -1; newInflightFrames_ = -1;
} }
@ -154,7 +154,7 @@ void GLRenderManager::ThreadStart(Draw::DrawContext *draw) {
} }
void GLRenderManager::ThreadEnd() { void GLRenderManager::ThreadEnd() {
ILOG("ThreadEnd"); INFO_LOG(G3D, "ThreadEnd");
// Wait for any shutdown to complete in StopThread(). // Wait for any shutdown to complete in StopThread().
std::unique_lock<std::mutex> lock(mutex_); std::unique_lock<std::mutex> lock(mutex_);
@ -217,7 +217,7 @@ bool GLRenderManager::ThreadFrame() {
} }
VLOG("PULL: Running frame %d", threadFrame_); VLOG("PULL: Running frame %d", threadFrame_);
if (firstFrame) { if (firstFrame) {
ILOG("Running first frame (%d)", threadFrame_); INFO_LOG(G3D, "Running first frame (%d)", threadFrame_);
firstFrame = false; firstFrame = false;
} }
Run(threadFrame_); Run(threadFrame_);
@ -246,7 +246,7 @@ void GLRenderManager::StopThread() {
// Wait until we've definitely stopped the threadframe. // Wait until we've definitely stopped the threadframe.
std::unique_lock<std::mutex> lock(mutex_); std::unique_lock<std::mutex> lock(mutex_);
ILOG("GL submission thread paused. Frame=%d", curFrame_); INFO_LOG(G3D, "GL submission thread paused. Frame=%d", curFrame_);
// Eat whatever has been queued up for this frame if anything. // Eat whatever has been queued up for this frame if anything.
Wipe(); Wipe();
@ -274,7 +274,7 @@ void GLRenderManager::StopThread() {
} }
} }
} else { } else {
ILOG("GL submission thread was already paused."); INFO_LOG(G3D, "GL submission thread was already paused.");
} }
} }
@ -454,7 +454,7 @@ void GLRenderManager::BeginFrame() {
// Must be after the fence - this performs deletes. // Must be after the fence - this performs deletes.
VLOG("PUSH: BeginFrame %d", curFrame); VLOG("PUSH: BeginFrame %d", curFrame);
if (!run_) { if (!run_) {
WLOG("BeginFrame while !run_!"); WARN_LOG(G3D, "BeginFrame while !run_!");
} }
// vulkan_->BeginFrame(); // vulkan_->BeginFrame();

View file

@ -2,7 +2,6 @@
#include <cstring> #include <cstring>
#include <cstdint> #include <cstdint>
#include "base/logging.h"
#include "base/display.h" #include "base/display.h"
#include "thin3d/thin3d.h" #include "thin3d/thin3d.h"
#include "Common/Log.h" #include "Common/Log.h"
@ -92,7 +91,7 @@ bool RefCountedObject::ReleaseAssertLast() {
return true; return true;
} }
} else { } else {
ELOG("Refcount (%d) invalid for object %p - corrupt?", refcount_, this); ERROR_LOG(G3D, "Refcount (%d) invalid for object %p - corrupt?", refcount_, this);
} }
return false; return false;
} }

View file

@ -12,7 +12,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/logging.h"
#include "DataFormat.h" #include "DataFormat.h"
namespace Lin { namespace Lin {

View file

@ -870,7 +870,7 @@ public:
ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLanguage language, const uint8_t *data, size_t dataSize, const std::string &tag) { ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLanguage language, const uint8_t *data, size_t dataSize, const std::string &tag) {
if (language != ShaderLanguage::HLSL_D3D11) { if (language != ShaderLanguage::HLSL_D3D11) {
ELOG("Unsupported shader language"); ERROR_LOG(G3D, "Unsupported shader language");
return nullptr; return nullptr;
} }
@ -915,7 +915,7 @@ ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLang
} }
if (errorMsgs) { if (errorMsgs) {
errors = std::string((const char *)errorMsgs->GetBufferPointer(), errorMsgs->GetBufferSize()); errors = std::string((const char *)errorMsgs->GetBufferPointer(), errorMsgs->GetBufferSize());
ELOG("Failed compiling:\n%s\n%s", data, errors.c_str()); ERROR_LOG(G3D, "Failed compiling:\n%s\n%s", data, errors.c_str());
errorMsgs->Release(); errorMsgs->Release();
} }
@ -940,7 +940,7 @@ ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLang
result = device_->CreateGeometryShader(data, dataSize, nullptr, &module->gs); result = device_->CreateGeometryShader(data, dataSize, nullptr, &module->gs);
break; break;
default: default:
ELOG("Unsupported shader stage"); ERROR_LOG(G3D, "Unsupported shader stage");
result = S_FALSE; result = S_FALSE;
break; break;
} }

View file

@ -33,11 +33,12 @@
#define D3DXERR_INVALIDDATA 0x88760b59 #define D3DXERR_INVALIDDATA 0x88760b59
#endif #endif
#include "base/logging.h"
#include "math/lin/matrix4x4.h" #include "math/lin/matrix4x4.h"
#include "thin3d/thin3d.h" #include "thin3d/thin3d.h"
#include "gfx/d3d9_state.h" #include "gfx/d3d9_state.h"
#include "Common/Log.h"
namespace Draw { namespace Draw {
// Could be declared as u8 // Could be declared as u8
@ -381,7 +382,7 @@ bool D3D9Texture::Create(const TextureDesc &desc) {
break; break;
} }
if (FAILED(hr)) { if (FAILED(hr)) {
ELOG("Texture creation failed"); ERROR_LOG(G3D, "Texture creation failed");
return false; return false;
} }
@ -476,7 +477,7 @@ void D3D9Texture::SetImageData(int x, int y, int z, int width, int height, int d
} }
default: default:
ELOG("Non-LINEAR2D textures not yet supported"); ERROR_LOG(G3D, "Non-LINEAR2D textures not yet supported");
break; break;
} }
} }
@ -636,7 +637,7 @@ private:
D3D9Context::D3D9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapterId, IDirect3DDevice9 *device, IDirect3DDevice9Ex *deviceEx) D3D9Context::D3D9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapterId, IDirect3DDevice9 *device, IDirect3DDevice9Ex *deviceEx)
: d3d_(d3d), d3dEx_(d3dEx), adapterId_(adapterId), device_(device), deviceEx_(deviceEx), caps_{} { : d3d_(d3d), d3dEx_(d3dEx), adapterId_(adapterId), device_(device), deviceEx_(deviceEx), caps_{} {
if (FAILED(d3d->GetAdapterIdentifier(adapterId, 0, &identifier_))) { if (FAILED(d3d->GetAdapterIdentifier(adapterId, 0, &identifier_))) {
ELOG("Failed to get adapter identifier: %d", adapterId); ERROR_LOG(G3D, "Failed to get adapter identifier: %d", adapterId);
} }
switch (identifier_.VendorId) { switch (identifier_.VendorId) {
case 0x10DE: caps_.vendor = GPUVendor::VENDOR_NVIDIA; break; case 0x10DE: caps_.vendor = GPUVendor::VENDOR_NVIDIA; break;
@ -691,13 +692,13 @@ ShaderModule *D3D9Context::CreateShaderModule(ShaderStage stage, ShaderLanguage
Pipeline *D3D9Context::CreateGraphicsPipeline(const PipelineDesc &desc) { Pipeline *D3D9Context::CreateGraphicsPipeline(const PipelineDesc &desc) {
if (!desc.shaders.size()) { if (!desc.shaders.size()) {
ELOG("Pipeline requires at least one shader"); ERROR_LOG(G3D, "Pipeline requires at least one shader");
return NULL; return NULL;
} }
D3D9Pipeline *pipeline = new D3D9Pipeline(device_); D3D9Pipeline *pipeline = new D3D9Pipeline(device_);
for (auto iter : desc.shaders) { for (auto iter : desc.shaders) {
if (!iter) { if (!iter) {
ELOG("NULL shader passed to CreateGraphicsPipeline"); ERROR_LOG(G3D, "NULL shader passed to CreateGraphicsPipeline");
delete pipeline; delete pipeline;
return NULL; return NULL;
} }
@ -856,7 +857,7 @@ D3D9InputLayout::D3D9InputLayout(LPDIRECT3DDEVICE9 device, const InputLayoutDesc
HRESULT hr = device->CreateVertexDeclaration(elements, &decl_); HRESULT hr = device->CreateVertexDeclaration(elements, &decl_);
if (FAILED(hr)) { if (FAILED(hr)) {
ELOG("Error creating vertex decl"); ERROR_LOG(G3D, "Error creating vertex decl");
} }
delete[] elements; delete[] elements;
} }
@ -900,8 +901,7 @@ inline void Transpose4x4(float out[16], const float in[16]) {
} }
void D3D9Context::UpdateDynamicUniformBuffer(const void *ub, size_t size) { void D3D9Context::UpdateDynamicUniformBuffer(const void *ub, size_t size) {
if (size != curPipeline_->dynamicUniforms.uniformBufferSize) _assert_(size == curPipeline_->dynamicUniforms.uniformBufferSize);
Crash();
for (auto &uniform : curPipeline_->dynamicUniforms.uniforms) { for (auto &uniform : curPipeline_->dynamicUniforms.uniforms) {
int count = 0; int count = 0;
switch (uniform.type) { switch (uniform.type) {
@ -935,7 +935,7 @@ void D3D9Context::UpdateBuffer(Buffer *buffer, const uint8_t *data, size_t offse
if (!size) if (!size)
return; return;
if (offset + size > buf->maxSize_) { if (offset + size > buf->maxSize_) {
ELOG("Can't SubData with bigger size than buffer was created with"); ERROR_LOG(G3D, "Can't SubData with bigger size than buffer was created with");
return; return;
} }
if (buf->vbuffer_) { if (buf->vbuffer_) {
@ -1104,7 +1104,7 @@ Framebuffer *D3D9Context::CreateFramebuffer(const FramebufferDesc &desc) {
HRESULT rtResult = device_->CreateTexture(fbo->width, fbo->height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &fbo->tex, NULL); HRESULT rtResult = device_->CreateTexture(fbo->width, fbo->height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &fbo->tex, NULL);
if (FAILED(rtResult)) { if (FAILED(rtResult)) {
ELOG("Failed to create render target"); ERROR_LOG(G3D, "Failed to create render target");
delete fbo; delete fbo;
return NULL; return NULL;
} }
@ -1120,7 +1120,7 @@ Framebuffer *D3D9Context::CreateFramebuffer(const FramebufferDesc &desc) {
dsResult = device_->CreateDepthStencilSurface(fbo->width, fbo->height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, FALSE, &fbo->depthstencil, NULL); dsResult = device_->CreateDepthStencilSurface(fbo->width, fbo->height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, FALSE, &fbo->depthstencil, NULL);
} }
if (FAILED(dsResult)) { if (FAILED(dsResult)) {
ELOG("Failed to create depth buffer"); ERROR_LOG(G3D, "Failed to create depth buffer");
fbo->surf->Release(); fbo->surf->Release();
fbo->tex->Release(); fbo->tex->Release();
if (fbo->depthstenciltex) { if (fbo->depthstenciltex) {
@ -1264,13 +1264,13 @@ DrawContext *T3DCreateDX9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapt
#if PPSSPP_API(D3DX9) #if PPSSPP_API(D3DX9)
int d3dx_ver = LoadD3DX9Dynamic(); int d3dx_ver = LoadD3DX9Dynamic();
if (!d3dx_ver) { if (!d3dx_ver) {
ELOG("Failed to load D3DX9!"); ERROR_LOG(G3D, "Failed to load D3DX9!");
return NULL; return NULL;
} }
#elif PPSSPP_API(D3D9_D3DCOMPILER) #elif PPSSPP_API(D3D9_D3DCOMPILER)
bool result = LoadD3DCompilerDynamic(); bool result = LoadD3DCompilerDynamic();
if (!result) { if (!result) {
ELOG("Failed to load D3DCompiler!"); ERROR_LOG(G3D, "Failed to load D3DCompiler!");
return NULL; return NULL;
} }
#endif #endif

View file

@ -4,7 +4,6 @@
#include <algorithm> #include <algorithm>
#include <map> #include <map>
#include "base/logging.h"
#include "math/dataconv.h" #include "math/dataconv.h"
#include "math/math_util.h" #include "math/math_util.h"
#include "math/lin/matrix4x4.h" #include "math/lin/matrix4x4.h"
@ -230,7 +229,7 @@ GLuint ShaderStageToOpenGL(ShaderStage stage) {
class OpenGLShaderModule : public ShaderModule { class OpenGLShaderModule : public ShaderModule {
public: public:
OpenGLShaderModule(GLRenderManager *render, ShaderStage stage, const std::string &tag) : render_(render), stage_(stage), tag_(tag) { OpenGLShaderModule(GLRenderManager *render, ShaderStage stage, const std::string &tag) : render_(render), stage_(stage), tag_(tag) {
DLOG("Shader module created (%p)", this); DEBUG_LOG(G3D, "Shader module created (%p)", this);
glstage_ = ShaderStageToOpenGL(stage); glstage_ = ShaderStageToOpenGL(stage);
} }
@ -644,7 +643,7 @@ GLuint TypeToTarget(TextureType type) {
#endif #endif
case TextureType::ARRAY2D: return GL_TEXTURE_2D_ARRAY; case TextureType::ARRAY2D: return GL_TEXTURE_2D_ARRAY;
default: default:
ELOG("Bad texture type %d", (int)type); ERROR_LOG(G3D, "Bad texture type %d", (int)type);
return GL_NONE; return GL_NONE;
} }
} }
@ -957,15 +956,15 @@ void OpenGLContext::UpdateBuffer(Buffer *buffer, const uint8_t *data, size_t off
Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) { Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
if (!desc.shaders.size()) { if (!desc.shaders.size()) {
ELOG("Pipeline requires at least one shader"); ERROR_LOG(G3D, "Pipeline requires at least one shader");
return nullptr; return nullptr;
} }
if ((int)desc.prim >= (int)Primitive::PRIMITIVE_TYPE_COUNT) { if ((int)desc.prim >= (int)Primitive::PRIMITIVE_TYPE_COUNT) {
ELOG("Invalid primitive type"); ERROR_LOG(G3D, "Invalid primitive type");
return nullptr; return nullptr;
} }
if (!desc.depthStencil || !desc.blend || !desc.raster || !desc.inputLayout) { if (!desc.depthStencil || !desc.blend || !desc.raster || !desc.inputLayout) {
ELOG("Incomplete prim desciption"); ERROR_LOG(G3D, "Incomplete prim desciption");
return nullptr; return nullptr;
} }
@ -975,7 +974,7 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
iter->AddRef(); iter->AddRef();
pipeline->shaders.push_back(static_cast<OpenGLShaderModule *>(iter)); pipeline->shaders.push_back(static_cast<OpenGLShaderModule *>(iter));
} else { } else {
ELOG("ERROR: Tried to create graphics pipeline with a null shader module"); ERROR_LOG(G3D, "ERROR: Tried to create graphics pipeline with a null shader module");
delete pipeline; delete pipeline;
return nullptr; return nullptr;
} }
@ -997,7 +996,7 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
pipeline->inputLayout->AddRef(); pipeline->inputLayout->AddRef();
return pipeline; return pipeline;
} else { } else {
ELOG("Failed to create pipeline - shaders failed to link"); ERROR_LOG(G3D, "Failed to create pipeline - shaders failed to link");
delete pipeline; delete pipeline;
return nullptr; return nullptr;
} }
@ -1059,11 +1058,11 @@ bool OpenGLPipeline::LinkShaders() {
if (shader) { if (shader) {
linkShaders.push_back(shader); linkShaders.push_back(shader);
} else { } else {
ELOG("LinkShaders: Bad shader module"); ERROR_LOG(G3D, "LinkShaders: Bad shader module");
return false; return false;
} }
} else { } else {
ELOG("LinkShaders: Bad shader in module"); ERROR_LOG(G3D, "LinkShaders: Bad shader in module");
return false; return false;
} }
} }
@ -1213,7 +1212,7 @@ void OpenGLInputLayout::Compile(const InputLayoutDesc &desc) {
break; break;
case DataFormat::UNDEFINED: case DataFormat::UNDEFINED:
default: default:
ELOG("Thin3DGLVertexFormat: Invalid or unknown component type applied."); ERROR_LOG(G3D, "Thin3DGLVertexFormat: Invalid or unknown component type applied.");
break; break;
} }

View file

@ -21,9 +21,6 @@
#include <map> #include <map>
#include <cassert> #include <cassert>
#include "Core/Config.h"
#include "base/logging.h"
#include "base/display.h" #include "base/display.h"
#include "base/stringutil.h" #include "base/stringutil.h"
#include "image/zim_load.h" #include "image/zim_load.h"
@ -32,10 +29,13 @@
#include "thin3d/thin3d.h" #include "thin3d/thin3d.h"
#include "thin3d/VulkanRenderManager.h" #include "thin3d/VulkanRenderManager.h"
#include "Common/Log.h"
#include "Common/Vulkan/VulkanContext.h" #include "Common/Vulkan/VulkanContext.h"
#include "Common/Vulkan/VulkanImage.h" #include "Common/Vulkan/VulkanImage.h"
#include "Common/Vulkan/VulkanMemory.h" #include "Common/Vulkan/VulkanMemory.h"
#include "Core/Config.h"
// We use a simple descriptor set for all rendering: 1 sampler, 1 texture, 1 UBO binding point. // We use a simple descriptor set for all rendering: 1 sampler, 1 texture, 1 UBO binding point.
// binding 0 - uniform data // binding 0 - uniform data
// binding 1 - sampler // binding 1 - sampler
@ -704,7 +704,7 @@ bool VKTexture::Create(VkCommandBuffer cmd, VulkanPushBuffer *push, const Textur
// Zero-sized textures not allowed. // Zero-sized textures not allowed.
_assert_(desc.width * desc.height * desc.depth > 0); // remember to set depth to 1! _assert_(desc.width * desc.height * desc.depth > 0); // remember to set depth to 1!
if (desc.width * desc.height * desc.depth <= 0) { if (desc.width * desc.height * desc.depth <= 0) {
ELOG("Bad texture dimensions %dx%dx%d", desc.width, desc.height, desc.depth); ERROR_LOG(G3D, "Bad texture dimensions %dx%dx%d", desc.width, desc.height, desc.depth);
return false; return false;
} }
_assert_(push); _assert_(push);
@ -727,7 +727,7 @@ bool VKTexture::Create(VkCommandBuffer cmd, VulkanPushBuffer *push, const Textur
} }
if (!vkTex_->CreateDirect(cmd, alloc, width_, height_, mipLevels_, vulkanFormat, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, usageBits)) { if (!vkTex_->CreateDirect(cmd, alloc, width_, height_, mipLevels_, vulkanFormat, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, usageBits)) {
ELOG("Failed to create VulkanTexture: %dx%dx%d fmt %d, %d levels", width_, height_, depth_, (int)vulkanFormat, mipLevels_); ERROR_LOG(G3D, "Failed to create VulkanTexture: %dx%dx%d fmt %d, %d levels", width_, height_, depth_, (int)vulkanFormat, mipLevels_);
return false; return false;
} }
if (desc.initData.size()) { if (desc.initData.size()) {
@ -1038,7 +1038,7 @@ Pipeline *VKContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
for (auto &iter : desc.shaders) { for (auto &iter : desc.shaders) {
VKShaderModule *vkshader = (VKShaderModule *)iter; VKShaderModule *vkshader = (VKShaderModule *)iter;
if (!vkshader) { if (!vkshader) {
ELOG("CreateGraphicsPipeline got passed a null shader"); ERROR_LOG(G3D, "CreateGraphicsPipeline got passed a null shader");
return nullptr; return nullptr;
} }
VkPipelineShaderStageCreateInfo &stage = stages[i++]; VkPipelineShaderStageCreateInfo &stage = stages[i++];
@ -1100,7 +1100,7 @@ Pipeline *VKContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
VkPipeline pipelines[2]{}; VkPipeline pipelines[2]{};
VkResult result = vkCreateGraphicsPipelines(device_, pipelineCache_, 2, createInfo, nullptr, pipelines); VkResult result = vkCreateGraphicsPipelines(device_, pipelineCache_, 2, createInfo, nullptr, pipelines);
if (result != VK_SUCCESS) { if (result != VK_SUCCESS) {
ELOG("Failed to create graphics pipeline"); ERROR_LOG(G3D, "Failed to create graphics pipeline");
delete pipeline; delete pipeline;
return nullptr; return nullptr;
} }
@ -1177,14 +1177,14 @@ Texture *VKContext::CreateTexture(const TextureDesc &desc) {
VkCommandBuffer initCmd = renderManager_.GetInitCmd(); VkCommandBuffer initCmd = renderManager_.GetInitCmd();
if (!push_ || !initCmd) { if (!push_ || !initCmd) {
// Too early! Fail. // Too early! Fail.
ELOG("Can't create textures before the first frame has started."); ERROR_LOG(G3D, "Can't create textures before the first frame has started.");
return nullptr; return nullptr;
} }
VKTexture *tex = new VKTexture(vulkan_, initCmd, push_, desc); VKTexture *tex = new VKTexture(vulkan_, initCmd, push_, desc);
if (tex->Create(initCmd, push_, desc, allocator_)) { if (tex->Create(initCmd, push_, desc, allocator_)) {
return tex; return tex;
} else { } else {
ELOG("Failed to create texture"); ERROR_LOG(G3D, "Failed to create texture");
delete tex; delete tex;
return nullptr; return nullptr;
} }
@ -1271,7 +1271,7 @@ ShaderModule *VKContext::CreateShaderModule(ShaderStage stage, ShaderLanguage la
if (shader->Compile(vulkan_, language, data, size)) { if (shader->Compile(vulkan_, language, data, size)) {
return shader; return shader;
} else { } else {
ELOG("Failed to compile shader: %s", (const char *)data); ERROR_LOG(G3D, "Failed to compile shader: %s", (const char *)data);
shader->Release(); shader->Release();
return nullptr; return nullptr;
} }

View file

@ -1,13 +1,14 @@
#include <functional> #include <functional>
#include <thread> #include <thread>
#include "base/logging.h"
#include "base/timeutil.h" #include "base/timeutil.h"
#include "thread/prioritizedworkqueue.h" #include "thread/prioritizedworkqueue.h"
#include "Common/Log.h"
PrioritizedWorkQueue::~PrioritizedWorkQueue() { PrioritizedWorkQueue::~PrioritizedWorkQueue() {
if (!done_) { if (!done_) {
ELOG("PrioritizedWorkQueue destroyed but not done!"); ERROR_LOG(SYSTEM, "PrioritizedWorkQueue destroyed but not done!");
} }
} }
@ -32,7 +33,7 @@ void PrioritizedWorkQueue::Flush() {
} }
queue_.clear(); queue_.clear();
if (flush_count > 0) { if (flush_count > 0) {
ILOG("PrioritizedWorkQueue: Flushed %d un-executed tasks", flush_count); INFO_LOG(SYSTEM, "PrioritizedWorkQueue: Flushed %d un-executed tasks", flush_count);
} }
} }

View file

@ -1,6 +1,7 @@
#include "base/logging.h"
#include "thread/threadpool.h" #include "thread/threadpool.h"
#include "thread/threadutil.h" #include "thread/threadutil.h"
#include "Common/Log.h"
#include "Common/MakeUnique.h" #include "Common/MakeUnique.h"
///////////////////////////// WorkerThread ///////////////////////////// WorkerThread
@ -86,9 +87,9 @@ void LoopWorkerThread::WorkFunc() {
ThreadPool::ThreadPool(int numThreads) { ThreadPool::ThreadPool(int numThreads) {
if (numThreads <= 0) { if (numThreads <= 0) {
numThreads_ = 1; numThreads_ = 1;
ILOG("ThreadPool: Bad number of threads %i", numThreads); INFO_LOG(JIT, "ThreadPool: Bad number of threads %d", numThreads);
} else if (numThreads > 8) { } else if (numThreads > 8) {
ILOG("ThreadPool: Capping number of threads to 8 (was %i)", numThreads); INFO_LOG(JIT, "ThreadPool: Capping number of threads to 8 (was %d)", numThreads);
numThreads_ = 8; numThreads_ = 8;
} else { } else {
numThreads_ = numThreads; numThreads_ = numThreads;

View file

@ -8,10 +8,13 @@
#define TLS_SUPPORTED #define TLS_SUPPORTED
#endif #endif
#include <cstring>
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/logging.h"
#include "thread/threadutil.h" #include "thread/threadutil.h"
#include "Common/Log.h"
#if defined(__ANDROID__) || defined(__APPLE__) || (defined(__GLIBC__) && defined(_GNU_SOURCE)) #if defined(__ANDROID__) || defined(__APPLE__) || (defined(__GLIBC__) && defined(_GNU_SOURCE))
#include <pthread.h> #include <pthread.h>
#endif #endif
@ -115,7 +118,7 @@ void setCurrentThreadName(const char* threadName) {
void AssertCurrentThreadName(const char *threadName) { void AssertCurrentThreadName(const char *threadName) {
#ifdef TLS_SUPPORTED #ifdef TLS_SUPPORTED
if (strcmp(curThreadName, threadName) != 0) { if (strcmp(curThreadName, threadName) != 0) {
ELOG("Thread name assert failed: Expected %s, was %s", threadName, curThreadName); ERROR_LOG(SYSTEM, "Thread name assert failed: Expected %s, was %s", threadName, curThreadName);
} }
#endif #endif
} }

View file

@ -7,6 +7,8 @@
#include "ui/root.h" #include "ui/root.h"
#include "ui/viewgroup.h" #include "ui/viewgroup.h"
#include "Common/Log.h"
namespace UI { namespace UI {
static std::mutex focusLock; static std::mutex focusLock;
@ -109,7 +111,7 @@ bool IsFocusMovementEnabled() {
void LayoutViewHierarchy(const UIContext &dc, ViewGroup *root, bool ignoreInsets) { void LayoutViewHierarchy(const UIContext &dc, ViewGroup *root, bool ignoreInsets) {
if (!root) { if (!root) {
ELOG("Tried to layout a view hierarchy from a zero pointer root"); ERROR_LOG(SYSTEM, "Tried to layout a view hierarchy from a zero pointer root");
return; return;
} }
@ -358,7 +360,7 @@ void UpdateViewHierarchy(ViewGroup *root) {
frameCount++; frameCount++;
if (!root) { if (!root) {
ELOG("Tried to update a view hierarchy from a zero pointer root"); ERROR_LOG(SYSTEM, "Tried to update a view hierarchy from a zero pointer root");
return; return;
} }

View file

@ -1,5 +1,4 @@
#include "base/display.h" #include "base/display.h"
#include "base/logging.h"
#include "base/timeutil.h" #include "base/timeutil.h"
#include "input/input_state.h" #include "input/input_state.h"
#include "ui/root.h" #include "ui/root.h"
@ -7,6 +6,8 @@
#include "ui/ui.h" #include "ui/ui.h"
#include "ui/view.h" #include "ui/view.h"
#include "Common/Log.h"
ScreenManager::ScreenManager() { ScreenManager::ScreenManager() {
uiContext_ = 0; uiContext_ = 0;
dialogFinished_ = 0; dialogFinished_ = 0;
@ -18,7 +19,7 @@ ScreenManager::~ScreenManager() {
void ScreenManager::switchScreen(Screen *screen) { void ScreenManager::switchScreen(Screen *screen) {
if (!nextStack_.empty() && screen == nextStack_.front().screen) { if (!nextStack_.empty() && screen == nextStack_.front().screen) {
ELOG("Already switching to this screen"); ERROR_LOG(SYSTEM, "Already switching to this screen");
return; return;
} }
// Note that if a dialog is found, this will be a silent background switch that // Note that if a dialog is found, this will be a silent background switch that
@ -26,12 +27,12 @@ void ScreenManager::switchScreen(Screen *screen) {
// until that switch. // until that switch.
// TODO: is this still true? // TODO: is this still true?
if (!nextStack_.empty()) { if (!nextStack_.empty()) {
ELOG("Already had a nextStack_! Asynchronous open while doing something? Deleting the new screen."); ERROR_LOG(SYSTEM, "Already had a nextStack_! Asynchronous open while doing something? Deleting the new screen.");
delete screen; delete screen;
return; return;
} }
if (screen == nullptr) { if (screen == nullptr) {
WLOG("Swiching to a zero screen, this can't be good"); WARN_LOG(SYSTEM, "Switching to a zero screen, this can't be good");
} }
if (stack_.empty() || screen != stack_.back().screen) { if (stack_.empty() || screen != stack_.back().screen) {
screen->setScreenManager(this); screen->setScreenManager(this);
@ -53,7 +54,7 @@ void ScreenManager::update() {
void ScreenManager::switchToNext() { void ScreenManager::switchToNext() {
std::lock_guard<std::recursive_mutex> guard(inputLock_); std::lock_guard<std::recursive_mutex> guard(inputLock_);
if (nextStack_.empty()) { if (nextStack_.empty()) {
ELOG("switchToNext: No nextStack_!"); ERROR_LOG(SYSTEM, "switchToNext: No nextStack_!");
} }
Layer temp = {nullptr, 0}; Layer temp = {nullptr, 0};
@ -128,7 +129,7 @@ void ScreenManager::deviceRestored() {
} }
void ScreenManager::resized() { void ScreenManager::resized() {
ILOG("ScreenManager::resized(dp: %dx%d)", dp_xres, dp_yres); INFO_LOG(SYSTEM, "ScreenManager::resized(dp: %dx%d)", dp_xres, dp_yres);
std::lock_guard<std::recursive_mutex> guard(inputLock_); std::lock_guard<std::recursive_mutex> guard(inputLock_);
// Have to notify the whole stack, otherwise there will be problems when going back // Have to notify the whole stack, otherwise there will be problems when going back
// to non-top screens. // to non-top screens.
@ -143,7 +144,7 @@ void ScreenManager::render() {
case LAYER_SIDEMENU: case LAYER_SIDEMENU:
case LAYER_TRANSPARENT: case LAYER_TRANSPARENT:
if (stack_.size() == 1) { if (stack_.size() == 1) {
ELOG("Can't have sidemenu over nothing"); ERROR_LOG(SYSTEM, "Can't have sidemenu over nothing");
break; break;
} else { } else {
auto iter = stack_.end(); auto iter = stack_.end();
@ -170,7 +171,7 @@ void ScreenManager::render() {
break; break;
} }
} else { } else {
ELOG("No current screen!"); ERROR_LOG(SYSTEM, "No current screen!");
} }
processFinishDialog(); processFinishDialog();
@ -235,7 +236,7 @@ void ScreenManager::pop() {
delete stack_.back().screen; delete stack_.back().screen;
stack_.pop_back(); stack_.pop_back();
} else { } else {
ELOG("Can't pop when stack empty"); ERROR_LOG(SYSTEM, "Can't pop when stack empty");
} }
} }
@ -247,11 +248,11 @@ void ScreenManager::RecreateAllViews() {
void ScreenManager::finishDialog(Screen *dialog, DialogResult result) { void ScreenManager::finishDialog(Screen *dialog, DialogResult result) {
if (stack_.empty()) { if (stack_.empty()) {
ELOG("Must be in a dialog to finishDialog"); ERROR_LOG(SYSTEM, "Must be in a dialog to finishDialog");
return; return;
} }
if (dialog != stack_.back().screen) { if (dialog != stack_.back().screen) {
ELOG("Wrong dialog being finished!"); ERROR_LOG(SYSTEM, "Wrong dialog being finished!");
return; return;
} }
dialog->onFinish(result); dialog->onFinish(result);
@ -283,10 +284,10 @@ void ScreenManager::processFinishDialog() {
} }
if (!caller) { if (!caller) {
ELOG("ERROR: no top screen when finishing dialog"); ERROR_LOG(SYSTEM, "ERROR: no top screen when finishing dialog");
} else if (caller != topScreen()) { } else if (caller != topScreen()) {
// The caller may get confused if we call dialogFinished() now. // The caller may get confused if we call dialogFinished() now.
WLOG("Skipping non-top dialog when finishing dialog."); WARN_LOG(SYSTEM, "Skipping non-top dialog when finishing dialog.");
} else { } else {
caller->dialogFinished(dialogFinished_, dialogResult_); caller->dialogFinished(dialogFinished_, dialogResult_);
} }

View file

@ -4,7 +4,6 @@
#include "base/display.h" #include "base/display.h"
#include "base/NativeApp.h" #include "base/NativeApp.h"
#include "base/logging.h"
#include "ui/ui.h" #include "ui/ui.h"
#include "ui/view.h" #include "ui/view.h"
#include "ui/ui_context.h" #include "ui/ui_context.h"

View file

@ -1,6 +1,7 @@
#include <algorithm> #include <algorithm>
#include <map> #include <map>
#include <sstream> #include <sstream>
#include "base/display.h" #include "base/display.h"
#include "base/stringutil.h" #include "base/stringutil.h"
#include "input/input_state.h" #include "input/input_state.h"
@ -13,6 +14,8 @@
#include "i18n/i18n.h" #include "i18n/i18n.h"
#include "gfx_es2/draw_buffer.h" #include "gfx_es2/draw_buffer.h"
#include "Common/Log.h"
static const bool ClickDebug = false; static const bool ClickDebug = false;
UIScreen::UIScreen() UIScreen::UIScreen()
@ -137,11 +140,11 @@ TouchInput UIScreen::transformTouch(const TouchInput &touch) {
bool UIScreen::touch(const TouchInput &touch) { bool UIScreen::touch(const TouchInput &touch) {
if (root_) { if (root_) {
if (ClickDebug && (touch.flags & TOUCH_DOWN)) { if (ClickDebug && (touch.flags & TOUCH_DOWN)) {
ILOG("Touch down!"); INFO_LOG(SYSTEM, "Touch down!");
std::vector<UI::View *> views; std::vector<UI::View *> views;
root_->Query(touch.x, touch.y, views); root_->Query(touch.x, touch.y, views);
for (auto view : views) { for (auto view : views) {
ILOG("%s", view->Describe().c_str()); INFO_LOG(SYSTEM, "%s", view->Describe().c_str());
} }
} }
@ -166,7 +169,7 @@ bool UIDialogScreen::key(const KeyInput &key) {
bool retval = UIScreen::key(key); bool retval = UIScreen::key(key);
if (!retval && (key.flags & KEY_DOWN) && UI::IsEscapeKey(key)) { if (!retval && (key.flags & KEY_DOWN) && UI::IsEscapeKey(key)) {
if (finished_) { if (finished_) {
ELOG("Screen already finished"); ERROR_LOG(SYSTEM, "Screen already finished");
} else { } else {
finished_ = true; finished_ = true;
TriggerFinish(DR_BACK); TriggerFinish(DR_BACK);

View file

@ -2,7 +2,6 @@
#include <set> #include <set>
#include <mutex> #include <mutex>
#include "base/logging.h"
#include "base/stringutil.h" #include "base/stringutil.h"
#include "base/timeutil.h" #include "base/timeutil.h"
#include "input/keycodes.h" #include "input/keycodes.h"
@ -14,6 +13,8 @@
#include "ui/viewgroup.h" #include "ui/viewgroup.h"
#include "gfx_es2/draw_buffer.h" #include "gfx_es2/draw_buffer.h"
#include "Common/Log.h"
#include <algorithm> #include <algorithm>
namespace UI { namespace UI {
@ -236,7 +237,7 @@ float GetDirectionScore(View *origin, View *destination, FocusDirection directio
float horizOverlap = HorizontalOverlap(origin->GetBounds(), destination->GetBounds()); float horizOverlap = HorizontalOverlap(origin->GetBounds(), destination->GetBounds());
float vertOverlap = VerticalOverlap(origin->GetBounds(), destination->GetBounds()); float vertOverlap = VerticalOverlap(origin->GetBounds(), destination->GetBounds());
if (horizOverlap == 1.0f && vertOverlap == 1.0f) { if (horizOverlap == 1.0f && vertOverlap == 1.0f) {
ILOG("Contain overlap"); INFO_LOG(SYSTEM, "Contain overlap");
return 0.0; return 0.0;
} }
float originSize = 0.0f; float originSize = 0.0f;
@ -273,7 +274,7 @@ float GetDirectionScore(View *origin, View *destination, FocusDirection directio
break; break;
case FOCUS_PREV: case FOCUS_PREV:
case FOCUS_NEXT: case FOCUS_NEXT:
ELOG("Invalid focus direction"); ERROR_LOG(SYSTEM, "Invalid focus direction");
break; break;
} }
@ -1083,7 +1084,7 @@ void AnchorLayout::Layout() {
GridLayout::GridLayout(GridLayoutSettings settings, LayoutParams *layoutParams) GridLayout::GridLayout(GridLayoutSettings settings, LayoutParams *layoutParams)
: ViewGroup(layoutParams), settings_(settings), numColumns_(1) { : ViewGroup(layoutParams), settings_(settings), numColumns_(1) {
if (settings.orientation != ORIENT_HORIZONTAL) if (settings.orientation != ORIENT_HORIZONTAL)
ELOG("GridLayout: Vertical layouts not yet supported"); ERROR_LOG(SYSTEM, "GridLayout: Vertical layouts not yet supported");
} }
void GridLayout::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) { void GridLayout::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) {

View file

@ -17,8 +17,10 @@
#include <stdio.h> #include <stdio.h>
#include "base/logging.h" // For OutputDebugStringUTF8
#include "headless/WindowsHeadlessHost.h" #include "headless/WindowsHeadlessHost.h"
#include "Common/Log.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/CommonWindows.h" #include "Common/CommonWindows.h"