mirror of https://github.com/zeldaret/botw.git
ksys/res: Implement more ResourceMgrTask functions
This commit is contained in:
parent
f3c3332cef
commit
737ea79669
|
@ -93105,7 +93105,7 @@ Address,Quality,Size,Name
|
|||
0x0000007101203914,U,000228,
|
||||
0x00000071012039f8,O,000032,_ZN4ksys3res15ResourceMgrTask11setInstanceEPS1_
|
||||
0x0000007101203a18,O,001572,_ZN4ksys3res15ResourceMgrTaskC1ERKN4sead16TaskConstructArgE
|
||||
0x000000710120403c,U,000024,res::System::calc
|
||||
0x000000710120403c,O,000024,_ZN4ksys3res15ResourceMgrTask15callSystemCalc_EPv
|
||||
0x0000007101204054,O,001492,_ZN4ksys3res15ResourceMgrTaskD1Ev
|
||||
0x0000007101204628,O,000036,_ZN4ksys3res15ResourceMgrTaskD0Ev
|
||||
0x000000710120464c,U,004876,res::ResourceMgrTask::prepare
|
||||
|
@ -93142,12 +93142,12 @@ Address,Quality,Size,Name
|
|||
0x0000007101206d14,U,000064,res::ResourceMgrTask::jamThreadMessageQueuesAndWait
|
||||
0x0000007101206d54,U,000016,res::ResourceMgrTask::__auto12
|
||||
0x0000007101206d64,U,000016,
|
||||
0x0000007101206d74,U,000288,res::ResourceMgrTask::calc_
|
||||
0x0000007101206e94,U,000196,res::System::calc_
|
||||
0x0000007101206f58,U,000380,res::ResourceMgrTask::oo
|
||||
0x0000007101206d74,O,000288,_ZN4ksys3res15ResourceMgrTask11clearUnits_Ev
|
||||
0x0000007101206e94,O,000196,_ZN4ksys3res15ResourceMgrTask11systemCalc_Ev
|
||||
0x0000007101206f58,U,000380,_ZN4ksys3res15ResourceMgrTask16updateCompactionEv
|
||||
0x00000071012070d4,O,000024,_ZNK4ksys3res15ResourceMgrTask19isCompactionStoppedEv
|
||||
0x00000071012070ec,U,000036,res::ResourceMgrTask::submitCalcRequest
|
||||
0x0000007101207110,U,000020,res::ResourceMgrTask::postCalc
|
||||
0x00000071012070ec,O,000036,_ZN4ksys3res15ResourceMgrTask11requestCalcEv
|
||||
0x0000007101207110,O,000020,_ZN4ksys3res15ResourceMgrTask11waitForCalcEv
|
||||
0x0000007101207124,O,000288,_ZN4ksys3res15ResourceMgrTask14clearAllCachesEPNS_12OverlayArenaE
|
||||
0x0000007101207244,U,000032,res::ResourceMgrTask::BinderArray::getTexHandleMgrArena
|
||||
0x0000007101207264,O,000024,_ZN4ksys3res18ControlTaskRequestD2Ev
|
||||
|
|
Can't render this file because it is too large.
|
|
@ -4,6 +4,7 @@
|
|||
#include <resource/seadResourceMgr.h>
|
||||
#include <resource/seadSZSDecompressor.h>
|
||||
#include <thread/seadThreadUtil.h>
|
||||
#include "KingSystem/Framework/frmWorkerSupportThreadMgr.h"
|
||||
#include "KingSystem/Resource/resCache.h"
|
||||
#include "KingSystem/Resource/resCompactedHeap.h"
|
||||
#include "KingSystem/Resource/resEntryFactory.h"
|
||||
|
@ -414,6 +415,11 @@ bool ResourceMgrTask::calc_(void*) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ResourceMgrTask::callSystemCalc_(void* userdata) {
|
||||
systemCalc_();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ResourceMgrTask::dropSFromExtensionIfNeeded(const sead::SafeString& path,
|
||||
sead::BufferedSafeString& new_path, s32 dot_idx,
|
||||
const sead::SafeString& extension) const {
|
||||
|
@ -633,6 +639,41 @@ bool ResourceMgrTask::getUncompressedSize(u32* size, const sead::SafeString& pat
|
|||
return true;
|
||||
}
|
||||
|
||||
void ResourceMgrTask::clearUnits_() {
|
||||
const auto lock = sead::makeScopedLock(mUnitsCS);
|
||||
|
||||
const int num_units = mUnits.size();
|
||||
if (num_units != 0 && returnFalse())
|
||||
stubbedLogFunction();
|
||||
|
||||
for (auto it = mUnits.robustBegin(), end = mUnits.robustEnd(); it != end; ++it) {
|
||||
ResourceUnit* unit = &*it;
|
||||
if (it->mTask3.canSubmitRequest()) {
|
||||
mUnits.erase(unit);
|
||||
requestClearCache(&unit);
|
||||
}
|
||||
}
|
||||
|
||||
if (mUnits.size() != 0 || (num_units != 0 && returnFalse()))
|
||||
stubbedLogFunction();
|
||||
}
|
||||
|
||||
void ResourceMgrTask::systemCalc_() {
|
||||
if (mTask1->canSubmitRequest()) {
|
||||
util::TaskRequest request;
|
||||
request.mSynchronous = false;
|
||||
request.mHasHandle = false;
|
||||
request.mLaneId = u8(LaneId::_6);
|
||||
request.mThread = mResourceControlThread;
|
||||
request.mName = "res::System::calc";
|
||||
mTask1->submitRequest(request);
|
||||
}
|
||||
|
||||
mTexHandleMgr->preCalc();
|
||||
updateCompaction();
|
||||
mTexHandleMgr->calc();
|
||||
}
|
||||
|
||||
// reordering
|
||||
#ifdef NON_MATCHING
|
||||
void ResourceMgrTask::setCompactionStopped(bool stopped) {
|
||||
|
@ -652,6 +693,14 @@ bool ResourceMgrTask::isCompactionStopped() const {
|
|||
return mCompactionCounter == 0;
|
||||
}
|
||||
|
||||
void ResourceMgrTask::requestCalc() {
|
||||
frm::WorkerSupportThreadMgr::instance()->submitRequest(2, &mSystemCalcFn);
|
||||
}
|
||||
|
||||
void ResourceMgrTask::waitForCalc() {
|
||||
frm::WorkerSupportThreadMgr::instance()->waitForTask(2);
|
||||
}
|
||||
|
||||
bool ResourceMgrTask::initTempResourceLoader(TempResourceLoader* loader,
|
||||
TempResourceLoader::InitArg& arg) {
|
||||
arg.work = mTexHandleMgr->getArchiveWork();
|
||||
|
|
|
@ -219,9 +219,13 @@ public:
|
|||
bool getUncompressedSize(u32* size, const sead::SafeString& path,
|
||||
sead::FileDevice* device) const;
|
||||
|
||||
void updateCompaction();
|
||||
void setCompactionStopped(bool stopped);
|
||||
bool isCompactionStopped() const;
|
||||
|
||||
void requestCalc();
|
||||
void waitForCalc();
|
||||
|
||||
bool initTempResourceLoader(TempResourceLoader* loader, TempResourceLoader::InitArg& arg);
|
||||
|
||||
bool returnTrue1();
|
||||
|
@ -290,6 +294,7 @@ private:
|
|||
~ResourceMgrTask();
|
||||
|
||||
bool calc_(void* userdata);
|
||||
void systemCalc_();
|
||||
bool callSystemCalc_(void* userdata);
|
||||
void clearUnits_();
|
||||
static void setInstance(ResourceMgrTask* task);
|
||||
|
|
|
@ -9,6 +9,9 @@ class TextureHandleMgr {
|
|||
public:
|
||||
virtual ~TextureHandleMgr();
|
||||
|
||||
void preCalc();
|
||||
void calc();
|
||||
|
||||
ArchiveWork* getArchiveWork() const;
|
||||
void clearAllCache();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue