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