From f3594a890006be7389d92b88c55e57b7263c7041 Mon Sep 17 00:00:00 2001 From: myT <> Date: Fri, 20 Dec 2024 01:32:58 +0100 Subject: [PATCH] added GPU upload wait time in the dev print --- code/renderer/rhi_d3d12.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/renderer/rhi_d3d12.cpp b/code/renderer/rhi_d3d12.cpp index c90e4f7..e17e9b2 100644 --- a/code/renderer/rhi_d3d12.cpp +++ b/code/renderer/rhi_d3d12.cpp @@ -1162,11 +1162,14 @@ namespace RHI void UploadManager::EndOfBufferReached() { - ri.Printf(PRINT_DEVELOPER, "Waiting for GPU upload: %s (%d T, %d B)\n", + const int64_t startUS = Sys_Microseconds(); + fence.WaitOnCPU(fenceValue); + const int64_t elapsedUS = Sys_Microseconds() - startUS; + ri.Printf(PRINT_DEVELOPER, "Waited %d ms for GPU upload: %s (%d T, %d B)\n", + (int)(elapsedUS / 1000), Com_FormatBytes(bufferByteOffset), batchTextureCount, batchBufferCount); - fence.WaitOnCPU(fenceValue); D3D(commandAllocator->Reset()); bufferByteOffset = 0; batchTextureCount = 0;