mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
Config: Add an option to skip saving texture cache to save state
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
#include "VideoCommon/AbstractFramebuffer.h"
|
||||
#include "VideoCommon/AbstractPipeline.h"
|
||||
#include "VideoCommon/AbstractShader.h"
|
||||
@ -862,6 +863,11 @@ void FramebufferManager::DoState(PointerWrap& p)
|
||||
{
|
||||
FlushEFBPokes();
|
||||
|
||||
bool save_efb_state = Config::Get(Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE);
|
||||
p.Do(save_efb_state);
|
||||
if (!save_efb_state)
|
||||
return;
|
||||
|
||||
if (p.GetMode() == PointerWrap::MODE_WRITE || p.GetMode() == PointerWrap::MODE_MEASURE)
|
||||
DoSaveState(p);
|
||||
else
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "Common/MemoryUtil.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/FifoPlayer/FifoPlayer.h"
|
||||
#include "Core/FifoPlayer/FifoRecorder.h"
|
||||
@ -469,7 +470,7 @@ std::optional<TextureCacheBase::TexPoolEntry> TextureCacheBase::DeserializeTextu
|
||||
std::vector<u8> texture_data;
|
||||
p.Do(texture_data);
|
||||
|
||||
if (p.GetMode() != PointerWrap::MODE_READ)
|
||||
if (p.GetMode() != PointerWrap::MODE_READ || texture_data.empty())
|
||||
return std::nullopt;
|
||||
|
||||
auto tex = AllocateTexture(config);
|
||||
@ -546,20 +547,23 @@ void TextureCacheBase::DoSaveState(PointerWrap& p)
|
||||
// of address/hash to entry ID.
|
||||
std::vector<std::pair<u32, u32>> textures_by_address_list;
|
||||
std::vector<std::pair<u64, u32>> textures_by_hash_list;
|
||||
for (const auto& it : textures_by_address)
|
||||
if (Config::Get(Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE))
|
||||
{
|
||||
if (ShouldSaveEntry(it.second))
|
||||
for (const auto& it : textures_by_address)
|
||||
{
|
||||
u32 id = AddCacheEntryToMap(it.second);
|
||||
textures_by_address_list.push_back(std::make_pair(it.first, id));
|
||||
if (ShouldSaveEntry(it.second))
|
||||
{
|
||||
u32 id = AddCacheEntryToMap(it.second);
|
||||
textures_by_address_list.push_back(std::make_pair(it.first, id));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const auto& it : textures_by_hash)
|
||||
{
|
||||
if (ShouldSaveEntry(it.second))
|
||||
for (const auto& it : textures_by_hash)
|
||||
{
|
||||
u32 id = AddCacheEntryToMap(it.second);
|
||||
textures_by_hash_list.push_back(std::make_pair(it.first, id));
|
||||
if (ShouldSaveEntry(it.second))
|
||||
{
|
||||
u32 id = AddCacheEntryToMap(it.second);
|
||||
textures_by_hash_list.push_back(std::make_pair(it.first, id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user