Overlays: FlipY fix

This commit is contained in:
Barış Hamil 2025-06-25 20:23:43 +03:00
parent d6232008d5
commit 58c2dc4ac4

View file

@ -213,7 +213,7 @@ namespace Ryujinx.Graphics.Gpu
texture.SynchronizeMemory(); texture.SynchronizeMemory();
// Add overlays by modifying texture data directly // Add overlays by modifying texture data directly
AddOverlaysToTexture(texture); AddOverlaysToTexture(texture, pt.Crop);
ImageCrop crop = new( ImageCrop crop = new(
(int)(pt.Crop.Left * texture.ScaleFactor), (int)(pt.Crop.Left * texture.ScaleFactor),
@ -264,7 +264,8 @@ namespace Ryujinx.Graphics.Gpu
/// Add overlays to the texture using SkiaSharp /// Add overlays to the texture using SkiaSharp
/// </summary> /// </summary>
/// <param name="texture">The texture to modify</param> /// <param name="texture">The texture to modify</param>
private void AddOverlaysToTexture(Image.Texture texture) /// <param name="crop">The crop information containing flip flags</param>
private void AddOverlaysToTexture(Image.Texture texture, ImageCrop crop)
{ {
try try
{ {
@ -314,9 +315,9 @@ namespace Ryujinx.Graphics.Gpu
// Create canvas for drawing overlays // Create canvas for drawing overlays
using var canvas = new SKCanvas(bitmap); using var canvas = new SKCanvas(bitmap);
// On Linux with OpenGL, we need to flip the Y-axis because OpenGL uses bottom-left origin // Flip Y-axis if the game/texture requires it
// while SkiaSharp uses top-left origin // Some games have textures that are already flipped, while others need flipping
if (OperatingSystem.IsLinux()) if (crop.FlipY)
{ {
canvas.Scale(1, -1); canvas.Scale(1, -1);
canvas.Translate(0, -height); canvas.Translate(0, -height);