mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-19 09:54:54 +00:00
renderer_vulkan, config: option to toggle VK validation layer
This commit is contained in:
parent
dd5a25fda2
commit
fe3b546d93
8 changed files with 67 additions and 29 deletions
|
@ -21,6 +21,8 @@ static bool isShowSplash = false;
|
|||
static bool isNullGpu = false;
|
||||
static bool shouldDumpShaders = false;
|
||||
static bool shouldDumpPM4 = false;
|
||||
static bool vkValidation = false;
|
||||
static bool vkValidationSync = false;
|
||||
|
||||
bool isLleLibc() {
|
||||
return isLibc;
|
||||
|
@ -69,6 +71,14 @@ bool dumpPM4() {
|
|||
return shouldDumpPM4;
|
||||
}
|
||||
|
||||
bool vkValidationEnabled() {
|
||||
return vkValidation;
|
||||
}
|
||||
|
||||
bool vkValidationSyncEnabled() {
|
||||
return vkValidationSync;
|
||||
}
|
||||
|
||||
void load(const std::filesystem::path& path) {
|
||||
// If the configuration file does not exist, create it and return
|
||||
std::error_code error;
|
||||
|
@ -110,6 +120,15 @@ void load(const std::filesystem::path& path) {
|
|||
shouldDumpPM4 = toml::find_or<toml::boolean>(gpu, "dumpPM4", false);
|
||||
}
|
||||
}
|
||||
if (data.contains("Vulkan")) {
|
||||
const auto vkResult = toml::expect<toml::value>(data.at("Vulkan"));
|
||||
if (vkResult.is_ok()) {
|
||||
auto vk = vkResult.unwrap();
|
||||
|
||||
vkValidation = toml::find_or<toml::boolean>(vk, "validation", true);
|
||||
vkValidationSync = toml::find_or<toml::boolean>(vk, "validation_sync", true);
|
||||
}
|
||||
}
|
||||
if (data.contains("Debug")) {
|
||||
auto debugResult = toml::expect<toml::value>(data.at("Debug"));
|
||||
if (debugResult.is_ok()) {
|
||||
|
@ -156,6 +175,8 @@ void save(const std::filesystem::path& path) {
|
|||
data["GPU"]["nullGpu"] = isNullGpu;
|
||||
data["GPU"]["dumpShaders"] = shouldDumpShaders;
|
||||
data["GPU"]["dumpPM4"] = shouldDumpPM4;
|
||||
data["Vulkan"]["validation"] = vkValidation;
|
||||
data["Vulkan"]["validation_sync"] = vkValidationSync;
|
||||
data["Debug"]["DebugDump"] = isDebugDump;
|
||||
data["LLE"]["libc"] = isLibc;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue