From 389a97bd9dd66674fb9b0c2c2bca685524287260 Mon Sep 17 00:00:00 2001 From: Panos Karabelas Date: Tue, 24 Dec 2024 15:01:09 +0000 Subject: [PATCH] [misc] improved some performance metrics related things --- runtime/Profiling/Profiler.cpp | 20 +++----------------- runtime/Profiling/Profiler.h | 4 ---- runtime/RHI/Vulkan/Vulkan_CommandList.cpp | 6 ------ runtime/Rendering/Font/Font.cpp | 2 +- 4 files changed, 4 insertions(+), 28 deletions(-) diff --git a/runtime/Profiling/Profiler.cpp b/runtime/Profiling/Profiler.cpp index 728900bf6..e205583ce 100644 --- a/runtime/Profiling/Profiler.cpp +++ b/runtime/Profiling/Profiler.cpp @@ -41,7 +41,6 @@ namespace Spartan // metrics - rhi uint32_t Profiler::m_rhi_draw = 0; uint32_t Profiler::m_rhi_timeblock_count = 0; - uint32_t Profiler::m_rhi_pipeline_bindings = 0; uint32_t Profiler::m_rhi_pipeline_barriers = 0; uint32_t Profiler::m_rhi_bindings_buffer_index = 0; uint32_t Profiler::m_rhi_bindings_buffer_vertex = 0; @@ -54,7 +53,6 @@ namespace Spartan uint32_t Profiler::m_rhi_bindings_shader_compute = 0; uint32_t Profiler::m_rhi_bindings_render_target = 0; uint32_t Profiler::m_rhi_bindings_texture_storage = 0; - uint32_t Profiler::m_rhi_bindings_descriptor_set = 0; // misc uint32_t Profiler::m_descriptor_set_count = 0; @@ -231,7 +229,6 @@ namespace Spartan m_rhi_draw = 0; m_rhi_timeblock_count = 0; - m_rhi_pipeline_bindings = 0; m_rhi_pipeline_barriers = 0; m_rhi_bindings_buffer_index = 0; m_rhi_bindings_buffer_vertex = 0; @@ -244,7 +241,6 @@ namespace Spartan m_rhi_bindings_shader_compute = 0; m_rhi_bindings_render_target = 0; m_rhi_bindings_texture_storage = 0; - m_rhi_bindings_descriptor_set = 0; } void Profiler::ReadTimeBlocks() @@ -461,14 +457,9 @@ namespace Spartan "Draw:\t\t\t\t\t\t\t\t\t\t\t%u\n" "Index buffer bindings:\t\t\t%u\n" "Vertex buffer bindings:\t\t%u\n" - "Descriptor set bindings:\t\t%u\n" - "Bindings:\t\t\t\t\t\t\t\t\t%u\n" - "Barriers:\t\t\t\t\t\t\t\t\t%u\n\n" - "Resources\n" - "Textures:\t\t\t\t\t\t\t\t%u\n" - "Materials:\t\t\t\t\t\t\t%u\n" - "Pipelines:\t\t\t\t\t\t\t\t%u\n" - "Descriptor set capacity:\t%u/%u", + "Barriers:\t\t\t\t\t\t\t\t\t%u\n" + "Pipelines:\t\t\t\t\t\t\t\t\t%u\n" + "Descriptor set capacity:\t\t%u/%u", m_fps, time_frame_avg, @@ -505,12 +496,7 @@ namespace Spartan m_rhi_draw, m_rhi_bindings_buffer_index, m_rhi_bindings_buffer_vertex, - m_rhi_bindings_descriptor_set, - m_rhi_pipeline_bindings, m_rhi_pipeline_barriers, - - ResourceCache::GetResourceCount(ResourceType::Texture), - ResourceCache::GetResourceCount(ResourceType::Material), RHI_Device::GetPipelineCount(), m_descriptor_set_count, rhi_max_descriptor_set_count ); diff --git a/runtime/Profiling/Profiler.h b/runtime/Profiling/Profiler.h index 4ec16ba38..29084e3cd 100644 --- a/runtime/Profiling/Profiler.h +++ b/runtime/Profiling/Profiler.h @@ -66,7 +66,6 @@ namespace Spartan // metrics - rhi static uint32_t m_rhi_draw; static uint32_t m_rhi_timeblock_count; - static uint32_t m_rhi_pipeline_bindings; static uint32_t m_rhi_pipeline_barriers; static uint32_t m_rhi_bindings_buffer_index; static uint32_t m_rhi_bindings_buffer_vertex; @@ -79,7 +78,6 @@ namespace Spartan static uint32_t m_rhi_bindings_shader_compute; static uint32_t m_rhi_bindings_render_target; static uint32_t m_rhi_bindings_texture_storage; - static uint32_t m_rhi_bindings_descriptor_set; // misc static uint32_t m_descriptor_set_count; @@ -92,7 +90,6 @@ namespace Spartan { m_rhi_draw = 0; m_rhi_timeblock_count = 0; - m_rhi_pipeline_bindings = 0; m_rhi_pipeline_barriers = 0; m_rhi_bindings_buffer_index = 0; m_rhi_bindings_buffer_vertex = 0; @@ -105,7 +102,6 @@ namespace Spartan m_rhi_bindings_shader_compute = 0; m_rhi_bindings_render_target = 0; m_rhi_bindings_texture_storage = 0; - m_rhi_bindings_descriptor_set = 0; } static void AcquireGpuData(); diff --git a/runtime/RHI/Vulkan/Vulkan_CommandList.cpp b/runtime/RHI/Vulkan/Vulkan_CommandList.cpp index da6bd59c1..5fcd2b221 100644 --- a/runtime/RHI/Vulkan/Vulkan_CommandList.cpp +++ b/runtime/RHI/Vulkan/Vulkan_CommandList.cpp @@ -302,7 +302,6 @@ namespace Spartan ); bind_dynamic = false; - Profiler::m_rhi_bindings_descriptor_set++; } void set_bindless(const RHI_PipelineState pso, void* resource, void* pipeline_layout) @@ -326,8 +325,6 @@ namespace Spartan 0, // dynamicOffsetCount nullptr // pDynamicOffsets ); - - Profiler::m_rhi_bindings_descriptor_set++; } } @@ -567,9 +564,6 @@ namespace Spartan VkPipelineBindPoint pipeline_bind_point = m_pso.IsCompute() ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS; vkCmdBindPipeline(static_cast(m_rhi_resource), pipeline_bind_point, vk_pipeline); - // profile - Profiler::m_rhi_pipeline_bindings++; - // set some dynamic states if (m_pso.IsGraphics()) { diff --git a/runtime/Rendering/Font/Font.cpp b/runtime/Rendering/Font/Font.cpp index bc8fdd443..109ebc22d 100644 --- a/runtime/Rendering/Font/Font.cpp +++ b/runtime/Rendering/Font/Font.cpp @@ -93,7 +93,7 @@ namespace Spartan } // vkCmdUpdateBuffer has a limit of 65536 bytes, memcpy is used beyond that - if (size_bytes >= 65536) + if (size_bytes >= 65536 || Renderer::GetFrameNumber() < 1) return; }