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
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
}

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;
}

View File

@ -62,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);
}
}

View File

@ -400,7 +400,7 @@ void Arm64RegCacheFPU::FlushAll() {
if (ar[a].isDirty) {
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;
}
@ -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;

View File

@ -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();

View File

@ -23,6 +23,7 @@
#include <map>
#include "gfx/d3d9_shader.h"
#include "base/logging.h" // For OutputDebugStringUTF8
#include "base/stringutil.h"
#include "i18n/i18n.h"
#include "math/lin/matrix4x4.h"
@ -32,6 +33,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"

View File

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

View File

@ -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);

View File

@ -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_);

View File

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

View File

@ -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;
@ -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;
}

View File

@ -34,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"
@ -581,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;
@ -608,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) {
@ -621,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;

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"));

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;

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;
}

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);

View File

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

View File

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

View File

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

View File

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

View File

@ -114,7 +114,7 @@ void GLRenderManager::ThreadStart(Draw::DrawContext *draw) {
renderThreadId = std::this_thread::get_id();
if (newInflightFrames_ != -1) {
ILOG("Updating inflight frames to %d", newInflightFrames_);
INFO_LOG(G3D, "Updating inflight frames to %d", newInflightFrames_);
inflightFrames_ = newInflightFrames_;
newInflightFrames_ = -1;
}
@ -154,7 +154,7 @@ void GLRenderManager::ThreadStart(Draw::DrawContext *draw) {
}
void GLRenderManager::ThreadEnd() {
ILOG("ThreadEnd");
INFO_LOG(G3D, "ThreadEnd");
// Wait for any shutdown to complete in StopThread().
std::unique_lock<std::mutex> lock(mutex_);
@ -217,7 +217,7 @@ bool GLRenderManager::ThreadFrame() {
}
VLOG("PULL: Running frame %d", threadFrame_);
if (firstFrame) {
ILOG("Running first frame (%d)", threadFrame_);
INFO_LOG(G3D, "Running first frame (%d)", threadFrame_);
firstFrame = false;
}
Run(threadFrame_);
@ -246,7 +246,7 @@ void GLRenderManager::StopThread() {
// Wait until we've definitely stopped the threadframe.
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.
Wipe();
@ -274,7 +274,7 @@ void GLRenderManager::StopThread() {
}
}
} 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.
VLOG("PUSH: BeginFrame %d", curFrame);
if (!run_) {
WLOG("BeginFrame while !run_!");
WARN_LOG(G3D, "BeginFrame while !run_!");
}
// vulkan_->BeginFrame();

View File

@ -2,7 +2,6 @@
#include <cstring>
#include <cstdint>
#include "base/logging.h"
#include "base/display.h"
#include "thin3d/thin3d.h"
#include "Common/Log.h"
@ -92,7 +91,7 @@ bool RefCountedObject::ReleaseAssertLast() {
return true;
}
} 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;
}

View File

@ -12,7 +12,6 @@
#include <string>
#include <vector>
#include "base/logging.h"
#include "DataFormat.h"
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) {
if (language != ShaderLanguage::HLSL_D3D11) {
ELOG("Unsupported shader language");
ERROR_LOG(G3D, "Unsupported shader language");
return nullptr;
}
@ -915,7 +915,7 @@ ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLang
}
if (errorMsgs) {
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();
}
@ -940,7 +940,7 @@ ShaderModule *D3D11DrawContext::CreateShaderModule(ShaderStage stage, ShaderLang
result = device_->CreateGeometryShader(data, dataSize, nullptr, &module->gs);
break;
default:
ELOG("Unsupported shader stage");
ERROR_LOG(G3D, "Unsupported shader stage");
result = S_FALSE;
break;
}

View File

