From f7bcc884e46805f4dcda4fc7d7e7bccb2a3ac316 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 31 Dec 2019 17:08:20 -0300 Subject: Add XML documentation to Ryujinx.Graphics.Gpu --- Ryujinx.Graphics.Gpu/Window.cs | 60 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Window.cs') diff --git a/Ryujinx.Graphics.Gpu/Window.cs b/Ryujinx.Graphics.Gpu/Window.cs index d5494aa4..29c36248 100644 --- a/Ryujinx.Graphics.Gpu/Window.cs +++ b/Ryujinx.Graphics.Gpu/Window.cs @@ -7,17 +7,45 @@ namespace Ryujinx.Graphics.Gpu { using Texture = Image.Texture; + /// + /// GPU image presentation window. + /// public class Window { private readonly GpuContext _context; + /// + /// Texture presented on the window. + /// private struct PresentationTexture { - public TextureInfo Info { get; } - public ImageCrop Crop { get; } + /// + /// Texture information. + /// + public TextureInfo Info { get; } + + /// + /// Texture crop region. + /// + public ImageCrop Crop { get; } + + /// + /// Texture release callback. + /// public Action Callback { get; } - public object UserObj { get; } + /// + /// User defined object, passed to the release callback. + /// + public object UserObj { get; } + + /// + /// Creates a new instance of the presentation texture. + /// + /// Information of the texture to be presented + /// Texture crop region + /// Texture release callback + /// User defined object passed to the release callback, can be used to identify the texture public PresentationTexture( TextureInfo info, ImageCrop crop, @@ -33,6 +61,10 @@ namespace Ryujinx.Graphics.Gpu private readonly ConcurrentQueue _frameQueue; + /// + /// Creates a new instance of the GPU presentation window. + /// + /// GPU emulation context public Window(GpuContext context) { _context = context; @@ -40,6 +72,23 @@ namespace Ryujinx.Graphics.Gpu _frameQueue = new ConcurrentQueue(); } + /// + /// Enqueues a frame for presentation. + /// This method is thread safe and can be called from any thread. + /// When the texture is presented and not needed anymore, the release callback is called. + /// It's an error to modify the texture after calling this method, before the release callback is called. + /// + /// CPU virtual address of the texture data + /// Texture width + /// Texture height + /// Texture stride for linear texture, should be zero otherwise + /// Indicates if the texture is linear, normally false + /// GOB blocks in the Y direction, for block linear textures + /// Texture format + /// Texture format bytes per pixel (must match the format) + /// Texture crop region + /// Texture release callback + /// User defined object passed to the release callback public void EnqueueFrameThreadSafe( ulong address, int width, @@ -74,6 +123,11 @@ namespace Ryujinx.Graphics.Gpu _frameQueue.Enqueue(new PresentationTexture(info, crop, callback, userObj)); } + /// + /// Presents a texture on the queue. + /// If the queue is empty, then no texture is presented. + /// + /// Callback method to call when a new texture should be presented on the screen public void Present(Action swapBuffersCallback) { _context.AdvanceSequence(); -- cgit v1.2.3