aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS
diff options
context:
space:
mode:
authorgdk <gab.dark.100@gmail.com>2019-11-23 23:24:03 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit16d88c21fc98cd7302811e142a39d590370e182e (patch)
treee2c1a457666a11427ca3a26d701720bfe508e0e3 /Ryujinx.HLE/HOS
parentb2b2e046696e9c187cd9d7d4e3e92dc521082fe5 (diff)
Improved and simplified window texture presentation
Diffstat (limited to 'Ryujinx.HLE/HOS')
-rw-r--r--Ryujinx.HLE/HOS/Services/SurfaceFlinger/NvFlinger.cs43
1 files changed, 21 insertions, 22 deletions
diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/NvFlinger.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/NvFlinger.cs
index 50b55ee0..fa798177 100644
--- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/NvFlinger.cs
+++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/NvFlinger.cs
@@ -1,7 +1,7 @@
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL;
+using Ryujinx.Graphics.Gpu;
using Ryujinx.HLE.HOS.Kernel.Threading;
-using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap;
using System;
using System.Collections.Generic;
@@ -295,11 +295,6 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
_bufferQueue[slot].State = BufferState.Acquired;
- Rect crop = _bufferQueue[slot].Crop;
-
- bool flipX = _bufferQueue[slot].Transform.HasFlag(HalTransform.FlipX);
- bool flipY = _bufferQueue[slot].Transform.HasFlag(HalTransform.FlipY);
-
Format format = ConvertColorFormat(_bufferQueue[slot].Data.Buffer.Surfaces[0].ColorFormat);
int bytesPerPixel =
@@ -310,7 +305,20 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
// Note: Rotation is being ignored.
- ITexture texture = context.Device.Gpu.GetTexture(
+ Rect cropRect = _bufferQueue[slot].Crop;
+
+ bool flipX = _bufferQueue[slot].Transform.HasFlag(HalTransform.FlipX);
+ bool flipY = _bufferQueue[slot].Transform.HasFlag(HalTransform.FlipY);
+
+ ImageCrop crop = new ImageCrop(
+ cropRect.Left,
+ cropRect.Right,
+ cropRect.Top,
+ cropRect.Bottom,
+ flipX,
+ flipY);
+
+ context.Device.Gpu.Window.EnqueueFrameThreadSafe(
fbAddr,
fbWidth,
fbHeight,
@@ -318,24 +326,15 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
false,
gobBlocksInY,
format,
- bytesPerPixel);
-
- _renderer.Window.RegisterTextureReleaseCallback(ReleaseBuffer);
-
- ImageCrop imageCrop = new ImageCrop(
- crop.Left,
- crop.Right,
- crop.Top,
- crop.Bottom,
- flipX,
- flipY);
-
- _renderer.Window.QueueTexture(texture, imageCrop, slot);
+ bytesPerPixel,
+ crop,
+ ReleaseBuffer,
+ slot);
}
- private void ReleaseBuffer(object context)
+ private void ReleaseBuffer(object slot)
{
- ReleaseBuffer((int)context);
+ ReleaseBuffer((int)slot);
}
private void ReleaseBuffer(int slot)