From abce0443859f4bd849e9646ac85d4695476c5553 Mon Sep 17 00:00:00 2001 From: RDW Date: Mon, 5 Feb 2024 01:29:00 +0100 Subject: [PATCH] Update NativeClient.lua --- Core/NativeClient/NativeClient.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Core/NativeClient/NativeClient.lua b/Core/NativeClient/NativeClient.lua index e49f0197..443acf6d 100644 --- a/Core/NativeClient/NativeClient.lua +++ b/Core/NativeClient/NativeClient.lua @@ -90,6 +90,22 @@ function NativeClient:StartRenderLoop() self.fpsDisplayTicker = C_Timer.NewTicker(2500, function() print(PerformanceMetricsOverlay:GetFormattedMetricsString()) PerformanceMetricsOverlay:StartMeasuring() + local report = ffi.new("WGPUGlobalReport") + require("webgpu").bindings.wgpu_generate_report(Renderer.wgpuInstance, report) + printf("Global report for backend type %s:", report.backendType) + printf([[Surfaces: +Allocated: %d +Kept: %d +Released: %d +Error: %d +Count: %d +]], + report.surfaces.numAllocated, + report.surfaces.numKeptFromUser, + report.surfaces.numReleasedFromUser, + report.surfaces.numError, + report.surfaces.elementSize +) end) while glfw.bindings.glfw_window_should_close(self.mainWindow) == 0 do