diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 3d759f77b..1adf8932b 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -150,18 +150,19 @@ public: | |||
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | void MakeCurrent() override { | 152 | void MakeCurrent() override { |
| 153 | if (is_current) { | 153 | // We can't track the current state of the underlying context in this wrapper class because |
| 154 | return; | 154 | // Qt may make the underlying context not current for one reason or another. In particular, |
| 155 | // the WebBrowser uses GL, so it seems to conflict if we aren't careful. | ||
| 156 | // Instead of always just making the context current (which does not have any caching to | ||
| 157 | // check if the underlying context is already current) we can check for the current context | ||
| 158 | // in the thread local data by calling `currentContext()` and checking if its ours. | ||
| 159 | if (QOpenGLContext::currentContext() != context.get()) { | ||
| 160 | context->makeCurrent(surface); | ||
| 155 | } | 161 | } |
| 156 | is_current = context->makeCurrent(surface); | ||
| 157 | } | 162 | } |
| 158 | 163 | ||
| 159 | void DoneCurrent() override { | 164 | void DoneCurrent() override { |
| 160 | if (!is_current) { | ||
| 161 | return; | ||
| 162 | } | ||
| 163 | context->doneCurrent(); | 165 | context->doneCurrent(); |
| 164 | is_current = false; | ||
| 165 | } | 166 | } |
| 166 | 167 | ||
| 167 | QOpenGLContext* GetShareContext() { | 168 | QOpenGLContext* GetShareContext() { |
| @@ -178,7 +179,6 @@ private: | |||
| 178 | std::unique_ptr<QOpenGLContext> context; | 179 | std::unique_ptr<QOpenGLContext> context; |
| 179 | std::unique_ptr<QOffscreenSurface> offscreen_surface{}; | 180 | std::unique_ptr<QOffscreenSurface> offscreen_surface{}; |
| 180 | QSurface* surface; | 181 | QSurface* surface; |
| 181 | bool is_current = false; | ||
| 182 | }; | 182 | }; |
| 183 | 183 | ||
| 184 | class DummyContext : public Core::Frontend::GraphicsContext {}; | 184 | class DummyContext : public Core::Frontend::GraphicsContext {}; |