Fix OpenGL shader changed race.
This commit is contained in:
parent
8bb1e7747d
commit
ad613b5f0b
@ -30,7 +30,7 @@ DisplayPanel::DisplayPanel(EmuApplication *app_)
|
||||
|
||||
QObject::connect(checkBox_use_shader, &QCheckBox::clicked, [&](bool checked) {
|
||||
app->config->use_shader = checked;
|
||||
app->window->canvas->shaderChanged();
|
||||
app->window->shaderChanged();
|
||||
});
|
||||
|
||||
QObject::connect(pushButton_browse_shader, &QPushButton::clicked, [&] {
|
||||
@ -116,7 +116,7 @@ void DisplayPanel::selectShaderDialog()
|
||||
app->config->shader = dialog.selectedFiles().at(0).toUtf8();
|
||||
app->config->last_shader_folder = dialog.directory().absolutePath().toStdString();
|
||||
lineEdit_shader->setText(app->config->shader.c_str());
|
||||
app->window->canvas->shaderChanged();
|
||||
app->window->shaderChanged();
|
||||
}
|
||||
|
||||
void DisplayPanel::populateDevices()
|
||||
|
@ -641,3 +641,11 @@ void EmuMainWindow::recreateUIAssets()
|
||||
canvas->recreateUIAssets();
|
||||
}, true);
|
||||
}
|
||||
|
||||
void EmuMainWindow::shaderChanged()
|
||||
{
|
||||
app->emu_thread->runOnThread([&] {
|
||||
if (canvas)
|
||||
canvas->shaderChanged();
|
||||
});
|
||||
}
|
@ -34,6 +34,7 @@ class EmuMainWindow : public QMainWindow
|
||||
void openFile();
|
||||
bool openFile(std::string filename);
|
||||
void recreateUIAssets();
|
||||
void shaderChanged();
|
||||
std::vector<std::string> getDisplayDeviceList();
|
||||
EmuApplication *app;
|
||||
EmuCanvas *canvas;
|
||||
|
Loading…
Reference in New Issue
Block a user