From 17ac3c27b4e13403617c7a51894e638219b581e8 Mon Sep 17 00:00:00 2001 From: RaveYard <29225776+MrRaveYard@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:40:15 +0200 Subject: [PATCH] Extend lightmapping stat --- .../rendering/vulkan/accelstructs/vk_lightmap.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp b/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp index 4c43be42fd..87a39f707f 100644 --- a/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp +++ b/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp @@ -32,13 +32,13 @@ VkLightmap::~VkLightmap() } static int lastSurfaceCount; +static glcycle_t lightmapRaytrace; +static glcycle_t lightmapRaytraceLast; ADD_STAT(lightmapper) { FString out; - - out.Format("Last batch surface count: %d", lastSurfaceCount); - + out.Format("last: %.3fms\ntotal: %3.fms\nLast batch surface count: %d", lightmapRaytraceLast.TimeMS(), lightmapRaytrace.TimeMS(), lastSurfaceCount); return out; } @@ -47,6 +47,12 @@ void VkLightmap::Raytrace(LevelMesh* level, const TArray& sur bool newLevel = (mesh != level); mesh = level; + lightmapRaytrace.active = true; + lightmapRaytraceLast.active = true; + + lightmapRaytrace.Clock(); + lightmapRaytraceLast.ResetAndClock(); + if (newLevel) { UpdateAccelStructDescriptors(); @@ -73,6 +79,9 @@ void VkLightmap::Raytrace(LevelMesh* level, const TArray& sur BlurAtlasImage(pageIndex); CopyAtlasImageResult(pageIndex, surfaces); } + + lightmapRaytrace.Unclock(); + lightmapRaytraceLast.Unclock(); } void VkLightmap::RenderAtlasImage(size_t pageIndex, const TArray& surfaces)