Instance a VkPhysicalDeviceMemoryBudgetPropertiesEXT.
Instance a VkPhysicalDeviceMemoryProperties2.
Query memory data this frame.
Begin render VideoMemoryRuntimeHUD.
Search String.
End render VideoMemoryRuntimeHUD.
Instance a VkPhysicalDeviceMemoryBudgetPropertiesEXT.
Instance a VkPhysicalDeviceMemoryProperties2.
Query memory data this frame.
Begin render VideoMemoryRuntimeHUD.
Search String.
End render VideoMemoryRuntimeHUD.
22 {
24
26
30 VkPhysicalDeviceMemoryBudgetPropertiesEXT memoryBudgetProperties{};
31 memoryBudgetProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
32 memoryBudgetProperties.pNext = nullptr;
33
37 VkPhysicalDeviceMemoryProperties2 memoryProperties{};
38 memoryProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
39 memoryProperties.pNext = &memoryBudgetProperties;
40
45
46 uint64_t nHeaps = memoryProperties.memoryProperties.memoryHeapCount;
47 VkDeviceSize usage = 0;
48 VkDeviceSize budget = 0;
49
50 for (uint64_t i = 0; i < nHeaps; i++)
51 {
52 usage += memoryBudgetProperties.heapUsage[i];
53 budget += memoryBudgetProperties.heapBudget[i];
54 }
55
60
61 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2.0f, 4.0f));
62
66 static std::string searchString;
67 static bool isEnableSearch = false;
68
72 {
74
75 ImGui::Spacing();
77 static char search[256] = {};
78 if (ImGui::InputTextWithHint(
"##",
ICON_TEXT(ICON_MD_SEARCH, Search), search, 128))
79 {
80 searchString = std::string(search);
81 if (searchString.size() == 0) isEnableSearch = false;
82 else isEnableSearch = true;
83 }
84 ImGui::PopItemWidth();
85
90 ImGui::Spacing();
91 }
92
94
95 {
97
101 char buffer[256] = {};
103 ImGui::PopItemWidth();
104 ImGui::SameLine();
106 });
109 char buffer[256] = {};
111 ImGui::PopItemWidth();
112 ImGui::SameLine();
114 });
117 char buffer[256] = {};
119 ImGui::PopItemWidth();
120 ImGui::SameLine();
122 });
123 });
124 }
125
126 {
128
129 for (int i = 0; i < nHeaps; i++)
130 {
131 std::stringstream s;
132 s << "Memory Heap Index: " << i;
133
135 ImGuiH::DrawPropertyItem("Usage:", columeWidth, nullptr, [&]() {
136 ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - ImGuiH::GetLineItemSize().x);
137 char buffer[256] = {};
138 ImGui::InputTextWithHint("##", ICON_TEXT_ROW(" ", ConvertBytestoString(memoryBudgetProperties.heapUsage[i]).c_str()), buffer, sizeof(buffer));
139 ImGui::PopItemWidth();
140 ImGui::SameLine();
141 ImGuiH::DrawResetIcon(false);
142 });
145 char buffer[256] = {};
147 ImGui::PopItemWidth();
148 ImGui::SameLine();
150 });
153 char buffer[256] = {};
155 ImGui::PopItemWidth();
156 ImGui::SameLine();
158 });
159 });
160 }
161 }
162
163 ImGui::PopStyleVar();
164
169 }
#define ICON_TEXT(icon, text)
#define ICON_TEXT_ROW(icon, text)
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
static bool DrawResetIcon(const bool &isMove)
Draw Reset Icon.
static void DrawPropertyItem(const std::string &itemName, float columeWidth, std::function< void()> nameFunc, std::function< void()> valFunc)
Draw a single property.
static void DrawTreeTitle(const std::string &treeName, std::function< void()> optionFunc, std::function< void()> treeFunc)
Draw a stylized tree title bar.
void Begin(float alpha=1.0f, ImGuiWindowFlags flags=0)
Begin a common slate.
ImVec2 m_PanelSize
This slate's size.
std::string ConvertBytestoString(uint64_t bytes)
Convert bytes to string(GB/MB/KB).
std::string ConvertMemoryFlagtoString(VkMemoryHeapFlags flag)
Convert memory flags to string.
static VulkanState & GetState()
Get VulkanState in use.
std::string to_string(GFSDK_Aftermath_Result result)
Convert GFSDK_Aftermath_Result to string.