Skip to content

PS2 games in the browser: static recompilation to WebAssembly with a native runtime

C++

gs: use the WebGPU renderer by default

Samir Nuri86b29a4e0d2d
diff --git a/runtime/src/gs/gs.cpp b/runtime/src/gs/gs.cpp
index abd4b71..8702bf3 100644
--- a/runtime/src/gs/gs.cpp
+++ b/runtime/src/gs/gs.cpp
@@ -348,7 +348,7 @@ void reset() {
built = true;
#ifdef PS2_GPU
const char *backend = std::getenv("PS2_GS");
- const gpu::Mode wanted = !backend ? gpu::Mode::off : std::strcmp(backend, "gpu") == 0 ? gpu::Mode::primary : std::strcmp(backend, "both") == 0 ? gpu::Mode::mirror : gpu::Mode::off;
+ const gpu::Mode wanted = !backend || std::strcmp(backend, "gpu") == 0 ? gpu::Mode::primary : std::strcmp(backend, "both") == 0 ? gpu::Mode::mirror : gpu::Mode::off;
if (wanted != gpu::Mode::off && !gpu::init(wanted)) std::fprintf(stderr, "[gs] WebGPU unavailable, using the software renderer\n");
#endif
}