using AcDream.App.Diagnostics; using Silk.NET.OpenGL; namespace AcDream.App.Rendering; /// /// Production render-transaction measurement adapter. CPU frame boundaries /// remain owned by while this adapter places the /// GPU query around only the GL-producing render phases. /// internal sealed class FrameProfilerGpuMeasurement : IRenderFrameGpuMeasurement { private readonly FrameProfiler _profiler; private readonly GL _gl; public FrameProfilerGpuMeasurement(FrameProfiler profiler, GL gl) { _profiler = profiler ?? throw new ArgumentNullException(nameof(profiler)); _gl = gl ?? throw new ArgumentNullException(nameof(gl)); } public void BeginFrame() { _profiler.FrameBoundary(_gl); _profiler.BeginGpuFrame(); } public void EndFrame() { _profiler.EndGpuFrame(); } }