config: Add present mode option. (#3502)

* config: Add present mode option.

* settings_dialog: Add details for present modes.
This commit is contained in:
squidbus
2025-09-01 16:42:31 -07:00
committed by GitHub
parent f09c0e5a28
commit 9246b4277b
6 changed files with 101 additions and 15 deletions

View File

@@ -79,6 +79,7 @@ static bool shouldPatchShaders = false;
static u32 vblankDivider = 1;
static bool isFullscreen = false;
static std::string fullscreenMode = "Windowed";
static std::string presentMode = "Mailbox";
static bool isHDRAllowed = false;
// Vulkan
@@ -194,6 +195,10 @@ std::string getFullscreenMode() {
return fullscreenMode;
}
std::string getPresentMode() {
return presentMode;
}
bool getisTrophyPopupDisabled() {
return isTrophyPopupDisabled;
}
@@ -466,6 +471,10 @@ void setFullscreenMode(std::string mode) {
fullscreenMode = mode;
}
void setPresentMode(std::string mode) {
presentMode = mode;
}
void setisTrophyPopupDisabled(bool disable) {
isTrophyPopupDisabled = disable;
}
@@ -726,6 +735,7 @@ void load(const std::filesystem::path& path) {
vblankDivider = toml::find_or<int>(gpu, "vblankDivider", vblankDivider);
isFullscreen = toml::find_or<bool>(gpu, "Fullscreen", isFullscreen);
fullscreenMode = toml::find_or<std::string>(gpu, "FullscreenMode", fullscreenMode);
presentMode = toml::find_or<std::string>(gpu, "presentMode", presentMode);
isHDRAllowed = toml::find_or<bool>(gpu, "allowHDR", isHDRAllowed);
}
@@ -894,6 +904,7 @@ void save(const std::filesystem::path& path) {
data["GPU"]["vblankDivider"] = vblankDivider;
data["GPU"]["Fullscreen"] = isFullscreen;
data["GPU"]["FullscreenMode"] = fullscreenMode;
data["GPU"]["presentMode"] = presentMode;
data["GPU"]["allowHDR"] = isHDRAllowed;
data["Vulkan"]["gpuId"] = gpuId;
data["Vulkan"]["validation"] = vkValidation;
@@ -1003,6 +1014,7 @@ void setDefaultValues() {
vblankDivider = 1;
isFullscreen = false;
fullscreenMode = "Windowed";
presentMode = "Mailbox";
isHDRAllowed = false;
// Vulkan

View File

@@ -27,6 +27,8 @@ bool getIsFullscreen();
void setIsFullscreen(bool enable);
std::string getFullscreenMode();
void setFullscreenMode(std::string mode);
std::string getPresentMode();
void setPresentMode(std::string mode);
u32 getWindowWidth();
u32 getWindowHeight();
void setWindowWidth(u32 width);