2021-01-21 04:01:05 +04:00
|
|
|
// Copyright 2021 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2021-05-08 11:49:31 +04:00
|
|
|
#include <cstdlib>
|
2021-01-21 04:01:05 +04:00
|
|
|
|
|
|
|
#include <fmt/format.h>
|
|
|
|
|
2021-05-08 11:49:31 +04:00
|
|
|
#include "common/fs/file.h"
|
|
|
|
#include "common/fs/fs.h"
|
|
|
|
#include "common/fs/path_util.h"
|
2021-01-21 05:42:22 +04:00
|
|
|
#include "common/nvidia_flags.h"
|
2021-01-21 04:01:05 +04:00
|
|
|
|
|
|
|
namespace Common {
|
|
|
|
|
|
|
|
void ConfigureNvidiaEnvironmentFlags() {
|
|
|
|
#ifdef _WIN32
|
2021-05-08 11:49:31 +04:00
|
|
|
const auto nvidia_shader_dir =
|
|
|
|
Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir) / "nvidia";
|
|
|
|
|
|
|
|
if (!Common::FS::CreateDirs(nvidia_shader_dir)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const auto windows_path_string =
|
|
|
|
Common::FS::PathToUTF8String(nvidia_shader_dir.lexically_normal());
|
|
|
|
|
|
|
|
void(_putenv(fmt::format("__GL_SHADER_DISK_CACHE_PATH={}", windows_path_string).c_str()));
|
2021-01-21 04:01:05 +04:00
|
|
|
void(_putenv("__GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1"));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Common
|