mirror of
https://github.com/izzy2lost/WeeU.git
synced 2026-07-06 00:19:59 -07:00
Migrate force_log_printf to new logging (#714)
This commit is contained in:
@@ -166,7 +166,7 @@ std::error_code Account::Load()
|
||||
}
|
||||
catch(const std::exception& ex)
|
||||
{
|
||||
forceLog_printf("handled error in Account::Load: %s", ex.what());
|
||||
cemuLog_log(LogType::Force, "handled error in Account::Load: {}", ex.what());
|
||||
return AccountErrc::ParseError;
|
||||
}
|
||||
}
|
||||
@@ -347,7 +347,7 @@ void Account::UpdatePersisidDat()
|
||||
f.close();
|
||||
}
|
||||
else
|
||||
forceLog_printf("Unable to save persisid.dat");
|
||||
cemuLog_log(LogType::Force, "Unable to save persisid.dat");
|
||||
}
|
||||
|
||||
bool Account::HasFreeAccountSlots()
|
||||
|
||||
@@ -133,7 +133,7 @@ void LoadMainExecutable()
|
||||
// otherwise search for first file with .rpx extension in the code folder
|
||||
if (!ScanForRPX())
|
||||
{
|
||||
forceLog_printf("Unable to find RPX executable");
|
||||
cemuLog_log(LogType::Force, "Unable to find RPX executable");
|
||||
cemuLog_waitForFlush();
|
||||
cemu_assert(false);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void LoadMainExecutable()
|
||||
uint8* rpxData = fsc_extractFile(_pathToExecutable.c_str(), &rpxSize);
|
||||
if (rpxData == nullptr)
|
||||
{
|
||||
forceLog_printf("Failed to load \"%s\"", _pathToExecutable.c_str());
|
||||
cemuLog_log(LogType::Force, "Failed to load \"{}\"", _pathToExecutable);
|
||||
cemuLog_waitForFlush();
|
||||
cemu_assert(false);
|
||||
}
|
||||
@@ -383,7 +383,7 @@ void cemu_initForGame()
|
||||
RPLLoader_Link();
|
||||
RPLLoader_NotifyControlPassedToApplication();
|
||||
uint32 linkTime = GetTickCount() - linkTimeStart;
|
||||
forceLog_printf("RPL link time: %dms", linkTime);
|
||||
cemuLog_log(LogType::Force, "RPL link time: {}ms", linkTime);
|
||||
// for HBL ELF: Setup OS-specifics struct
|
||||
if (isLaunchTypeELF)
|
||||
{
|
||||
@@ -406,13 +406,13 @@ void cemu_initForGame()
|
||||
}
|
||||
debugger_handleEntryBreakpoint(_entryPoint);
|
||||
// load graphic packs
|
||||
forceLog_printf("------- Activate graphic packs -------");
|
||||
cemuLog_log(LogType::Force, "------- Activate graphic packs -------");
|
||||
GraphicPack2::ActivateForCurrentTitle();
|
||||
// print audio log
|
||||
IAudioAPI::PrintLogging();
|
||||
IAudioInputAPI::PrintLogging();
|
||||
// everything initialized
|
||||
forceLog_printf("------- Run title -------");
|
||||
cemuLog_log(LogType::Force, "------- Run title -------");
|
||||
// wait till GPU thread is initialized
|
||||
while (g_isGPUInitFinished == false) std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
// init initial thread
|
||||
|
||||
@@ -300,7 +300,7 @@ void GamePatch_scan()
|
||||
if( hleAddr )
|
||||
{
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
forceLog_printf("HLE: XCX GPU hang detection");
|
||||
cemuLog_log(LogType::Force, "HLE: XCX GPU hang detection");
|
||||
#endif
|
||||
// remove the ADDI r25, r25, 1 instruction
|
||||
memory_writeU32(hleAddr, memory_readU32(hleAddr+4));
|
||||
@@ -310,7 +310,7 @@ void GamePatch_scan()
|
||||
if( hleAddr )
|
||||
{
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
forceLog_printf("HLE: Prevent XCX rendertarget reduction");
|
||||
cemuLog_log(LogType::Force, "HLE: Prevent XCX rendertarget reduction");
|
||||
#endif
|
||||
uint32 bl = memory_readU32(hleAddr+0x14);
|
||||
uint32 func_isReductionBuffer = hleAddr + 0x14 + (bl&0x3FFFFFC);
|
||||
@@ -326,7 +326,7 @@ void GamePatch_scan()
|
||||
if (hleAddr)
|
||||
{
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
forceLog_printf("HLE: Patch BotW busy loop 1 at 0x%08x", hleAddr);
|
||||
cemuLog_log(LogType::Force, "HLE: Patch BotW busy loop 1 at 0x{:08x}", hleAddr);
|
||||
#endif
|
||||
sint32 functionIndex = hleIndex_h000000001;
|
||||
uint32 opcode = (1 << 26) | (functionIndex); // opcode for HLE: 0x1000 + FunctionIndex
|
||||
@@ -337,7 +337,7 @@ void GamePatch_scan()
|
||||
if (hleAddr)
|
||||
{
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
forceLog_printf("HLE: Patch BotW busy loop 2 at 0x%08x", hleAddr);
|
||||
cemuLog_log(LogType::Force, "HLE: Patch BotW busy loop 2 at 0x{:08x}", hleAddr);
|
||||
#endif
|
||||
sint32 functionIndex = hleIndex_h000000002;
|
||||
uint32 opcode = (1 << 26) | (functionIndex); // opcode for HLE: 0x1000 + FunctionIndex
|
||||
@@ -372,7 +372,7 @@ void GamePatch_scan()
|
||||
if (hleAddr)
|
||||
{
|
||||
uint32 patchAddr = hleAddr + 0x10;
|
||||
forceLog_printf("HLE: Patch MH3U race condition candidate at 0x%08x", patchAddr);
|
||||
cemuLog_log(LogType::Force, "HLE: Patch MH3U race condition candidate at 0x{:08x}", patchAddr);
|
||||
uint32 funcAddr = PPCInterpreter_makeCallableExportDepr(hleExport_mh3u_raceConditionWorkaround);
|
||||
// set absolute jump
|
||||
uint32 opc = 0x48000000;
|
||||
@@ -411,7 +411,7 @@ void GamePatch_scan()
|
||||
if (hleAddr)
|
||||
{
|
||||
// replace CMPL with CMP
|
||||
forceLog_printf("Patching Bayonetta 2 audio bug at: 0x%08x", hleAddr+0x34);
|
||||
cemuLog_log(LogType::Force, "Patching Bayonetta 2 audio bug at: 0x{:08x}", hleAddr+0x34);
|
||||
uint32 opc = memory_readU32(hleAddr + 0x34);
|
||||
opc &= ~(0x3FF << 1); // turn CMPL to CMP
|
||||
memory_writeU32(hleAddr + 0x34, opc);
|
||||
@@ -444,7 +444,7 @@ void GamePatch_scan()
|
||||
hleAddr = hle_locate(sm3dw_dynFrameBufferResScale, nullptr, sizeof(sm3dw_dynFrameBufferResScale));
|
||||
if (hleAddr)
|
||||
{
|
||||
forceLog_printf("Patching SM3DW dynamic resolution scaling at: 0x%08x", hleAddr);
|
||||
cemuLog_log(LogType::Force, "Patching SM3DW dynamic resolution scaling at: 0x{:08x}", hleAddr);
|
||||
memory_writeU32(hleAddr, 0x4E800020); // BLR
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ void GamePatch_scan()
|
||||
hleAddr = hle_locate(tww_waitFunc, nullptr, sizeof(tww_waitFunc));
|
||||
if (hleAddr)
|
||||
{
|
||||
forceLog_printf("Patching TWW race conditon at: 0x%08x", hleAddr);
|
||||
cemuLog_log(LogType::Force, "Patching TWW race conditon at: 0x{:08x}", hleAddr);
|
||||
// NOP calls to Lock/Unlock mutex
|
||||
memory_writeU32(hleAddr + 0x34, 0x60000000);
|
||||
memory_writeU32(hleAddr + 0x48, 0x60000000);
|
||||
@@ -462,7 +462,7 @@ void GamePatch_scan()
|
||||
}
|
||||
|
||||
uint32 hleInstallEnd = GetTickCount();
|
||||
forceLog_printf("HLE scan time: %dms", hleInstallEnd-hleInstallStart);
|
||||
cemuLog_log(LogType::Force, "HLE scan time: {}ms", hleInstallEnd-hleInstallStart);
|
||||
}
|
||||
|
||||
RunAtCemuBoot _loadGamePatchAPI([]()
|
||||
|
||||
@@ -173,7 +173,7 @@ void GraphicPack2::ActivateForCurrentTitle()
|
||||
{
|
||||
if (gp->GetPresets().empty())
|
||||
{
|
||||
forceLog_printf("Activate graphic pack: %s", gp->GetPath().c_str());
|
||||
cemuLog_log(LogType::Force, "Activate graphic pack: {}", gp->GetPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -720,7 +720,7 @@ void GraphicPack2::LoadShaders()
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
forceLog_printf("graphicPack: error while loading custom shader: %s", ex.what());
|
||||
cemuLog_log(LogType::Force, "graphicPack: error while loading custom shader: {}", ex.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -743,7 +743,7 @@ bool GraphicPack2::IsPresetVisible(const PresetPtr& preset) const
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
forceLog_printf("error when trying to check visiblity of preset: %s", ex.what());
|
||||
cemuLog_log(LogType::Force, "error when trying to check visiblity of preset: {}", ex.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -974,7 +974,7 @@ bool GraphicPack2::Activate()
|
||||
}
|
||||
catch(const std::exception& ex)
|
||||
{
|
||||
forceLog_printf((char*)ex.what());
|
||||
cemuLog_log(LogType::Force, ex.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -998,11 +998,11 @@ bool GraphicPack2::Activate()
|
||||
if (LatteTiming_getCustomVsyncFrequency(globalCustomVsyncFreq))
|
||||
{
|
||||
if (customVsyncFreq != globalCustomVsyncFreq)
|
||||
forceLog_printf("rules.txt error: Mismatching vsync frequency %d in graphic pack \'%s\'", customVsyncFreq, GetPath().c_str());
|
||||
cemuLog_log(LogType::Force, "rules.txt error: Mismatching vsync frequency {} in graphic pack \'{}\'", customVsyncFreq, GetPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
forceLog_printf("Set vsync frequency to %d (graphic pack %s)", customVsyncFreq, GetPath().c_str());
|
||||
cemuLog_log(LogType::Force, "Set vsync frequency to {} (graphic pack {})", customVsyncFreq, GetPath());
|
||||
LatteTiming_setCustomVsyncFrequency(customVsyncFreq);
|
||||
}
|
||||
}
|
||||
@@ -1255,4 +1255,4 @@ std::vector<std::pair<MPTR, MPTR>> GraphicPack2::GetActiveRAMMappings()
|
||||
return a.first < b.first;
|
||||
});
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ PATCH_RESOLVE_RESULT PatchEntryInstruction::resolveReloc(PatchContext_t& ctx, PP
|
||||
// absolute
|
||||
if (result >= 0x3FFFFFC)
|
||||
{
|
||||
forceLog_printf("Target \'%s\' for branch at line %d out of range", reloc->m_expression.c_str(), m_lineNumber);
|
||||
cemuLog_log(LogType::Force, "Target \'{}\' for branch at line {} out of range", reloc->m_expression, m_lineNumber);
|
||||
return PATCH_RESOLVE_RESULT::VALUE_ERROR;
|
||||
}
|
||||
opcode &= ~0x3FFFFFC;
|
||||
@@ -438,7 +438,7 @@ PATCH_RESOLVE_RESULT PatchEntryInstruction::resolve(PatchContext_t& ctx)
|
||||
{
|
||||
if (_relocateAddress(resolverState.currentGroup, &ctx, m_addr, m_relocatedAddr) == false)
|
||||
{
|
||||
forceLog_printf("Patches: Address 0x%08x (line %d) is not within code cave or any module section", this->getAddr(), this->m_lineNumber);
|
||||
cemuLog_log(LogType::Force, "Patches: Address 0x{:08x} (line {}) is not within code cave or any module section", this->getAddr(), this->m_lineNumber);
|
||||
cemu_assert_debug(false);
|
||||
return PATCH_RESOLVE_RESULT::INVALID_ADDRESS;
|
||||
}
|
||||
@@ -639,12 +639,12 @@ void GraphicPack2::ApplyPatchGroups(std::vector<PatchGroup*>& groups, const RPLM
|
||||
if (patchGroup->codeCaveSize > 0)
|
||||
{
|
||||
auto codeCaveMem = RPLLoader_AllocateCodeCaveMem(256, patchGroup->codeCaveSize);
|
||||
forceLog_printf("Applying patch group \'%s\' (Codecave: %08x-%08x)", patchGroup->name.c_str(), codeCaveMem.GetMPTR(), codeCaveMem.GetMPTR() + patchGroup->codeCaveSize);
|
||||
cemuLog_log(LogType::Force, "Applying patch group \'{}\' (Codecave: {:08x}-{:08x})", patchGroup->name, codeCaveMem.GetMPTR(), codeCaveMem.GetMPTR() + patchGroup->codeCaveSize);
|
||||
patchGroup->codeCaveMem = codeCaveMem;
|
||||
}
|
||||
else
|
||||
{
|
||||
forceLog_printf("Applying patch group \'%s\'", patchGroup->name.c_str());
|
||||
cemuLog_log(LogType::Force, "Applying patch group \'{}\'", patchGroup->name);
|
||||
patchGroup->codeCaveMem = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ void GraphicPack2::AddPatchGroup(PatchGroup* group)
|
||||
if (group->list_patches.size() < (numEstimatedCodeCaveInstr / 8))
|
||||
{
|
||||
// if less than 1/8th of the code cave is filled print a warning
|
||||
forceLog_printf("Graphic pack patches: Code cave for group [%s] in gfx pack \"%s\" ranges from 0 to 0x%x but has only few instructions. Is this intentional?", group->name.c_str(), this->m_name.c_str(), codeCaveMaxAddr);
|
||||
cemuLog_log(LogType::Force, "Graphic pack patches: Code cave for group [{}] in gfx pack \"{}\" ranges from 0 to 0x{:x} but has only few instructions. Is this intentional?", group->name, this->m_name, codeCaveMaxAddr);
|
||||
}
|
||||
group->codeCaveSize = codeCaveMaxAddr;
|
||||
list_patchGroups.emplace_back(group);
|
||||
|
||||
@@ -515,7 +515,7 @@ void PPCInterpreter_MTFSF(PPCInterpreter_t* hCPU, uint32 Opcode)
|
||||
static bool logFPSCRWriteOnce = false;
|
||||
if( logFPSCRWriteOnce == false )
|
||||
{
|
||||
forceLog_printf("Unsupported write to FPSCR\n");
|
||||
cemuLog_log(LogType::Force, "Unsupported write to FPSCR");
|
||||
logFPSCRWriteOnce = true;
|
||||
}
|
||||
PPCInterpreter_nextInstruction(hCPU);
|
||||
@@ -697,4 +697,4 @@ void PPCInterpreter_FCMPU(PPCInterpreter_t* hCPU, uint32 Opcode)
|
||||
fcmpu_espresso(hCPU, crfD, hCPU->fpr[frA].fp0, hCPU->fpr[frB].fp0);
|
||||
|
||||
PPCInterpreter_nextInstruction(hCPU);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ uint64 PPCTimer_estimateRDTSCFrequency()
|
||||
uint64 tsc_freq = muldiv64(tsc_diff, hrtFreq, hrtDiff);
|
||||
|
||||
// uint64 freqMultiplier = tsc_freq / hrtFreq;
|
||||
//forceLog_printf("RDTSC measurement test:");
|
||||
//forceLog_printf("TSC-diff: 0x%016llx", tsc_diff);
|
||||
//forceLog_printf("TSC-freq: 0x%016llx", tsc_freq);
|
||||
//forceLog_printf("HPC-diff: 0x%016llx", qpc_diff);
|
||||
//forceLog_printf("HPC-freq: 0x%016llx", (uint64)qpc_freq.QuadPart);
|
||||
//forceLog_printf("Multiplier: 0x%016llx", freqMultiplier);
|
||||
//cemuLog_log(LogType::Force, "RDTSC measurement test:");
|
||||
//cemuLog_log(LogType::Force, "TSC-diff: 0x{:016x}", tsc_diff);
|
||||
//cemuLog_log(LogType::Force, "TSC-freq: 0x{:016x}", tsc_freq);
|
||||
//cemuLog_log(LogType::Force, "HPC-diff: 0x{:016x}", qpc_diff);
|
||||
//cemuLog_log(LogType::Force, "HPC-freq: 0x{:016x}", (uint64)qpc_freq.QuadPart);
|
||||
//cemuLog_log(LogType::Force, "Multiplier: 0x{:016x}", freqMultiplier);
|
||||
|
||||
return tsc_freq;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void PPCRecompiler_enter(PPCInterpreter_t* hCPU, PPCREC_JUMP_ENTRY funcPtr)
|
||||
{
|
||||
auto t = std::chrono::high_resolution_clock::now();
|
||||
auto dur = std::chrono::duration_cast<std::chrono::microseconds>(t.time_since_epoch()).count();
|
||||
forceLog_printf("Recompiler exit: 0x%08x LR: 0x%08x Timestamp %lld.%04lld", hCPU->instructionPointer, hCPU->spr.LR, dur / 1000LL, (dur % 1000LL));
|
||||
cemuLog_log(LogType::Force, "Recompiler exit: 0x{:08x} LR: 0x{:08x} Timestamp {}.{:04}", hCPU->instructionPointer, hCPU->spr.LR, dur / 1000LL, (dur % 1000LL));
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
@@ -341,7 +341,7 @@ void PPCRecompiler_reserveLookupTableBlock(uint32 offset)
|
||||
void* p3 = MemMapper::AllocateMemory(&(ppcRecompilerInstanceData->ppcRecompilerDirectJumpTable[offset/4]), (PPC_REC_ALLOC_BLOCK_SIZE/4)*sizeof(void*), MemMapper::PAGE_PERMISSION::P_RW, true);
|
||||
if( !p1 || !p3 )
|
||||
{
|
||||
forceLog_printf("Failed to allocate memory for recompiler (0x%08x)", offset);
|
||||
cemuLog_log(LogType::Force, "Failed to allocate memory for recompiler (0x{:08x})", offset);
|
||||
cemu_assert(false);
|
||||
return;
|
||||
}
|
||||
@@ -584,7 +584,7 @@ void PPCRecompiler_init()
|
||||
|
||||
PPCRecompiler_initPlatform();
|
||||
|
||||
forceLog_printf("Recompiler initialized");
|
||||
cemuLog_log(LogType::Force, "Recompiler initialized");
|
||||
|
||||
ppcRecompilerEnabled = true;
|
||||
|
||||
|
||||
@@ -643,7 +643,7 @@ bool PPCRecompilerImlGen_B(ppcImlGenContext_t* ppcImlGenContext, uint32 opcode)
|
||||
{
|
||||
// generate NOP iml instead of BL macro (this assures that segment PPC range remains intact)
|
||||
PPCRecompilerImlGen_generateNewInstruction_noOp(ppcImlGenContext, NULL);
|
||||
//forceLog_printf("Inline func 0x%08x at %08x", jumpAddressDest, ppcImlGenContext->ppcAddressOfCurrentInstruction);
|
||||
//cemuLog_log(LogType::Force, "Inline func 0x{:08x} at {:08x}", jumpAddressDest, ppcImlGenContext->ppcAddressOfCurrentInstruction);
|
||||
uint32* prevInstructionPtr = ppcImlGenContext->currentInstruction;
|
||||
ppcImlGenContext->currentInstruction = (uint32*)memory_getPointerFromVirtualOffset(jumpAddressDest);
|
||||
PPCRecompiler_generateInlinedCode(ppcImlGenContext, jumpAddressDest, inlineFuncInstructionCount);
|
||||
|
||||
@@ -871,11 +871,11 @@ public:
|
||||
// retry allocation
|
||||
if (!newRange->allocateCacheMemory())
|
||||
{
|
||||
forceLog_printf("Out-of-memory in GPU buffer (trying to allocate: %dKB) Cleaning up cache...", (rangeEnd - rangeBegin + 1023) / 1024);
|
||||
cemuLog_log(LogType::Force, "Out-of-memory in GPU buffer (trying to allocate: {}KB) Cleaning up cache...", (rangeEnd - rangeBegin + 1023) / 1024);
|
||||
CleanupCacheAggressive(rangeBegin, rangeEnd);
|
||||
if (!newRange->allocateCacheMemory())
|
||||
{
|
||||
forceLog_printf("Failed to free enough memory in GPU buffer");
|
||||
cemuLog_log(LogType::Force, "Failed to free enough memory in GPU buffer");
|
||||
cemu_assert(false);
|
||||
}
|
||||
}
|
||||
@@ -907,7 +907,7 @@ public:
|
||||
// todo - add support for splitting BufferCacheNode memory allocations, then we dont need to do a separate allocation
|
||||
if (!newRange->allocateCacheMemory())
|
||||
{
|
||||
forceLog_printf("Out-of-memory in GPU buffer during split operation");
|
||||
cemuLog_log(LogType::Force, "Out-of-memory in GPU buffer during split operation");
|
||||
cemu_assert(false);
|
||||
}
|
||||
newRange->syncFromNode(nodeObject);
|
||||
|
||||
@@ -222,7 +222,7 @@ LatteParsedGSCopyShader* LatteGSCopyShaderParser_parse(uint8* programData, uint3
|
||||
}
|
||||
else
|
||||
{
|
||||
forceLog_printf("Copyshader: Unknown 23_7 clause 0x%x found\n", cf_inst23_7);
|
||||
cemuLog_log(LogType::Force, "Copyshader: Unknown 23_7 clause 0x{:x} found", cf_inst23_7);
|
||||
cemu_assert_debug(false);
|
||||
}
|
||||
if( isEndOfProgram )
|
||||
|
||||
@@ -507,7 +507,7 @@ bool LatteMRT::UpdateCurrentFBO()
|
||||
else if (rtEffectiveSize->width != effectiveWidth && rtEffectiveSize->height != effectiveHeight)
|
||||
{
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
forceLog_printf("Color buffer size mismatch (%dx%d). Effective size: %dx%d Real size: %dx%d Mismatching texture: %08x %dx%d fmt %04x", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
|
||||
cemuLog_log(LogType::Force, "Color buffer size mismatch ({}x{}). Effective size: {}x{} Real size: {}x{} Mismatching texture: {:08x} {}x{} fmt {:04x}", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
|
||||
#endif
|
||||
}
|
||||
// currently the first color attachment defines the size of the current render target
|
||||
|
||||
@@ -301,7 +301,7 @@ void LatteShader_CreateRendererShader(LatteDecompilerShader* shader, bool compil
|
||||
{
|
||||
if (shader->hasError )
|
||||
{
|
||||
forceLog_printf("Unable to compile shader %" PRIx64, shader->baseHash);
|
||||
cemuLog_log(LogType::Force, "Unable to compile shader {:016x}", shader->baseHash);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ void LatteShaderCache_load()
|
||||
if (LatteShaderCache_readSeparableShader(fileData.data(), fileData.size()) == false)
|
||||
{
|
||||
// something is wrong with the stored shader, remove entry from shader cache files
|
||||
forceLog_printf("Shader cache entry %d invalid, deleting...", loadIndex);
|
||||
cemuLog_log(LogType::Force, "Shader cache entry {} invalid, deleting...", loadIndex);
|
||||
fc_shaderCacheGeneric->DeleteFile({ name1, name2 });
|
||||
}
|
||||
numLoadedShaders++;
|
||||
@@ -338,7 +338,7 @@ void LatteShaderCache_load()
|
||||
GetProcessMemoryInfo(GetCurrentProcess(), &pmc2, sizeof(PROCESS_MEMORY_COUNTERS));
|
||||
LONGLONG totalMem2 = pmc2.PagefileUsage;
|
||||
LONGLONG memCommited = totalMem2 - totalMem1;
|
||||
forceLog_printf("Shader cache loaded with %d shaders. Commited mem %dMB. Took %dms", numLoadedShaders, (sint32)(memCommited/1024/1024), timeLoad);
|
||||
cemuLog_log(LogType::Force, "Shader cache loaded with {} shaders. Commited mem {}MB. Took {}ms", numLoadedShaders, (sint32)(memCommited/1024/1024), timeLoad);
|
||||
#endif
|
||||
LatteShaderCache_finish();
|
||||
// if Vulkan then also load pipeline cache
|
||||
|
||||
@@ -19,7 +19,7 @@ bool gxShader_checkIfSuccessfullyLinked(GLuint glProgram)
|
||||
tempLength = sizeof(infoLog)-1;
|
||||
glGetProgramInfoLog(glProgram, std::min(tempLength, infoLogLength), (GLsizei*)&tempLength, (GLcharARB*)infoLog);
|
||||
infoLog[tempLength] = '\0';
|
||||
forceLog_printf("Link error in raw shader");
|
||||
cemuLog_log(LogType::Force, "Link error in raw shader");
|
||||
cemuLog_log(LogType::Force, infoLog);
|
||||
return false;
|
||||
}
|
||||
@@ -83,8 +83,8 @@ GLuint gpu7ShaderGLDepr_compileShader(const std::string& source, uint32_t type)
|
||||
char log[2048]{};
|
||||
GLsizei log_size;
|
||||
glGetShaderInfoLog(shader_object, std::min(log_length, (GLint)sizeof(log) - 1), &log_size, log);
|
||||
forceLog_printf("Error/Warning in vertex shader:");
|
||||
forceLog_printf("%s", log);
|
||||
cemuLog_log(LogType::Force, "Error/Warning in vertex shader:");
|
||||
cemuLog_log(LogType::Force, log);
|
||||
}
|
||||
|
||||
return shader_object;
|
||||
@@ -112,8 +112,8 @@ GLuint gpu7ShaderGLDepr_compileVertexShader(const char* shaderSource, sint32 sha
|
||||
{
|
||||
char messageLog[2048]{};
|
||||
glGetShaderInfoLog(shaderObject, std::min<uint32>(shaderLogLengthInfo, sizeof(messageLog) - 1), (GLsizei*)&shaderLogLen, (GLcharARB*)messageLog);
|
||||
forceLog_printf("Error/Warning in vertex shader:");
|
||||
forceLog_printf("%s", messageLog);
|
||||
cemuLog_log(LogType::Force, "Error/Warning in vertex shader:");
|
||||
cemuLog_log(LogType::Force, messageLog);
|
||||
}
|
||||
return shaderObject;
|
||||
}
|
||||
@@ -132,8 +132,8 @@ GLuint gpu7ShaderGLDepr_compileFragmentShader(const char* shaderSource, sint32 s
|
||||
{
|
||||
memset(messageLog, 0, sizeof(messageLog));
|
||||
glGetShaderInfoLog(shaderObject, std::min<uint32>(shaderLogLengthInfo, sizeof(messageLog) - 1), (GLsizei*)&shaderLogLen, (GLcharARB*)messageLog);
|
||||
forceLog_printf("Error/Warning in fragment shader:");
|
||||
forceLog_printf("%s", messageLog);
|
||||
cemuLog_log(LogType::Force, "Error/Warning in fragment shader:");
|
||||
cemuLog_log(LogType::Force, messageLog);
|
||||
}
|
||||
return shaderObject;
|
||||
}
|
||||
|
||||
@@ -376,13 +376,13 @@ void LatteTexture_CopySlice(LatteTexture* srcTexture, sint32 srcSlice, sint32 sr
|
||||
sint32 effectiveHeight_dst = dstTexture->overwriteInfo.hasResolutionOverwrite ? dstTexture->overwriteInfo.height : dstTexture->height;
|
||||
if (cafeLog_isLoggingFlagEnabled(LOG_TYPE_TEXTURE_CACHE))
|
||||
{
|
||||
forceLog_printf("_copySlice(): Unable to sync textures with mismatching scale ratio (due to texture rule)");
|
||||
cemuLog_log(LogType::Force, "_copySlice(): Unable to sync textures with mismatching scale ratio (due to texture rule)");
|
||||
float ratioWidth_src = (float)effectiveWidth_src / (float)srcTexture->width;
|
||||
float ratioHeight_src = (float)effectiveHeight_src / (float)srcTexture->height;
|
||||
float ratioWidth_dst = (float)effectiveWidth_dst / (float)dstTexture->width;
|
||||
float ratioHeight_dst = (float)effectiveHeight_dst / (float)dstTexture->height;
|
||||
forceLog_printf("Source: %08x origResolution %4d/%4d effectiveResolution %4d/%4d fmt %04x mipIndex %d ratioW/H: %.4f/%.4f", srcTexture->physAddress, srcTexture->width, srcTexture->height, effectiveWidth_src, effectiveHeight_src, (uint32)srcTexture->format, srcMip, ratioWidth_src, ratioHeight_src);
|
||||
forceLog_printf("Destination: %08x origResolution %4d/%4d effectiveResolution %4d/%4d fmt %04x mipIndex %d ratioW/H: %.4f/%.4f", dstTexture->physAddress, dstTexture->width, dstTexture->height, effectiveWidth_dst, effectiveHeight_dst, (uint32)dstTexture->format, dstMip, ratioWidth_dst, ratioHeight_dst);
|
||||
cemuLog_log(LogType::Force, "Source: {:08x} origResolution {:4}/{:4} effectiveResolution {:4}/{:4} fmt {:04x} mipIndex {} ratioW/H: {:.4}/{:.4}", srcTexture->physAddress, srcTexture->width, srcTexture->height, effectiveWidth_src, effectiveHeight_src, (uint32)srcTexture->format, srcMip, ratioWidth_src, ratioHeight_src);
|
||||
cemuLog_log(LogType::Force, "Destination: {:08x} origResolution {:4}/{:4} effectiveResolution {:4}/{:4} fmt {:04x} mipIndex {} ratioW/H: {:.4}/{:.4}", dstTexture->physAddress, dstTexture->width, dstTexture->height, effectiveWidth_dst, effectiveHeight_dst, (uint32)dstTexture->format, dstMip, ratioWidth_dst, ratioHeight_dst);
|
||||
}
|
||||
//forceLogDebug_printf("If these textures are not meant to share data you can ignore this");
|
||||
return;
|
||||
|
||||
@@ -661,7 +661,7 @@ void LatteTextureLoader_UpdateTextureSliceData(LatteTexture* tex, sint32 texture
|
||||
uint64 benchmarkResultMicroSeconds = (benchmark_end.QuadPart - benchmark_begin.QuadPart) * 1000000ULL / benchmark_freq.QuadPart;
|
||||
textureDecodeBenchmark_perFormatSum[(int)tex->format & 0x3F] += benchmarkResultMicroSeconds;
|
||||
textureDecodeBenchmark_totalSum += benchmarkResultMicroSeconds;
|
||||
forceLog_printf("TexDecode %04dx%04dx%04d Fmt %04x Dim %d TileMode %02x Took %03d.%03dms Sum(format) %06dms Sum(total) %06dms", textureLoader.width, textureLoader.height, textureLoader.surfaceInfoDepth, (int)tex->format, (int)tex->dim, textureLoader.tileMode, (uint32)(benchmarkResultMicroSeconds / 1000ULL), (uint32)(benchmarkResultMicroSeconds % 1000ULL), (uint32)(textureDecodeBenchmark_perFormatSum[tex->gx2Format & 0x3F] / 1000ULL), (uint32)(textureDecodeBenchmark_totalSum / 1000ULL));
|
||||
cemuLog_log(LogType::Force, "TexDecode {:04}x{:04}x{:04} Fmt {:04x} Dim {} TileMode {:02x} Took {:03}.{:03}ms Sum(format) {:06}ms Sum(total) {:06}ms", textureLoader.width, textureLoader.height, textureLoader.surfaceInfoDepth, (int)tex->format, (int)tex->dim, textureLoader.tileMode, (uint32)(benchmarkResultMicroSeconds / 1000ULL), (uint32)(benchmarkResultMicroSeconds % 1000ULL), (uint32)(textureDecodeBenchmark_perFormatSum[tex->gx2Format & 0x3F] / 1000ULL), (uint32)(textureDecodeBenchmark_totalSum / 1000ULL));
|
||||
#endif
|
||||
|
||||
// convert texture to RGBA when dumping is enabled
|
||||
@@ -738,11 +738,11 @@ void LatteTextureLoader_writeReadbackTextureToMemory(LatteTextureDefinition* tex
|
||||
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
if (textureData->depth != 1)
|
||||
forceLog_printf("_writeReadbackTextureToMemory(): Texture has multiple slices (not supported)");
|
||||
cemuLog_log(LogType::Force, "_writeReadbackTextureToMemory(): Texture has multiple slices (not supported)");
|
||||
#endif
|
||||
if (textureLoader.physAddress == MPTR_NULL)
|
||||
{
|
||||
forceLog_printf("_writeReadbackTextureToMemory(): Texture has invalid address");
|
||||
cemuLog_log(LogType::Force, "_writeReadbackTextureToMemory(): Texture has invalid address");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ void LatteTextureReadback_Initate(LatteTextureView* textureView)
|
||||
// currently we don't support readback for resized textures
|
||||
if (textureView->baseTexture->overwriteInfo.hasResolutionOverwrite)
|
||||
{
|
||||
forceLog_printf("_initate(): Readback is not supported for textures with modified resolution");
|
||||
cemuLog_log(LogType::Force, "_initate(): Readback is not supported for textures with modified resolution");
|
||||
return;
|
||||
}
|
||||
// check if texture isn't already queued for transfer
|
||||
@@ -128,7 +128,7 @@ void LatteTextureReadback_UpdateFinishedTransfers(bool forceFinish)
|
||||
HRTick currentTick = HighResolutionTimer().now().getTick();
|
||||
double elapsedSecondsTransfer = HighResolutionTimer::getTimeDiff(readbackInfo->transferStartTime, currentTick);
|
||||
double elapsedSecondsWaiting = HighResolutionTimer::getTimeDiff(readbackInfo->waitStartTime, currentTick);
|
||||
forceLog_printf("[Texture-Readback] %08x Res %4d/%4d TM %d FMT %04x ReadbackLatency: %6.3lfms WaitTime: %6.3lfms ForcedWait %s", readbackInfo->hostTextureCopy.physAddress, readbackInfo->hostTextureCopy.width, readbackInfo->hostTextureCopy.height, readbackInfo->hostTextureCopy.tileMode, (uint32)readbackInfo->hostTextureCopy.format, elapsedSecondsTransfer * 1000.0, elapsedSecondsWaiting * 1000.0, forceFinish?"yes":"no");
|
||||
cemuLog_log(LogType::Force, "[Texture-Readback] {:08x} Res {:4}/{:4} TM {} FMT {:04x} ReadbackLatency: {:6.3}ms WaitTime: {:6.3}ms ForcedWait {}", readbackInfo->hostTextureCopy.physAddress, readbackInfo->hostTextureCopy.width, readbackInfo->hostTextureCopy.height, readbackInfo->hostTextureCopy.tileMode, (uint32)readbackInfo->hostTextureCopy.format, elapsedSecondsTransfer * 1000.0, elapsedSecondsWaiting * 1000.0, forceFinish?"yes":"no");
|
||||
#endif
|
||||
uint8* pixelData = readbackInfo->GetData();
|
||||
LatteTextureLoader_writeReadbackTextureToMemory(&readbackInfo->hostTextureCopy, 0, 0, pixelData);
|
||||
|
||||
@@ -125,7 +125,7 @@ void LatteTextureGL::GetOpenGLFormatInfo(bool isDepth, Latte::E_GX2SURFFMT forma
|
||||
return;
|
||||
}
|
||||
// unsupported depth format
|
||||
forceLog_printf("OpenGL: Unsupported texture depth format 0x%04x", (uint32)format);
|
||||
cemuLog_log(LogType::Force, "OpenGL: Unsupported texture depth format 0x{:04x}", (uint32)format);
|
||||
// use placeholder format
|
||||
formatInfoOut->setDepthFormat(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false);
|
||||
formatInfoOut->markAsAlternativeFormat();
|
||||
@@ -499,7 +499,7 @@ void LatteTextureGL::GetOpenGLFormatInfo(bool isDepth, Latte::E_GX2SURFFMT forma
|
||||
}
|
||||
else
|
||||
{
|
||||
forceLog_printf("OpenGL: Unsupported texture format 0x%04x", (uint32)format);
|
||||
cemuLog_log(LogType::Force, "OpenGL: Unsupported texture format 0x{:04x}", (uint32)format);
|
||||
cemu_assert_unimplemented();
|
||||
}
|
||||
formatInfoOut->glInternalFormat = glInternalFormat;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user