disk_shader:update directory structure
This commit is contained in:
parent
84cf87c40d
commit
9ed737b609
@ -538,7 +538,7 @@ bool ShaderDiskCache::EnsureDirectories() const {
|
|||||||
|
|
||||||
return CreateDir(FileUtil::GetUserPath(FileUtil::UserPath::ShaderDir)) &&
|
return CreateDir(FileUtil::GetUserPath(FileUtil::UserPath::ShaderDir)) &&
|
||||||
CreateDir(GetBaseDir()) && CreateDir(GetTransferableDir()) &&
|
CreateDir(GetBaseDir()) && CreateDir(GetTransferableDir()) &&
|
||||||
CreateDir(GetPrecompiledDir());
|
CreateDir(GetPrecompiledDir()) && CreateDir(GetPrecompiledShaderDir());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ShaderDiskCache::GetTransferablePath() {
|
std::string ShaderDiskCache::GetTransferablePath() {
|
||||||
@ -546,7 +546,7 @@ std::string ShaderDiskCache::GetTransferablePath() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ShaderDiskCache::GetPrecompiledPath() {
|
std::string ShaderDiskCache::GetPrecompiledPath() {
|
||||||
return FileUtil::SanitizePath(GetPrecompiledDir() + DIR_SEP_CHR + GetTitleID() + ".bin");
|
return FileUtil::SanitizePath(GetPrecompiledShaderDir() + DIR_SEP_CHR + GetTitleID() + ".bin");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ShaderDiskCache::GetTransferableDir() const {
|
std::string ShaderDiskCache::GetTransferableDir() const {
|
||||||
@ -557,6 +557,13 @@ std::string ShaderDiskCache::GetPrecompiledDir() const {
|
|||||||
return GetBaseDir() + DIR_SEP "precompiled";
|
return GetBaseDir() + DIR_SEP "precompiled";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ShaderDiskCache::GetPrecompiledShaderDir() const {
|
||||||
|
if (separable) {
|
||||||
|
return GetPrecompiledDir() + DIR_SEP "separable";
|
||||||
|
}
|
||||||
|
return GetPrecompiledDir() + DIR_SEP "conventional";
|
||||||
|
}
|
||||||
|
|
||||||
std::string ShaderDiskCache::GetBaseDir() const {
|
std::string ShaderDiskCache::GetBaseDir() const {
|
||||||
return FileUtil::GetUserPath(FileUtil::UserPath::ShaderDir) + DIR_SEP "opengl";
|
return FileUtil::GetUserPath(FileUtil::UserPath::ShaderDir) + DIR_SEP "opengl";
|
||||||
}
|
}
|
||||||
|
@ -162,6 +162,8 @@ private:
|
|||||||
/// Get user's precompiled directory path
|
/// Get user's precompiled directory path
|
||||||
std::string GetPrecompiledDir() const;
|
std::string GetPrecompiledDir() const;
|
||||||
|
|
||||||
|
std::string GetPrecompiledShaderDir() const;
|
||||||
|
|
||||||
/// Get user's shader directory path
|
/// Get user's shader directory path
|
||||||
std::string GetBaseDir() const;
|
std::string GetBaseDir() const;
|
||||||
|
|
||||||
|
@ -482,11 +482,6 @@ void ShaderProgramManager::ApplyTo(OpenGLState& state) {
|
|||||||
|
|
||||||
void ShaderProgramManager::LoadDiskCache(const std::atomic_bool& stop_loading,
|
void ShaderProgramManager::LoadDiskCache(const std::atomic_bool& stop_loading,
|
||||||
const VideoCore::DiskResourceLoadCallback& callback) {
|
const VideoCore::DiskResourceLoadCallback& callback) {
|
||||||
if (!impl->separable) {
|
|
||||||
LOG_ERROR(Render_OpenGL,
|
|
||||||
"Cannot load disk cache as separate shader programs are unsupported!");
|
|
||||||
// return;
|
|
||||||
}
|
|
||||||
auto& disk_cache = impl->disk_cache;
|
auto& disk_cache = impl->disk_cache;
|
||||||
const auto transferable = disk_cache.LoadTransferable();
|
const auto transferable = disk_cache.LoadTransferable();
|
||||||
if (!transferable) {
|
if (!transferable) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user