ThreadedWindow.cs
1 using Ryujinx.Graphics.GAL.Multithreading.Commands.Window; 2 using Ryujinx.Graphics.GAL.Multithreading.Model; 3 using Ryujinx.Graphics.GAL.Multithreading.Resources; 4 using System; 5 6 namespace Ryujinx.Graphics.GAL.Multithreading 7 { 8 public class ThreadedWindow : IWindow 9 { 10 private readonly ThreadedRenderer _renderer; 11 private readonly IRenderer _impl; 12 13 public ThreadedWindow(ThreadedRenderer renderer, IRenderer impl) 14 { 15 _renderer = renderer; 16 _impl = impl; 17 } 18 19 public void Present(ITexture texture, ImageCrop crop, Action swapBuffersCallback) 20 { 21 // If there's already a frame in the pipeline, wait for it to be presented first. 22 // This is a multithread rate limit - we can't be more than one frame behind the command queue. 23 24 _renderer.WaitForFrame(); 25 _renderer.New<WindowPresentCommand>().Set(new TableRef<ThreadedTexture>(_renderer, texture as ThreadedTexture), crop, new TableRef<Action>(_renderer, swapBuffersCallback)); 26 _renderer.QueueCommand(); 27 } 28 29 public void SetSize(int width, int height) 30 { 31 _impl.Window.SetSize(width, height); 32 } 33 34 public void ChangeVSyncMode(bool vsyncEnabled) { } 35 36 public void SetAntiAliasing(AntiAliasing effect) { } 37 38 public void SetScalingFilter(ScalingFilter type) { } 39 40 public void SetScalingFilterLevel(float level) { } 41 42 public void SetColorSpacePassthrough(bool colorSpacePassthroughEnabled) { } 43 } 44 }