mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Core: Use readable names for failed backends.
This commit is contained in:
parent
3cb1c33fd9
commit
df6c5f38dc
4 changed files with 32 additions and 4 deletions
|
@ -550,7 +550,7 @@ int Config::NextValidBackend() {
|
|||
SplitString(sFailedGPUBackends, ',', split);
|
||||
for (const auto &str : split) {
|
||||
if (!str.empty() && str != "ALL") {
|
||||
failed.insert(atoi(str.c_str()));
|
||||
failed.insert((int)GPUBackendFromString(str));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
const int PSP_MODEL_FAT = 0;
|
||||
const int PSP_MODEL_SLIM = 1;
|
||||
|
@ -53,6 +54,33 @@ enum class GPUBackend {
|
|||
VULKAN = 3,
|
||||
};
|
||||
|
||||
inline std::string GPUBackendToString(GPUBackend backend) {
|
||||
switch (backend) {
|
||||
case GPUBackend::OPENGL:
|
||||
return "OPENGL";
|
||||
case GPUBackend::DIRECT3D9:
|
||||
return "DIRECT3D9";
|
||||
case GPUBackend::DIRECT3D11:
|
||||
return "DIRECT3D11";
|
||||
case GPUBackend::VULKAN:
|
||||
return "VULKAN";
|
||||
}
|
||||
// Intentionally not a default so we get a warning.
|
||||
return "INVALID";
|
||||
}
|
||||
|
||||
inline GPUBackend GPUBackendFromString(const std::string &backend) {
|
||||
if (backend == "OPENGL" || backend == "0")
|
||||
return GPUBackend::OPENGL;
|
||||
if (backend == "DIRECT3D9" || backend == "1")
|
||||
return GPUBackend::DIRECT3D9;
|
||||
if (backend == "DIRECT3D11" || backend == "2")
|
||||
return GPUBackend::DIRECT3D11;
|
||||
if (backend == "VULKAN" || backend == "3")
|
||||
return GPUBackend::VULKAN;
|
||||
return GPUBackend::OPENGL;
|
||||
}
|
||||
|
||||
enum AudioBackendType {
|
||||
AUDIO_BACKEND_AUTO,
|
||||
AUDIO_BACKEND_DSOUND,
|
||||
|
|
|
@ -822,7 +822,7 @@ void NotifyDisplay(u32 framebuf, int stride, int fmt) {
|
|||
int linesize, pixelFormat;
|
||||
};
|
||||
|
||||
DisplayBufData disp{ framebuf, stride, fmt };
|
||||
DisplayBufData disp{ { framebuf }, stride, fmt };
|
||||
|
||||
FlushRegisters();
|
||||
u32 ptr = (u32)pushbuf.size();
|
||||
|
|
|
@ -392,9 +392,9 @@ static void CheckFailedGPUBackends() {
|
|||
WARN_LOG(LOADER, "Failed graphics backend switched from %d to %d", lastBackend, g_Config.iGPUBackend);
|
||||
// And then let's - for now - add the current to the failed list.
|
||||
if (g_Config.sFailedGPUBackends.empty()) {
|
||||
g_Config.sFailedGPUBackends = StringFromFormat("%d", g_Config.iGPUBackend);
|
||||
g_Config.sFailedGPUBackends = GPUBackendToString((GPUBackend)g_Config.iGPUBackend);
|
||||
} else if (g_Config.sFailedGPUBackends.find("ALL") == std::string::npos) {
|
||||
g_Config.sFailedGPUBackends += StringFromFormat(",%d", g_Config.iGPUBackend);
|
||||
g_Config.sFailedGPUBackends += "," + GPUBackendToString((GPUBackend)g_Config.iGPUBackend);
|
||||
}
|
||||
|
||||
if (System_GetPropertyBool(SYSPROP_SUPPORTS_PERMISSIONS)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue