Displaying used ram and vram on the hud

pull/20/head
FlightlessMango 4 years ago committed by jackun
parent 6affdb8c51
commit beaac191d1
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -61,6 +61,7 @@ const char* offset_y_env = std::getenv("Y_OFFSET");
string engineName, engineVersion; string engineName, engineVersion;
ImFont* font = nullptr; ImFont* font = nullptr;
ImFont* font1 = nullptr; ImFont* font1 = nullptr;
struct amdGpu amdgpu;
/* Mapped from VkInstace/VkPhysicalDevice */ /* Mapped from VkInstace/VkPhysicalDevice */
struct instance_data { struct instance_data {
@ -874,7 +875,6 @@ static void snapshot_swapchain_frame(struct swapchain_data *data)
if (device_data->properties.vendorID == 0x10de) if (device_data->properties.vendorID == 0x10de)
device_data->gpu_stats = checkNvidia(); device_data->gpu_stats = checkNvidia();
// coreCounting();
if (device_data->properties.vendorID == 0x8086 || gpu.find("Radeon") != std::string::npos || gpu.find("AMD") != std::string::npos) { if (device_data->properties.vendorID == 0x8086 || gpu.find("Radeon") != std::string::npos || gpu.find("AMD") != std::string::npos) {
string path; string path;
string drm = "/sys/class/drm/"; string drm = "/sys/class/drm/";
@ -893,6 +893,8 @@ static void snapshot_swapchain_frame(struct swapchain_data *data)
#endif #endif
if (file_exists(path + "/device/gpu_busy_percent")) { if (file_exists(path + "/device/gpu_busy_percent")) {
amdGpuFile = fopen((path + "/device/gpu_busy_percent").c_str(), "r"); amdGpuFile = fopen((path + "/device/gpu_busy_percent").c_str(), "r");
amdGpuVramTotalFile = fopen((path + "/device/mem_info_vram_total").c_str(), "r");
amdGpuVramUsedFile = fopen((path + "/device/mem_info_vram_used").c_str(), "r");
path = path + "/device/hwmon/"; path = path + "/device/hwmon/";
string tempFolder; string tempFolder;
if (find_folder(path, "hwmon", tempFolder)) { if (find_folder(path, "hwmon", tempFolder)) {
@ -1172,9 +1174,12 @@ static void compute_swapchain_display(struct swapchain_data *data)
i++; i++;
} }
} }
ImGui::TextColored(ImVec4(0.502, 0.502, 0.753, 1.00f), "MEM"); ImGui::TextColored(ImVec4(0.678, 0.392, 0.756, 1.00f), "VRAM");
ImGui::SameLine(hudFirstRow); ImGui::SameLine(hudFirstRow);
ImGui::Text("%.1fG/%.1fG", memused, memmax); ImGui::Text("%iMB", gpuMemUsed);
ImGui::TextColored(ImVec4(0.760, 0.4, 0.576, 1.00f), "RAM");
ImGui::SameLine(hudFirstRow);
ImGui::Text("%.1fG", memused);
if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_fps]){ if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_fps]){
ImGui::TextColored(ImVec4(0.925, 0.411, 0.411, 1.00f), "%s", engineName.c_str()); ImGui::TextColored(ImVec4(0.925, 0.411, 0.411, 1.00f), "%s", engineName.c_str());
ImGui::SameLine(hudFirstRow); ImGui::SameLine(hudFirstRow);

Loading…
Cancel
Save