diff --git a/src/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoProcessor.cs b/src/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoProcessor.cs index 984a9cff8..6ff980f15 100644 --- a/src/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoProcessor.cs +++ b/src/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoProcessor.cs @@ -134,7 +134,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo _state.NonIncrementing = meth.SecOp == SecOp.NonIncMethod; break; case SecOp.ImmdDataMethod: - Send(gpuVa, meth.MethodAddress, meth.ImmdData, meth.MethodSubchannel, true); + // Send(gpuVa, meth.MethodAddress, meth.ImmdData, meth.MethodSubchannel, true); break; } } @@ -228,6 +228,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo { case 0: _3dClass.Write(offset, argument); + //_2dClass.Write(offset, argument); break; case 1: _computeClass.Write(offset, argument); diff --git a/src/Ryujinx.Graphics.Gpu/Window.cs b/src/Ryujinx.Graphics.Gpu/Window.cs index 59cd4c8a6..8a40891b9 100644 --- a/src/Ryujinx.Graphics.Gpu/Window.cs +++ b/src/Ryujinx.Graphics.Gpu/Window.cs @@ -141,7 +141,7 @@ namespace Ryujinx.Graphics.Gpu { return false; } - + //return false; FormatInfo formatInfo = new(format, 1, 1, bytesPerPixel, 4); TextureInfo info = new( diff --git a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs index 601e85867..a5d23f78c 100644 --- a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs +++ b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading; +using System.Xml.Schema; using VSyncMode = Ryujinx.Common.Configuration.VSyncMode; namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger @@ -304,15 +305,16 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger while (_isRunning) { + //continue; long ticks = PerformanceCounter.ElapsedTicks; if (_swapInterval == 0) { Compose(); - _device.System?.SignalVsync(); + //_device.System?.SignalVsync(); - _nextFrameEvent.WaitOne(17); + _nextFrameEvent.WaitOne(2);//17 lastTicks = ticks; } else @@ -355,6 +357,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger } } } + int l = 0; } public void Compose() @@ -392,6 +395,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger } PostFrameBuffer(layer, item); + } else if (acquireStatus != Status.NoBufferAvailaible && acquireStatus != Status.InvalidOperation) { @@ -399,10 +403,17 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger } } } - + static int xx = 0; private void PostFrameBuffer(Layer layer, BufferItem item) { - int frameBufferWidth = item.GraphicBuffer.Object.Width; + TextureCallbackInformation textureCallbackInformation = new() + { + Layer = layer, + Item = item, + }; + if (xx == 0) + { + int frameBufferWidth = item.GraphicBuffer.Object.Width; int frameBufferHeight = item.GraphicBuffer.Object.Height; int nvMapHandle = item.GraphicBuffer.Object.Buffer.Surfaces[0].NvMapHandle; @@ -412,7 +423,8 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger nvMapHandle = item.GraphicBuffer.Object.Buffer.NvMapId; } - ulong bufferOffset = (ulong)item.GraphicBuffer.Object.Buffer.Surfaces[0].Offset; + + ulong bufferOffset = (ulong)item.GraphicBuffer.Object.Buffer.Surfaces[0].Offset; NvMapHandle map = NvMapDeviceFile.GetMapFromHandle(layer.Owner, nvMapHandle); @@ -446,44 +458,49 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger aspectRatio.ToFloatX(), aspectRatio.ToFloatY()); - TextureCallbackInformation textureCallbackInformation = new() - { - Layer = layer, - Item = item, - }; - if (_device.Gpu.Window.EnqueueFrameThreadSafe( - layer.Owner, - frameBufferAddress, - frameBufferWidth, - frameBufferHeight, - 0, - false, - gobBlocksInY, - format, - bytesPerPixel, - crop, - AcquireBuffer, - ReleaseBuffer, - textureCallbackInformation)) - { - if (item.Fence.FenceCount == 0) + + if (_device.Gpu.Window.EnqueueFrameThreadSafe( + layer.Owner, + frameBufferAddress, + frameBufferWidth, + frameBufferHeight, + 0, + false, + gobBlocksInY, + format, + bytesPerPixel, + crop, + AcquireBuffer, + ReleaseBuffer, + textureCallbackInformation)) { - _device.Gpu.Window.SignalFrameReady(); - _device.Gpu.GPFifo.Interrupt(); - } - else - { - item.Fence.RegisterCallback(_device.Gpu, (x) => + if (item.Fence.FenceCount == 0) { _device.Gpu.Window.SignalFrameReady(); _device.Gpu.GPFifo.Interrupt(); - }); + } + else + { + item.Fence.RegisterCallback(_device.Gpu, (x) => + { + _device.Gpu.Window.SignalFrameReady(); + _device.Gpu.GPFifo.Interrupt(); + }); + } } + else + { + ReleaseBuffer(textureCallbackInformation); + } + xx++; } else { ReleaseBuffer(textureCallbackInformation); + xx++; + if (xx > 1000) + { xx = 0; } } }