Skip to content

Commit

Permalink
[misc] improved some performance metrics related things
Browse files Browse the repository at this point in the history
  • Loading branch information
PanosK92 committed Dec 24, 2024
1 parent 374f06b commit 389a97b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
20 changes: 3 additions & 17 deletions runtime/Profiling/Profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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()
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
);
Expand Down
4 changes: 0 additions & 4 deletions runtime/Profiling/Profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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();
Expand Down
6 changes: 0 additions & 6 deletions runtime/RHI/Vulkan/Vulkan_CommandList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -326,8 +325,6 @@ namespace Spartan
0, // dynamicOffsetCount
nullptr // pDynamicOffsets
);

Profiler::m_rhi_bindings_descriptor_set++;
}
}

Expand Down Expand Up @@ -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<VkCommandBuffer>(m_rhi_resource), pipeline_bind_point, vk_pipeline);

// profile
Profiler::m_rhi_pipeline_bindings++;

// set some dynamic states
if (m_pso.IsGraphics())
{
Expand Down
2 changes: 1 addition & 1 deletion runtime/Rendering/Font/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 389a97b

Please sign in to comment.