mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 16:30:30 +02:00
Merge pull request #17392 from hrydgard/misc-crash-fixes
Misc crash fixes from mystery thread
This commit is contained in:
4 files changed
+9
-5
No files matched your search
@@ -456,13 +456,13 @@ public:
|
||||
void Invalidate(InvalidationFlags flags);
|
||||
|
||||
void ResetStats();
|
||||
void DrainCompileQueue();
|
||||
|
||||
private:
|
||||
void EndCurRenderStep();
|
||||
|
||||
void ThreadFunc();
|
||||
void CompileThreadFunc();
|
||||
void DrainCompileQueue();
|
||||
|
||||
void Run(VKRRenderThreadTask &task);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ static uint64_t HashJitBlock(const JitBlock &b) {
|
||||
}
|
||||
|
||||
JitBlockCache::JitBlockCache(MIPSState *mipsState, CodeBlockCommon *codeBlock) :
|
||||
codeBlock_(codeBlock), blocks_(nullptr), num_blocks_(0) {
|
||||
codeBlock_(codeBlock) {
|
||||
}
|
||||
|
||||
JitBlockCache::~JitBlockCache() {
|
||||
@@ -90,7 +90,8 @@ bool JitBlock::ContainsAddress(u32 em_address) {
|
||||
}
|
||||
|
||||
bool JitBlockCache::IsFull() const {
|
||||
return num_blocks_ >= MAX_NUM_BLOCKS - 1;
|
||||
// -10 to safely leave space for some proxy blocks, which we don't check before we allocate (not ideal, but should work).
|
||||
return num_blocks_ >= MAX_NUM_BLOCKS - 10;
|
||||
}
|
||||
|
||||
void JitBlockCache::Init() {
|
||||
|
||||
@@ -184,10 +184,10 @@ private:
|
||||
MIPSOpcode GetEmuHackOpForBlock(int block_num) const;
|
||||
|
||||
CodeBlockCommon *codeBlock_;
|
||||
JitBlock *blocks_;
|
||||
JitBlock *blocks_ = nullptr;
|
||||
std::unordered_multimap<u32, int> proxyBlockMap_;
|
||||
|
||||
int num_blocks_;
|
||||
int num_blocks_ = 0;
|
||||
std::unordered_multimap<u32, int> links_to_;
|
||||
std::map<std::pair<u32,u32>, u32> block_map_; // (end_addr, start_addr) -> number
|
||||
|
||||
|
||||
@@ -182,6 +182,9 @@ void GPU_Vulkan::SaveCache(const Path &filename) {
|
||||
}
|
||||
|
||||
GPU_Vulkan::~GPU_Vulkan() {
|
||||
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
rm->DrainCompileQueue();
|
||||
|
||||
SaveCache(shaderCachePath_);
|
||||
// Note: We save the cache in DeviceLost
|
||||
DestroyDeviceObjects();
|
||||
|
||||
Reference in new issue
Block a user