mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Frontend PR fixes (#6378)
* citra_qt: Check if renderer is null * core: Fix dynarmic use-after-free error * bootmanager: Add current context check in DoneCurrent * Loading a save state would destroy the frame dumper class, which contains a shared context. That context would call DoneCurrent without checking if it was actually bound or not, resulting in crashes when calling opengl functions * externals: Correct glad readme * common: Log renderer debug setting * citra: Make lambda lower case * Consistency with review comments on the PR * video_core: Kill more global state * GetResolutionScaleFactor would be called somewhere in the renderer constructor chain but it relies on the yet unitialized g_renderer, resulting in crashes when the resolution scale is set to auto. Rather than adding a workaround, let's kill this global state to fix this for good
This commit is contained in:
		
							parent
							
								
									5346ca27b5
								
							
						
					
					
						commit
						ffc95eb59b
					
				
					 17 changed files with 102 additions and 93 deletions
				
			
		|  | @ -176,7 +176,7 @@ public: | |||
|     } | ||||
| 
 | ||||
|     ~OpenGLSharedContext() { | ||||
|         context->doneCurrent(); | ||||
|         OpenGLSharedContext::DoneCurrent(); | ||||
|     } | ||||
| 
 | ||||
|     void SwapBuffers() override { | ||||
|  | @ -196,7 +196,9 @@ public: | |||
|     } | ||||
| 
 | ||||
|     void DoneCurrent() override { | ||||
|         context->doneCurrent(); | ||||
|         if (QOpenGLContext::currentContext() == context.get()) { | ||||
|             context->doneCurrent(); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     QOpenGLContext* GetShareContext() const { | ||||
|  | @ -257,7 +259,9 @@ public: | |||
|         } | ||||
|         context->MakeCurrent(); | ||||
|         glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); | ||||
|         VideoCore::g_renderer->TryPresent(100, is_secondary); | ||||
|         if (VideoCore::g_renderer) { | ||||
|             VideoCore::g_renderer->TryPresent(100, is_secondary); | ||||
|         } | ||||
|         context->SwapBuffers(); | ||||
|         glFinish(); | ||||
|     } | ||||
|  | @ -633,7 +637,7 @@ void GRenderWindow::ReleaseRenderTarget() { | |||
| 
 | ||||
| void GRenderWindow::CaptureScreenshot(u32 res_scale, const QString& screenshot_path) { | ||||
|     if (res_scale == 0) { | ||||
|         res_scale = VideoCore::GetResolutionScaleFactor(); | ||||
|         res_scale = VideoCore::g_renderer->GetResolutionScaleFactor(); | ||||
|     } | ||||
| 
 | ||||
|     const auto layout{Layout::FrameLayoutFromResolutionScale(res_scale, is_secondary)}; | ||||
|  |  | |||
|  | @ -1173,8 +1173,8 @@ void GMainWindow::BootGame(const QString& filename) { | |||
|     } | ||||
| 
 | ||||
|     if (video_dumping_on_start) { | ||||
|         Layout::FramebufferLayout layout{ | ||||
|             Layout::FrameLayoutFromResolutionScale(VideoCore::GetResolutionScaleFactor())}; | ||||
|         Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale( | ||||
|             VideoCore::g_renderer->GetResolutionScaleFactor())}; | ||||
|         if (!Core::System::GetInstance().VideoDumper().StartDumping( | ||||
|                 video_dumping_path.toStdString(), layout)) { | ||||
| 
 | ||||
|  | @ -2195,8 +2195,8 @@ void GMainWindow::OnStartVideoDumping() { | |||
|     } | ||||
|     const auto path = dialog.GetFilePath(); | ||||
|     if (emulation_running) { | ||||
|         Layout::FramebufferLayout layout{ | ||||
|             Layout::FrameLayoutFromResolutionScale(VideoCore::GetResolutionScaleFactor())}; | ||||
|         Layout::FramebufferLayout layout{Layout::FrameLayoutFromResolutionScale( | ||||
|             VideoCore::g_renderer->GetResolutionScaleFactor())}; | ||||
|         if (!Core::System::GetInstance().VideoDumper().StartDumping(path.toStdString(), layout)) { | ||||
|             QMessageBox::critical( | ||||
|                 this, tr("Citra"), | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue