fix: disabling Vulkan causes users to be stuck in GPU-accelerated mode (#2578)

This commit is contained in:
Louis 2024-04-02 17:35:15 +07:00 committed by GitHub
parent a6cbc0b86f
commit 89653eda08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,10 +74,10 @@ export const useSettings = () => {
if (vulkan != null) { if (vulkan != null) {
settings.vulkan = vulkan settings.vulkan = vulkan
// GPU enabled, set run_mode to 'gpu' // GPU enabled, set run_mode to 'gpu'
if (settings.vulkan) { if (settings.vulkan === true) {
settings.run_mode = 'gpu' settings.run_mode = 'gpu'
} else { } else {
settings.run_mode = settings.gpus?.length > 0 ? 'gpu' : 'cpu' settings.run_mode = 'cpu'
} }
} }
await fs.writeFileSync(settingsFile, JSON.stringify(settings)) await fs.writeFileSync(settingsFile, JSON.stringify(settings))