libretro: Disable shader cache

Can't seem to see somewhere we can save shader blobs. It wasn't working
anyway because it would generate invalid paths.
This commit is contained in:
Connor McLaughlin 2020-07-04 20:51:04 +10:00
parent f9622b2450
commit 8408d3b6bf
2 changed files with 17 additions and 9 deletions

View file

@ -37,15 +37,6 @@ retro_input_state_t g_retro_input_state_callback;
static retro_log_callback s_libretro_log_callback = {}; static retro_log_callback s_libretro_log_callback = {};
static bool s_libretro_log_callback_valid = false; static bool s_libretro_log_callback_valid = false;
static const char* GetSaveDirectory()
{
const char* save_directory = nullptr;
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &save_directory) || !save_directory)
save_directory = "saves";
return save_directory;
}
static void LibretroLogCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level, static void LibretroLogCallback(void* pUserParam, const char* channelName, const char* functionName, LOGLEVEL level,
const char* message) const char* message)
{ {
@ -109,6 +100,15 @@ void LibretroHostInterface::GetGameInfo(const char* path, CDImage* image, std::s
code->clear(); code->clear();
} }
static const char* GetSaveDirectory()
{
const char* save_directory = nullptr;
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &save_directory) || !save_directory)
save_directory = "saves";
return save_directory;
}
std::string LibretroHostInterface::GetSharedMemoryCardPath(u32 slot) const std::string LibretroHostInterface::GetSharedMemoryCardPath(u32 slot) const
{ {
return StringUtil::StdStringFromFormat("%s%cshared_card_%d.mcd", GetSaveDirectory(), FS_OSPATH_SEPERATOR_CHARACTER, return StringUtil::StdStringFromFormat("%s%cshared_card_%d.mcd", GetSaveDirectory(), FS_OSPATH_SEPERATOR_CHARACTER,
@ -121,6 +121,13 @@ std::string LibretroHostInterface::GetGameMemoryCardPath(const char* game_code,
slot + 1); slot + 1);
} }
std::string LibretroHostInterface::GetShaderCacheBasePath() const
{
// TODO: Is there somewhere we can save our shaders?
Log_WarningPrint("No shader cache directory available, startup will be slower.");
return std::string();
}
std::string LibretroHostInterface::GetSettingValue(const char* section, const char* key, std::string LibretroHostInterface::GetSettingValue(const char* section, const char* key,
const char* default_value /*= ""*/) const char* default_value /*= ""*/)
{ {

View file

@ -26,6 +26,7 @@ public:
void GetGameInfo(const char* path, CDImage* image, std::string* code, std::string* title) override; void GetGameInfo(const char* path, CDImage* image, std::string* code, std::string* title) override;
std::string GetSharedMemoryCardPath(u32 slot) const override; std::string GetSharedMemoryCardPath(u32 slot) const override;
std::string GetGameMemoryCardPath(const char* game_code, u32 slot) const override; std::string GetGameMemoryCardPath(const char* game_code, u32 slot) const override;
std::string GetShaderCacheBasePath() const override;
std::string GetSettingValue(const char* section, const char* key, const char* default_value = "") override; std::string GetSettingValue(const char* section, const char* key, const char* default_value = "") override;
// Called by frontend // Called by frontend