Cache supported renderers

This commit is contained in:
Gess1t 2024-10-28 05:03:57 +01:00
parent 61afc57ff2
commit 94a2bce37c
2 changed files with 6 additions and 6 deletions

View File

@ -43,12 +43,6 @@ void VideoSettingsDialog::setEnabled()
int renderer = cfg.GetInt("3D.Renderer");
int ogldisplay = cfg.GetBool("Screen.UseGL");
// We will need it to disable specific options where unsupported
int supportedRenderer = getsupportedRenderers();
bool base_gl = supportedRenderer > renderer3D_Software;
bool compute_gl = supportedRenderer == renderer3D_OpenGLCompute;
if (!compute_gl)
{
ui->rb3DCompute->setEnabled(false);
@ -124,6 +118,10 @@ VideoSettingsDialog::VideoSettingsDialog(QWidget* parent) : QDialog(parent), ui(
setAttribute(Qt::WA_DeleteOnClose);
emuInstance = ((MainWindow*)parent)->getEmuInstance();
int supportedRenderers = getsupportedRenderers();
base_gl = supportedRenderers > renderer3D_Software;
compute_gl = supportedRenderers == renderer3D_OpenGLCompute;
auto& cfg = emuInstance->getGlobalConfig();
oldRenderer = cfg.GetInt("3D.Renderer");

View File

@ -78,6 +78,8 @@ private:
Ui::VideoSettingsDialog* ui;
EmuInstance* emuInstance;
bool base_gl;
bool compute_gl;
QButtonGroup* grp3DRenderer;