From 700e9bb684dce2045d5417a8b59b1247485249ef Mon Sep 17 00:00:00 2001 From: ParantezTech <12572227+par274@users.noreply.github.com> Date: Tue, 6 Oct 2026 17:47:33 +0300 Subject: [PATCH] [GPU] Number command stream submissions in admission order Co-authored-by: Sekai <140012992+igettingit@users.noreply.github.com> --- src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs | 2 ++ src/SharpEmu.Libs/Gpu/GpuCommands/CommandSubmission.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs b/src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs index d0a0de6..cd25cc7 100644 --- a/src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs +++ b/src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs @@ -39,6 +39,7 @@ public sealed class CommandStreamQueue private readonly GpuCommandInterpreter?[] _interpreters = new GpuCommandInterpreter?[QueueCount]; private int _nextQueue; private int _submissionCount; + private ulong _admissionOrdinal; private bool _accepting = true; private bool _stopping; private bool _processing; @@ -200,6 +201,7 @@ public sealed class CommandStreamQueue throw _host.Fatal($"The command stream no longer accepts submissions: queue={submission.QueueId} address=0x{submission.Address:X16}."); } + submission.AdmissionOrdinal = ++_admissionOrdinal; _queues[submission.QueueId].AddLast(submission); _submissionCount++; if (submission.Kind is not (CommandSubmissionKind.FlipPreparation or CommandSubmissionKind.FrameBoundary)) diff --git a/src/SharpEmu.Libs/Gpu/GpuCommands/CommandSubmission.cs b/src/SharpEmu.Libs/Gpu/GpuCommands/CommandSubmission.cs index 701022d..5ec2b47 100644 --- a/src/SharpEmu.Libs/Gpu/GpuCommands/CommandSubmission.cs +++ b/src/SharpEmu.Libs/Gpu/GpuCommands/CommandSubmission.cs @@ -101,6 +101,8 @@ public sealed class CommandSubmission // The submitter's own sequence number, kept for diagnostics and the translation state. public ulong SubmissionId { get; } + internal ulong AdmissionOrdinal { get; set; } + // Snapshots captured at submit time; the processor never reads them. public object? GeometrySnapshots { get; }