mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	GSP: Toggle active framebuffer each frame
This commit is contained in:
		
							parent
							
								
									0bf5a0bfc4
								
							
						
					
					
						commit
						f7a3f45f1e
					
				
					 2 changed files with 8 additions and 2 deletions
				
			
		|  | @ -291,8 +291,11 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { | ||||||
|         // Update framebuffer information if requested
 |         // Update framebuffer information if requested
 | ||||||
|         for (int screen_id = 0; screen_id < 2; ++screen_id) { |         for (int screen_id = 0; screen_id < 2; ++screen_id) { | ||||||
|             FrameBufferUpdate* info = GetFrameBufferInfo(thread_id, screen_id); |             FrameBufferUpdate* info = GetFrameBufferInfo(thread_id, screen_id); | ||||||
|             if (info->is_dirty) | 
 | ||||||
|  |             if (info->is_dirty) { | ||||||
|                 SetBufferSwap(screen_id, info->framebuffer_info[info->index]); |                 SetBufferSwap(screen_id, info->framebuffer_info[info->index]); | ||||||
|  |                 info->framebuffer_info->active_fb = info->framebuffer_info->active_fb ^ 1; | ||||||
|  |             } | ||||||
| 
 | 
 | ||||||
|             info->is_dirty = false; |             info->is_dirty = false; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -87,8 +87,11 @@ void RendererOpenGL::SwapBuffers() { | ||||||
|  */ |  */ | ||||||
| void RendererOpenGL::LoadFBToActiveGLTexture(const GPU::Regs::FramebufferConfig& framebuffer, | void RendererOpenGL::LoadFBToActiveGLTexture(const GPU::Regs::FramebufferConfig& framebuffer, | ||||||
|                                              const TextureInfo& texture) { |                                              const TextureInfo& texture) { | ||||||
|  | 
 | ||||||
|  |     // TODO: Why are active_fb and the valid framebuffer flipped compared to 3dbrew documentation
 | ||||||
|  |     // and GSP definitions?
 | ||||||
|     const VAddr framebuffer_vaddr = Memory::PhysicalToVirtualAddress( |     const VAddr framebuffer_vaddr = Memory::PhysicalToVirtualAddress( | ||||||
|         framebuffer.active_fb == 1 ? framebuffer.address_left2 : framebuffer.address_left1); |         framebuffer.active_fb == 0 ? framebuffer.address_left2 : framebuffer.address_left1); | ||||||
| 
 | 
 | ||||||
|     LOG_TRACE(Render_OpenGL, "0x%08x bytes from 0x%08x(%dx%d), fmt %x", |     LOG_TRACE(Render_OpenGL, "0x%08x bytes from 0x%08x(%dx%d), fmt %x", | ||||||
|         framebuffer.stride * framebuffer.height, |         framebuffer.stride * framebuffer.height, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue