diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/settings.h | 6 | ||||
| -rw-r--r-- | src/common/settings_enums.h | 2 | ||||
| -rw-r--r-- | src/common/string_util.cpp | 4 | ||||
| -rw-r--r-- | src/common/string_util.h | 1 |
4 files changed, 13 insertions, 0 deletions
diff --git a/src/common/settings.h b/src/common/settings.h index aa054dc24..b2b071e7e 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -384,6 +384,12 @@ struct Values { | |||
| 384 | AstcRecompression::Bc3, | 384 | AstcRecompression::Bc3, |
| 385 | "astc_recompression", | 385 | "astc_recompression", |
| 386 | Category::RendererAdvanced}; | 386 | Category::RendererAdvanced}; |
| 387 | SwitchableSetting<VramUsageMode, true> vram_usage_mode{linkage, | ||
| 388 | VramUsageMode::Conservative, | ||
| 389 | VramUsageMode::Conservative, | ||
| 390 | VramUsageMode::Aggressive, | ||
| 391 | "vram_usage_mode", | ||
| 392 | Category::RendererAdvanced}; | ||
| 387 | SwitchableSetting<bool> async_presentation{linkage, | 393 | SwitchableSetting<bool> async_presentation{linkage, |
| 388 | #ifdef ANDROID | 394 | #ifdef ANDROID |
| 389 | true, | 395 | true, |
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index f42367e67..6e247e930 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h | |||
| @@ -122,6 +122,8 @@ ENUM(AstcRecompression, Uncompressed, Bc1, Bc3); | |||
| 122 | 122 | ||
| 123 | ENUM(VSyncMode, Immediate, Mailbox, Fifo, FifoRelaxed); | 123 | ENUM(VSyncMode, Immediate, Mailbox, Fifo, FifoRelaxed); |
| 124 | 124 | ||
| 125 | ENUM(VramUsageMode, Conservative, Aggressive); | ||
| 126 | |||
| 125 | ENUM(RendererBackend, OpenGL, Vulkan, Null); | 127 | ENUM(RendererBackend, OpenGL, Vulkan, Null); |
| 126 | 128 | ||
| 127 | ENUM(ShaderBackend, Glsl, Glasm, SpirV); | 129 | ENUM(ShaderBackend, Glsl, Glasm, SpirV); |
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 72c481798..1909aced5 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -38,6 +38,10 @@ std::string StringFromBuffer(std::span<const u8> data) { | |||
| 38 | return std::string(data.begin(), std::find(data.begin(), data.end(), '\0')); | 38 | return std::string(data.begin(), std::find(data.begin(), data.end(), '\0')); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | std::string StringFromBuffer(std::span<const char> data) { | ||
| 42 | return std::string(data.begin(), std::find(data.begin(), data.end(), '\0')); | ||
| 43 | } | ||
| 44 | |||
| 41 | // Turns " hej " into "hej". Also handles tabs. | 45 | // Turns " hej " into "hej". Also handles tabs. |
| 42 | std::string StripSpaces(const std::string& str) { | 46 | std::string StripSpaces(const std::string& str) { |
| 43 | const std::size_t s = str.find_first_not_of(" \t\r\n"); | 47 | const std::size_t s = str.find_first_not_of(" \t\r\n"); |
diff --git a/src/common/string_util.h b/src/common/string_util.h index 9da1ca4e9..53d0549ca 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h | |||
| @@ -19,6 +19,7 @@ namespace Common { | |||
| 19 | [[nodiscard]] std::string ToUpper(std::string str); | 19 | [[nodiscard]] std::string ToUpper(std::string str); |
| 20 | 20 | ||
| 21 | [[nodiscard]] std::string StringFromBuffer(std::span<const u8> data); | 21 | [[nodiscard]] std::string StringFromBuffer(std::span<const u8> data); |
| 22 | [[nodiscard]] std::string StringFromBuffer(std::span<const char> data); | ||
| 22 | 23 | ||
| 23 | [[nodiscard]] std::string StripSpaces(const std::string& s); | 24 | [[nodiscard]] std::string StripSpaces(const std::string& s); |
| 24 | [[nodiscard]] std::string StripQuotes(const std::string& s); | 25 | [[nodiscard]] std::string StripQuotes(const std::string& s); |