@ -33,11 +33,12 @@
#define D3DXERR_INVALIDDATA 0x88760b59
#endif
#include "base/logging.h"
#include "math/lin/matrix4x4.h"
#include "thin3d/thin3d.h"
#include "gfx/d3d9_state.h"
#include "Common/Log.h"
namespace Draw {
// Could be declared as u8
@ -381,7 +382,7 @@ bool D3D9Texture::Create(const TextureDesc &desc) {
break;
}
if (FAILED(hr)) {
ELOG("Texture creation failed");
ERROR_LOG(G3D, "Texture creation failed");
return false;
}
@ -476,7 +477,7 @@ void D3D9Texture::SetImageData(int x, int y, int z, int width, int height, int d
}
default:
ELOG("Non-LINEAR2D textures not yet supported");
ERROR_LOG(G3D, "Non-LINEAR2D textures not yet supported");
break;
}
}
@ -636,7 +637,7 @@ private:
D3D9Context::D3D9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapterId, IDirect3DDevice9 *device, IDirect3DDevice9Ex *deviceEx)
: d3d_(d3d), d3dEx_(d3dEx), adapterId_(adapterId), device_(device), deviceEx_(deviceEx), caps_{} {
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) {
case 0x10DE: caps_.vendor = GPUVendor::VENDOR_NVIDIA; break;
@ -691,13 +692,13 @@ ShaderModule *D3D9Context::CreateShaderModule(ShaderStage stage, ShaderLanguage
Pipeline *D3D9Context::CreateGraphicsPipeline(const PipelineDesc &desc) {
if (!desc.shaders.size()) {
ELOG("Pipeline requires at least one shader");
ERROR_LOG(G3D, "Pipeline requires at least one shader");
return NULL;
}
D3D9Pipeline *pipeline = new D3D9Pipeline(device_);
for (auto iter : desc.shaders) {
if (!iter) {
ELOG("NULL shader passed to CreateGraphicsPipeline");
ERROR_LOG(G3D, "NULL shader passed to CreateGraphicsPipeline");
delete pipeline;
return NULL;
}
@ -856,7 +857,7 @@ D3D9InputLayout::D3D9InputLayout(LPDIRECT3DDEVICE9 device, const InputLayoutDesc
HRESULT hr = device->CreateVertexDeclaration(elements, &decl_);
if (FAILED(hr)) {
ELOG("Error creating vertex decl");
ERROR_LOG(G3D, "Error creating vertex decl");
}
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) {
if (size != curPipeline_->dynamicUniforms.uniformBufferSize)
Crash();
_assert_(size == curPipeline_->dynamicUniforms.uniformBufferSize);
for (auto &uniform : curPipeline_->dynamicUniforms.uniforms) {
int count = 0;
switch (uniform.type) {
@ -935,7 +935,7 @@ void D3D9Context::UpdateBuffer(Buffer *buffer, const uint8_t *data, size_t offse
if (!size)
return;
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;
}
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);
if (FAILED(rtResult)) {
ELOG("Failed to create render target");
ERROR_LOG(G3D, "Failed to create render target");
delete fbo;
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);
}
if (FAILED(dsResult)) {
ELOG("Failed to create depth buffer");
ERROR_LOG(G3D, "Failed to create depth buffer");
fbo->surf->Release();
fbo->tex->Release();
if (fbo->depthstenciltex) {
@ -1264,13 +1264,13 @@ DrawContext *T3DCreateDX9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapt
#if PPSSPP_API(D3DX9)
int d3dx_ver = LoadD3DX9Dynamic();
if (!d3dx_ver) {
ELOG("Failed to load D3DX9!");
ERROR_LOG(G3D, "Failed to load D3DX9!");
return NULL;
}
#elif PPSSPP_API(D3D9_D3DCOMPILER)
bool result = LoadD3DCompilerDynamic();
if (!result) {
ELOG("Failed to load D3DCompiler!");
ERROR_LOG(G3D, "Failed to load D3DCompiler!");
return NULL;
}
#endif

View File

@ -4,7 +4,6 @@
#include <algorithm>
#include <map>
#include "base/logging.h"
#include "math/dataconv.h"
#include "math/math_util.h"
#include "math/lin/matrix4x4.h"
@ -230,7 +229,7 @@ GLuint ShaderStageToOpenGL(ShaderStage stage) {
class OpenGLShaderModule : public ShaderModule {
public:
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);
}
@ -644,7 +643,7 @@ GLuint TypeToTarget(TextureType type) {
#endif
case TextureType::ARRAY2D: return GL_TEXTURE_2D_ARRAY;
default:
ELOG("Bad texture type %d", (int)type);
ERROR_LOG(G3D, "Bad texture type %d", (int)type);
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) {
if (!desc.shaders.size()) {
ELOG("Pipeline requires at least one shader");
ERROR_LOG(G3D, "Pipeline requires at least one shader");
return nullptr;
}
if ((int)desc.prim >= (int)Primitive::PRIMITIVE_TYPE_COUNT) {
ELOG("Invalid primitive type");
ERROR_LOG(G3D, "Invalid primitive type");
return nullptr;
}
if (!desc.depthStencil || !desc.blend || !desc.raster || !desc.inputLayout) {
ELOG("Incomplete prim desciption");
ERROR_LOG(G3D, "Incomplete prim desciption");
return nullptr;
}
@ -975,7 +974,7 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
iter->AddRef();
pipeline->shaders.push_back(static_cast<OpenGLShaderModule *>(iter));
} 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;
return nullptr;
}
@ -997,7 +996,7 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
pipeline->inputLayout->AddRef();
return pipeline;
} else {
ELOG("Failed to create pipeline - shaders failed to link");
ERROR_LOG(G3D, "Failed to create pipeline - shaders failed to link");
delete pipeline;
return nullptr;
}
@ -1059,11 +1058,11 @@ bool OpenGLPipeline::LinkShaders() {
if (shader) {
linkShaders.push_back(shader);
} else {
ELOG("LinkShaders: Bad shader module");
ERROR_LOG(G3D, "LinkShaders: Bad shader module");
return false;
}
} else {
ELOG("LinkShaders: Bad shader in module");
ERROR_LOG(G3D, "LinkShaders: Bad shader in module");
return false;
}
}
@ -1213,7 +1212,7 @@ void OpenGLInputLayout::Compile(const InputLayoutDesc &desc) {
break;
case DataFormat::UNDEFINED:
default:
ELOG("Thin3DGLVertexFormat: Invalid or unknown component type applied.");
ERROR_LOG(G3D, "Thin3DGLVertexFormat: Invalid or unknown component type applied.");
break;
}

View File

@ -21,9 +21,6 @@
#include <map>
#include <cassert>
#include "Core/Config.h"
#include "base/logging.h"
#include "base/display.h"
#include "base/stringutil.h"
#include "image/zim_load.h"
@ -32,10 +29,13 @@
#include "thin3d/thin3d.h"
#include "thin3d/VulkanRenderManager.h"
#include "Common/Log.h"
#include "Common/Vulkan/VulkanContext.h"
#include "Common/Vulkan/VulkanImage.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.
// binding 0 - uniform data
// binding 1 - sampler
@ -704,7 +704,7 @@ bool VKTexture::Create(VkCommandBuffer cmd, VulkanPushBuffer *push, const Textur
// Zero-sized textures not allowed.
_assert_(desc.width * desc.height * desc.depth > 0); // remember to set depth to 1!
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;
}
_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)) {
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;
}
if (desc.initData.size()) {
@ -1038,7 +1038,7 @@ Pipeline *VKContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
for (auto &iter : desc.shaders) {
VKShaderModule *vkshader = (VKShaderModule *)iter;
if (!vkshader) {
ELOG("CreateGraphicsPipeline got passed a null shader");
ERROR_LOG(G3D, "CreateGraphicsPipeline got passed a null shader");
return nullptr;
}
VkPipelineShaderStageCreateInfo &stage = stages[i++];
@ -1100,7 +1100,7 @@ Pipeline *VKContext::CreateGraphicsPipeline(const PipelineDesc &desc) {
VkPipeline pipelines[2]{};
VkResult result = vkCreateGraphicsPipelines(device_, pipelineCache_, 2, createInfo, nullptr, pipelines);
if (result != VK_SUCCESS) {
ELOG("Failed to create graphics pipeline");
ERROR_LOG(G3D, "Failed to create graphics pipeline");
delete pipeline;
return nullptr;
}
@ -1177,14 +1177,14 @@ Texture *VKContext::CreateTexture(const TextureDesc &desc) {
VkCommandBuffer initCmd = renderManager_.GetInitCmd();
if (!push_ || !initCmd) {
// 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;
}
VKTexture *tex = new VKTexture(vulkan_, initCmd, push_, desc);
if (tex->Create(initCmd, push_, desc, allocator_)) {
return tex;
} else {
ELOG("Failed to create texture");
ERROR_LOG(G3D, "Failed to create texture");
delete tex;
return nullptr;
}
@ -1271,7 +1271,7 @@ ShaderModule *VKContext::CreateShaderModule(ShaderStage stage, ShaderLanguage la
if (shader->Compile(vulkan_, language, data, size)) {
return shader;
} else {
ELOG("Failed to compile shader: %s", (const char *)data);
ERROR_LOG(G3D, "Failed to compile shader: %s", (const char *)data);
shader->Release();
return nullptr;
}

View File

@ -1,13 +1,14 @@
#include <functional>
#include <thread>
#include "base/logging.h"
#include "base/timeutil.h"
#include "thread/prioritizedworkqueue.h"
#include "Common/Log.h"
PrioritizedWorkQueue::~PrioritizedWorkQueue() {
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();
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/threadutil.h"
#include "Common/Log.h"
#include "Common/MakeUnique.h"
///////////////////////////// WorkerThread
@ -86,9 +87,9 @@ void LoopWorkerThread::WorkFunc() {
ThreadPool::ThreadPool(int numThreads) {
if (numThreads <= 0) {
numThreads_ = 1;
ILOG("ThreadPool: Bad number of threads %i", numThreads);
INFO_LOG(JIT, "ThreadPool: Bad number of threads %d", numThreads);
} 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;
} else {
numThreads_ = numThreads;

View File

@ -8,10 +8,13 @@
#define TLS_SUPPORTED
#endif
#include <cstring>
#include "base/basictypes.h"
#include "base/logging.h"
#include "thread/threadutil.h"
#include "Common/Log.h"
#if defined(__ANDROID__) || defined(__APPLE__) || (defined(__GLIBC__) && defined(_GNU_SOURCE))
#include <pthread.h>
#endif
@ -115,7 +118,7 @@ void setCurrentThreadName(const char* threadName) {
void AssertCurrentThreadName(const char *threadName) {
#ifdef TLS_SUPPORTED
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
}

View File

@ -7,6 +7,8 @@
#include "ui/root.h"
#include "ui/viewgroup.h"
#include "Common/Log.h"
namespace UI {
static std::mutex focusLock;
@ -109,7 +111,7 @@ bool IsFocusMovementEnabled() {
void LayoutViewHierarchy(const UIContext &dc, ViewGroup *root, bool ignoreInsets) {
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;
}
@ -358,7 +360,7 @@ void UpdateViewHierarchy(ViewGroup *root) {
frameCount++;
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;
}

View File

@ -1,5 +1,4 @@
#include "base/display.h"
#include "base/logging.h"
#include "base/timeutil.h"
#include "input/input_state.h"
#include "ui/root.h"
@ -7,6 +6,8 @@
#include "ui/ui.h"
#include "ui/view.h"
#include "Common/Log.h"
ScreenManager::ScreenManager() {
uiContext_ = 0;
dialogFinished_ = 0;
@ -18,7 +19,7 @@ ScreenManager::~ScreenManager() {
void ScreenManager::switchScreen(Screen *screen) {
if (!nextStack_.empty() && screen == nextStack_.front().screen) {
ELOG("Already switching to this screen");
ERROR_LOG(SYSTEM, "Already switching to this screen");
return;
}
// 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.
// TODO: is this still true?
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;
return;
}
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) {
screen->setScreenManager(this);
@ -53,7 +54,7 @@ void ScreenManager::update() {
void ScreenManager::switchToNext() {
std::lock_guard<std::recursive_mutex> guard(inputLock_);
if (nextStack_.empty()) {
ELOG("switchToNext: No nextStack_!");
ERROR_LOG(SYSTEM, "switchToNext: No nextStack_!");
}
Layer temp = {nullptr, 0};
@ -128,7 +129,7 @@ void ScreenManager::deviceRestored() {
}
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_);
// Have to notify the whole stack, otherwise there will be problems when going back
// to non-top screens.
@ -143,7 +144,7 @@ void ScreenManager::render() {
case LAYER_SIDEMENU:
case LAYER_TRANSPARENT:
if (stack_.size() == 1) {
ELOG("Can't have sidemenu over nothing");
ERROR_LOG(SYSTEM, "Can't have sidemenu over nothing");
break;
} else {
auto iter = stack_.end();
@ -170,7 +171,7 @@ void ScreenManager::render() {
break;
}
} else {
ELOG("No current screen!");
ERROR_LOG(SYSTEM, "No current screen!");
}
processFinishDialog();
@ -235,7 +236,7 @@ void ScreenManager::pop() {
delete stack_.back().screen;
stack_.pop_back();
} 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) {
if (stack_.empty()) {
ELOG("Must be in a dialog to finishDialog");
ERROR_LOG(SYSTEM, "Must be in a dialog to finishDialog");
return;
}
if (dialog != stack_.back().screen) {
ELOG("Wrong dialog being finished!");
ERROR_LOG(SYSTEM, "Wrong dialog being finished!");
return;
}
dialog->onFinish(result);
@ -283,10 +284,10 @@ void ScreenManager::processFinishDialog() {
}
if (!caller) {
ELOG("ERROR: no top screen when finishing dialog");
ERROR_LOG(SYSTEM, "ERROR: no top screen when finishing dialog");
} else if (caller != topScreen()) {
// 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 {
caller->dialogFinished(dialogFinished_, dialogResult_);
}

View File

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

View File

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

View File

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

View File

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