Add configurable Renderer backend
There are still some initialization errors to work through, such as config not being initialized properly by the time GPU tries to utilize it too. Also some life-time issues. But manually forcing it to use the Null backnd successfully works and allows games to be "played" headlessly.
This commit is contained in:
@@ -31,6 +31,7 @@ void EmulatorConfig::load(const std::filesystem::path& path) {
|
||||
if (gpuResult.is_ok()) {
|
||||
auto gpu = gpuResult.unwrap();
|
||||
|
||||
rendererType = RendererType(toml::find_or<toml::integer>(gpu, "Renderer", int64_t(rendererType)));
|
||||
shaderJitEnabled = toml::find_or<toml::boolean>(gpu, "EnableShaderJIT", false);
|
||||
}
|
||||
}
|
||||
@@ -54,6 +55,7 @@ void EmulatorConfig::save(const std::filesystem::path& path) {
|
||||
printf("Saving new configuration file %s\n", path.string().c_str());
|
||||
}
|
||||
|
||||
data["GPU"]["Renderer"] = static_cast<s8>(rendererType);
|
||||
data["GPU"]["EnableShaderJIT"] = shaderJitEnabled;
|
||||
|
||||
std::ofstream file(path, std::ios::out);
|
||||
|
||||
Reference in New Issue
Block a user