diff --git a/qt/src/DisplayPanel.cpp b/qt/src/DisplayPanel.cpp index a54b851f..e0449853 100644 --- a/qt/src/DisplayPanel.cpp +++ b/qt/src/DisplayPanel.cpp @@ -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() diff --git a/qt/src/EmuMainWindow.cpp b/qt/src/EmuMainWindow.cpp index a9ba1bce..7a0def5d 100644 --- a/qt/src/EmuMainWindow.cpp +++ b/qt/src/EmuMainWindow.cpp @@ -640,4 +640,12 @@ void EmuMainWindow::recreateUIAssets() if (canvas) canvas->recreateUIAssets(); }, true); +} + +void EmuMainWindow::shaderChanged() +{ + app->emu_thread->runOnThread([&] { + if (canvas) + canvas->shaderChanged(); + }); } \ No newline at end of file diff --git a/qt/src/EmuMainWindow.hpp b/qt/src/EmuMainWindow.hpp index a5f5a1c5..97756668 100644 --- a/qt/src/EmuMainWindow.hpp +++ b/qt/src/EmuMainWindow.hpp @@ -34,6 +34,7 @@ class EmuMainWindow : public QMainWindow void openFile(); bool openFile(std::string filename); void recreateUIAssets(); + void shaderChanged(); std::vector getDisplayDeviceList(); EmuApplication *app; EmuCanvas *canvas;