mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	Render-to-texture flush, interval math fix
This commit is contained in:
		
							parent
							
								
									5025b35563
								
							
						
					
					
						commit
						66b0d799ee
					
				
					 2 changed files with 14 additions and 2 deletions
				
			
		|  | @ -12,7 +12,7 @@ namespace MathUtil | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
| inline bool IntervalsIntersect(unsigned start0, unsigned length0, unsigned start1, unsigned length1) { | inline bool IntervalsIntersect(unsigned start0, unsigned length0, unsigned start1, unsigned length1) { | ||||||
|     return (std::max(start0, start1) <= std::min(start0 + length0, start1 + length1)); |     return (std::max(start0, start1) < std::min(start0 + length0, start1 + length1)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| template<typename T> | template<typename T> | ||||||
|  |  | ||||||
|  | @ -217,7 +217,19 @@ void RasterizerOpenGL::DrawTriangles() { | ||||||
| 
 | 
 | ||||||
|     vertex_batch.clear(); |     vertex_batch.clear(); | ||||||
| 
 | 
 | ||||||
|     // TODO: Flush the resource cache at the current depth and color framebuffer addresses for render-to-texture
 |     // Flush the resource cache at the current depth and color framebuffer addresses for render-to-texture
 | ||||||
|  |     const auto& regs = Pica::g_state.regs; | ||||||
|  | 
 | ||||||
|  |     PAddr cur_fb_color_addr = regs.framebuffer.GetColorBufferPhysicalAddress(); | ||||||
|  |     u32 cur_fb_color_size = Pica::Regs::BytesPerColorPixel(regs.framebuffer.color_format) | ||||||
|  |                             * regs.framebuffer.GetWidth() * regs.framebuffer.GetHeight(); | ||||||
|  | 
 | ||||||
|  |     PAddr cur_fb_depth_addr = regs.framebuffer.GetDepthBufferPhysicalAddress(); | ||||||
|  |     u32 cur_fb_depth_size = Pica::Regs::BytesPerDepthPixel(regs.framebuffer.depth_format) | ||||||
|  |                             * regs.framebuffer.GetWidth() * regs.framebuffer.GetHeight(); | ||||||
|  | 
 | ||||||
|  |     res_cache.NotifyFlush(cur_fb_color_addr, cur_fb_color_size); | ||||||
|  |     res_cache.NotifyFlush(cur_fb_depth_addr, cur_fb_depth_size); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void RasterizerOpenGL::CommitFramebuffer() { | void RasterizerOpenGL::CommitFramebuffer() { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue