Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
ComputeDebugUtils.cpp
Go to the documentation of this file.
2
3#ifdef COMPUTE_DEBUG
4
6#include <plog/Log.h>
7
8namespace EngineCore::ComputeDebug
9{
10 void logObjectCullingResults( uint32_t objectCount, uint32_t survivingCount )
11 {
12 PLOGI << "[COMPUTE_DEBUG] Object Culling: " << survivingCount << "/" << objectCount
13 << " objects passed frustum culling ("
14 << ( objectCount > 0 ? ( survivingCount * 100.0f / objectCount ) : 0.0f ) << "%)";
15 }
16
17 void logMeshletCullingResults( uint32_t meshletCount, uint32_t visibleCount )
18 {
19 PLOGI << "[COMPUTE_DEBUG] Meshlet Culling: " << visibleCount << "/" << meshletCount
20 << " meshlets visible ("
21 << ( meshletCount > 0 ? ( visibleCount * 100.0f / meshletCount ) : 0.0f ) << "%)";
22 }
23
24 void logCounter( const char * name, uint32_t value )
25 {
26 PLOGI << "[COMPUTE_DEBUG] Counter '" << name << "': " << value;
27 }
28
29 uint32_t readbackCounter(
30 VkDevice device,
31 VkPhysicalDevice physicalDevice,
32 const VulkanBuffer & buffer
33 )
34 {
35 auto result = readbackBuffer<uint32_t>( device, physicalDevice, buffer, 1 );
36 return result.empty() ? 0 : result[0];
37 }
38
39} // namespace EngineCore::ComputeDebug
40
41#endif // COMPUTE_DEBUG
42
43
44
45
46
47
48
49
50
51
52