From f5c66a52210770e778c05d581541c629ec2f24d2 Mon Sep 17 00:00:00 2001 From: GreemDev Date: Wed, 31 Dec 2025 21:19:52 -0600 Subject: [PATCH] RenderDoc.SetMostRecentCaptureFileComments --- .../RenderDoc.cs | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.RenderDocApi/RenderDoc.cs b/src/Ryujinx.Graphics.RenderDocApi/RenderDoc.cs index 51bc7c12c..9d1f53957 100644 --- a/src/Ryujinx.Graphics.RenderDocApi/RenderDoc.cs +++ b/src/Ryujinx.Graphics.RenderDocApi/RenderDoc.cs @@ -408,6 +408,28 @@ namespace Ryujinx.Graphics.RenderDocApi Api->TriggerMultiFrameCapture(numFrames); } + /// + /// Adds an arbitrary comments field to the most recent capture, + /// which will then be displayed in the UI to anyone opening the capture. + ///

+ /// This is equivalent to calling with a null first (fileName) parameter. + ///
+ /// the comments to set in the capture file. + /// Requires RenderDoc API version 1.2 + public static void SetMostRecentCaptureFileComments(string comments) + { + if (Api is null) return; + + AssertAtLeast(1, 2); + + byte[] commentBytes = comments.ToNullTerminatedByteArray(); + + fixed (byte* pcomment = commentBytes) + { + Api->SetCaptureFileComments((byte*)nint.Zero, pcomment); + } + } + /// /// Adds an arbitrary comments field to an existing capture on disk, /// which will then be displayed in the UI to anyone opening the capture. @@ -531,7 +553,7 @@ namespace Ryujinx.Graphics.RenderDocApi } private static RenderDocApi* _api = null; - private static bool _loaded = false; + private static bool _loaded; private static RenderDocApi* Api {