mirror of
				https://git.tardis.systems/mirrors/yuzu
				synced 2025-10-31 02:34:11 +01:00 
			
		
		
		
	renderer_vulkan: adjust window origin and swizzle independently
This commit is contained in:
		
							parent
							
								
									127bfb81d5
								
							
						
					
					
						commit
						e7dd968ac4
					
				| @ -75,14 +75,20 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in | ||||
|     const float width = conv(src.scale_x * 2.0f); | ||||
|     float y = conv(src.translate_y - src.scale_y); | ||||
|     float height = conv(src.scale_y * 2.0f); | ||||
|     bool y_negate = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft; | ||||
| 
 | ||||
|     if (!device.IsNvViewportSwizzleSupported()) { | ||||
|         y_negate = y_negate != (src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY); | ||||
|     const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft; | ||||
|     const bool y_negate = !device.IsNvViewportSwizzleSupported() && | ||||
|                           src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY; | ||||
| 
 | ||||
|     if (lower_left) { | ||||
|         // Flip by surface clip height
 | ||||
|         y += conv(static_cast<f32>(regs.surface_clip.height)); | ||||
|         height = -height; | ||||
|     } | ||||
| 
 | ||||
|     if (y_negate) { | ||||
|         y += conv(static_cast<f32>(regs.surface_clip.height)); | ||||
|         // Flip by viewport height
 | ||||
|         y += height; | ||||
|         height = -height; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user