Renderers: Make shader cache path a prefix instead of directory

This commit is contained in:
Connor McLaughlin
2020-07-04 20:45:54 +10:00
parent b9ffca1ddf
commit f396a2c373
9 changed files with 11 additions and 14 deletions

View File

@ -38,7 +38,7 @@ bool GPU_HW_D3D11::Initialize(HostDisplay* host_display, System* system, DMA* dm
if (!m_device || !m_context)
return false;
m_shader_cache.Open(system->GetHostInterface()->GetUserDirectoryRelativePath("cache"), m_device->GetFeatureLevel(),
m_shader_cache.Open(system->GetHostInterface()->GetShaderCacheBasePath(), m_device->GetFeatureLevel(),
system->GetSettings().gpu_use_debug_device);
if (!CreateFramebuffer())

View File

@ -39,7 +39,7 @@ bool GPU_HW_OpenGL::Initialize(HostDisplay* host_display, System* system, DMA* d
SetCapabilities(host_display);
m_shader_cache.Open(IsGLES(), system->GetHostInterface()->GetUserDirectoryRelativePath("cache"));
m_shader_cache.Open(IsGLES(), system->GetHostInterface()->GetShaderCacheBasePath());
if (!GPU_HW::Initialize(host_display, system, dma, interrupt_controller, timers))
return false;

View File

@ -318,9 +318,9 @@ void HostInterface::OnRunningGameChanged() {}
void HostInterface::OnControllerTypeChanged(u32 slot) {}
std::string HostInterface::GetShaderCacheDirectory()
std::string HostInterface::GetShaderCacheBasePath() const
{
return GetUserDirectoryRelativePath("cache");
return GetUserDirectoryRelativePath("cache/");
}
void HostInterface::SetDefaultSettings(SettingsInterface& si)

View File

@ -103,6 +103,9 @@ public:
/// Returns the default path to a memory card for a specific game.
virtual std::string GetGameMemoryCardPath(const char* game_code, u32 slot) const;
/// Returns the path to the shader cache directory.
virtual std::string GetShaderCacheBasePath() const;
/// Returns a setting value from the configuration.
virtual std::string GetSettingValue(const char* section, const char* key, const char* default_value = "") = 0;
@ -127,9 +130,6 @@ protected:
virtual void OnRunningGameChanged();
virtual void OnControllerTypeChanged(u32 slot);
/// Returns the path to the shader cache directory.
virtual std::string GetShaderCacheDirectory();
/// Restores all settings to defaults.
virtual void SetDefaultSettings(SettingsInterface& si);