Cogs.Core
WebGPUCountersInspector.cpp
1#include "Inspectors.h"
2
3#include "Context.h"
4#include "InspectorGuiHelper.h"
5
6#include "Rendering/IGraphicsDevice.h"
7#include "Rendering/Statistics.h"
8
9void Cogs::Core::webgpuCountersInspector(Context* context, IRenderer * /*renderer*/, bool* show)
10{
11 if (*show) {
12 guiBegin("WebGPU Counters Inspector", show);
13
14 ResourceCountersWebGPU counters = context->device->getResourceCountersWebGPU();
15
16 ImGui::Columns(3);
17
18 ImGui::Text("Shader Module");
19 ImGui::NextColumn();
20 ImGui::Text("%u", counters.shader_module);
21 ImGui::NextColumn();
22 ImGui::NextColumn();
23
24 ImGui::Text("Buffer");
25 ImGui::NextColumn();
26 ImGui::Text("%u", counters.buffer);
27 ImGui::NextColumn();
28 ImGui::NextColumn();
29
30 ImGui::Text("Texture");
31 ImGui::NextColumn();
32 ImGui::Text("%u", counters.texture);
33 ImGui::NextColumn();
34 ImGui::NextColumn();
35
36 ImGui::Text("Texture View");
37 ImGui::NextColumn();
38 ImGui::Text("%u", counters.texture_view);
39 ImGui::NextColumn();
40 ImGui::NextColumn();
41
42 ImGui::Text("Sampler");
43 ImGui::NextColumn();
44 ImGui::Text("%u", counters.sampler);
45 ImGui::NextColumn();
46 ImGui::NextColumn();
47
48 ImGui::Text("Render Pipeline");
49 ImGui::NextColumn();
50 ImGui::Text("%u", counters.render_pipeline);
51 ImGui::NextColumn();
52 ImGui::NextColumn();
53
54 ImGui::Text("Compute Pipeline");
55 ImGui::NextColumn();
56 ImGui::Text("%u", counters.compute_pipeline);
57 ImGui::NextColumn();
58 ImGui::NextColumn();
59
60 ImGui::Text("pipeline_layout");
61 ImGui::NextColumn();
62 ImGui::Text("%u", counters.pipeline_layout);
63 ImGui::NextColumn();
64 ImGui::NextColumn();
65
66 ImGui::Text("bind_group");
67 ImGui::NextColumn();
68 ImGui::Text("%u", counters.bind_group);
69 ImGui::NextColumn();
70 ImGui::NextColumn();
71
72 ImGui::Text("Bind Group Layout");
73 ImGui::NextColumn();
74 ImGui::Text("%u", counters.bind_group_layout);
75 ImGui::NextColumn();
76 ImGui::NextColumn();
77
78 guiEnd();
79 }
80}