From f915d890f2494092cca57e9746fea1dc66d471ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 11 Jun 2020 13:47:24 +0200 Subject: [PATCH 1/9] Fix -Wformat-security warning with GCC 10.1 --- src/overlay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/overlay.cpp b/src/overlay.cpp index 94c1815d..27cb57cf 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -1044,12 +1044,12 @@ void render_benchmark(swapchain_stats& data, struct overlay_params& params, ImVe ImGui::Begin("Benchmark", &open, ImGuiWindowFlags_NoDecoration); static const char* finished = "Logging Finished"; ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2 )- (ImGui::CalcTextSize(finished).x / 2)); - ImGui::TextColored(ImVec4(1.0, 1.0, 1.0, alpha / params.background_alpha), finished); + ImGui::TextColored(ImVec4(1.0, 1.0, 1.0, alpha / params.background_alpha), "%s", finished); ImGui::Dummy(ImVec2(0.0f, 8.0f)); char duration[20]; snprintf(duration, sizeof(duration), "Duration: %.1fs", float(log_end - log_start) / 1000000); ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2 )- (ImGui::CalcTextSize(duration).x / 2)); - ImGui::TextColored(ImVec4(1.0, 1.0, 1.0, alpha / params.background_alpha), duration); + ImGui::TextColored(ImVec4(1.0, 1.0, 1.0, alpha / params.background_alpha), "%s", duration); for (auto& data_ : benchmark_data){ char buffer[20]; snprintf(buffer, sizeof(buffer), "%s %.1f", data_.first.c_str(), data_.second); From bf5ad264cb765008b1e737d2db16ccc98346566d Mon Sep 17 00:00:00 2001 From: jackun Date: Thu, 11 Jun 2020 16:25:05 +0300 Subject: [PATCH 2/9] [Readme] Add engine_version --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4f9ad629..9aa94dd6 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ A partial list of parameters are below. See the config file for a complete list. | `vulkan_driver` | Displays used vulkan driver, radv/amdgpu-pro/amdvlk | | `gpu_name` | Displays GPU name from pci.ids | | `gpu_power` | Display GPU draw in watts | +| `engine_version` | Display OpenGL or vulkan and vulkan-based render engine's version | Example: `MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_size=32` From 8ed5fe6553d024ac2589297d98a627198996e424 Mon Sep 17 00:00:00 2001 From: Faalagorn Date: Thu, 11 Jun 2020 15:40:17 +0200 Subject: [PATCH 3/9] Added missing options in 0.4.0 * Crosshair is gone as of 0.4.0 * Changed keybindings to the default ones as of 0.4.0 * Added `gpu_name`, `cpu_text`, `gpu_text`, `gpu_power` and `vulkan_driver` in respective sections --- bin/MangoHud.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/MangoHud.conf b/bin/MangoHud.conf index b371c84a..02e93935 100644 --- a/bin/MangoHud.conf +++ b/bin/MangoHud.conf @@ -19,12 +19,17 @@ ### Display the current CPU information cpu_stats # cpu_temp +# cpu_text = "CPU" ### Display the current GPU information gpu_stats # gpu_temp # gpu_core_clock # gpu_mem_clock +# gpu_name +# gpu_power +# gpu_text = "GPU" +# vulkan_driver ### Display loaded MangoHud architecture # arch @@ -89,11 +94,6 @@ background_alpha=0.5 ### Change default font (set location to .TTF/.OTF file ) # font_file -### Crosshair overlay (default size is 30) -# crosshair -# crosshair_size= -# crosshair_color=RRGGBB - ### Show media player metadata # media_player # media_player_name = spotify @@ -106,7 +106,7 @@ background_alpha=0.5 ### Change toggle keybinds for the hud & logging #toggle_hud=Shift_R+F12 -#toggle_logging=F2 +#toggle_logging=Shift_L+F2 #reload_cfg=Shift_L+F4 ################## LOG ################# From b832a47b4a5a881ddcd12ea6e6aa43089e2b137c Mon Sep 17 00:00:00 2001 From: Newbyte Date: Thu, 11 Jun 2020 16:20:37 +0200 Subject: [PATCH 4/9] Add uninstall instructions to README Closes https://github.com/flightlessmango/MangoHud/issues/190 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 9aa94dd6..ef70d6c8 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,12 @@ If you have compiled MangoHud from source, to install it, execute: ./build.sh install ``` +You can then subsequently uninstall MangoHud via the following command + +``` +./build.sh uninstall +``` + ### Pre-packaged binaries #### GitHub releases From d956f60f8680386cb463ac6aa25426899fa8b36e Mon Sep 17 00:00:00 2001 From: Stephan Lachnit Date: Fri, 12 Jun 2020 11:45:16 +0200 Subject: [PATCH 5/9] remove old system nvml build option Signed-off-by: Stephan Lachnit --- meson.build | 6 ------ meson_options.txt | 1 - src/meson.build | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/meson.build b/meson.build index c38b73cc..0f028cde 100644 --- a/meson.build +++ b/meson.build @@ -207,11 +207,5 @@ elif sizeof_ptr == 4 pre_args += '-DMANGOHUD_ARCH="32bit"' endif -if get_option('use_system_nvml') - cpp_nvml_args = '-DUSE_SYSTEM_NVML' -else - cpp_nvml_args = [] -endif - subdir('modules/ImGui') subdir('src') diff --git a/meson_options.txt b/meson_options.txt index 1f458059..2c0394ed 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,5 @@ option('glibcxx_asserts', type : 'boolean', value : false) option('use_system_vulkan', type : 'feature', value : 'disabled', description: 'Use system vulkan headers instead of the provided ones') -option('use_system_nvml', type : 'boolean', value : false, description : 'Use system nvml headers instead of the provided ones') option('mangohud_prefix', type : 'string', value : '', description: 'Add prefix to cross-compiled library, like "lib32-".') option('append_libdir_mangohud', type : 'boolean', value : true, description: 'Append "mangohud" to libdir path or not.') option('include_doc', type : 'boolean', value : true, description: 'Include the example config') diff --git a/src/meson.build b/src/meson.build index 5790fcf5..db74c2af 100644 --- a/src/meson.build +++ b/src/meson.build @@ -52,6 +52,7 @@ if get_option('with_nvml') == 'system' if not nvml_h_found error('nvml.h was not found. Disable with \'-Dwith_nvml=disabled\' if gpu stats by NVML is not needed.') endif + pre_args += '-DUSE_SYSTEM_NVML' endif if nvml_h_found @@ -119,7 +120,6 @@ vklayer_mesa_overlay = shared_library( cpp_args : [ pre_args, cpp_vis_args, - cpp_nvml_args, vulkan_wsi_args ], dependencies : [ From aa4cb1a4a0db032dd3da17b290eda9f19a3eccbd Mon Sep 17 00:00:00 2001 From: Stephan Lachnit Date: Fri, 12 Jun 2020 11:57:59 +0200 Subject: [PATCH 6/9] use git archive to build source tarballs Signed-off-by: Stephan Lachnit --- build-source.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/build-source.sh b/build-source.sh index 6cdcc92c..3ef3af58 100755 --- a/build-source.sh +++ b/build-source.sh @@ -1,10 +1,17 @@ #!/bin/sh -VERSION=$(git describe --tags --dirty=+) +VERSION=$(git describe --tags --dirty) +NAME=MangoHud-$VERSION-Source -FILE_PATTERN="--exclude-vcs --exclude-vcs-ignores ." - -# default version -tar -czf MangoHud-$VERSION-Source.tar.gz $FILE_PATTERN -# DFSG compliant version, excludes NVML -tar -czf MangoHud-$VERSION-Source-DFSG.tar.gz --exclude=include/nvml.h $FILE_PATTERN +# ensure that submodules are present +git submodule update --init +# get everything except submodules +git archive HEAD --format=tar --prefix=${NAME}/ --output=${NAME}.tar +# add imgui submodule +tar -rf ${NAME}.tar --exclude-vcs --transform="s,^modules/ImGui/src,${NAME}/modules/ImGui/src," modules/ImGui/src +# create DFSG compliant version which excludes NVML +cp ${NAME}.tar ${NAME}-DFSG.tar +tar -f ${NAME}-DFSG.tar --delete ${NAME}/include/nvml.h +# compress archives +gzip ${NAME}.tar +gzip ${NAME}-DFSG.tar From 2809c824e20b841b841fa1d14522bf123aa24c69 Mon Sep 17 00:00:00 2001 From: jackun Date: Thu, 18 Jun 2020 13:07:08 +0300 Subject: [PATCH 7/9] Maybe a bit more visible install command --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ef70d6c8..276b3576 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,11 @@ You can then subsequently uninstall MangoHud via the following command #### GitHub releases -If you do not wish to compile anything, simply download the file under [Releases](https://github.com/flightlessmango/MangoHud/releases), extract it, and run `./mangohud-setup.sh install` from within the extracted folder. +If you do not wish to compile anything, simply download the file under [Releases](https://github.com/flightlessmango/MangoHud/releases), extract it, and from within the extracted folder in terminal, execute: + +``` +./mangohud-setup.sh install +``` #### Arch-based distributions From 053a1d8a44981818fd9f6e8eda3fe6e06e0b33a3 Mon Sep 17 00:00:00 2001 From: Kingsley McDonald Date: Thu, 18 Jun 2020 13:35:46 +0100 Subject: [PATCH 8/9] add 0.1% lows to the brief benchmark overlay --- src/overlay.cpp | 4 +++- src/overlay.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/overlay.cpp b/src/overlay.cpp index 27cb57cf..d05c4b28 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -789,6 +789,8 @@ void calculate_benchmark_data(){ benchmark.total = sorted[i]; } benchmark.oneP = benchmark.total; + // 0.1% min + benchmark.pointOneP = sorted[sorted.size() * 0.01]; } void update_hud_info(struct swapchain_stats& sw_stats, struct overlay_params& params, uint32_t vendorID){ @@ -1022,7 +1024,7 @@ void render_benchmark(swapchain_stats& data, struct overlay_params& params, ImVe else ImGui::SetNextWindowPos(ImVec2(data.main_window_pos.x, data.main_window_pos.y + window_size.y + 5), ImGuiCond_Always); - vector> benchmark_data = {{"97%", benchmark.ninety}, {"AVG", benchmark.avg}, {"1% ", benchmark.oneP}}; + vector> benchmark_data = {{"97% ", benchmark.ninety}, {"AVG ", benchmark.avg}, {"1% ", benchmark.oneP}, {"0.1%", benchmark.pointOneP}}; float display_time = float(now - log_end) / 1000000; float display_for = 10.0f; float alpha; diff --git a/src/overlay.h b/src/overlay.h index 94a44c68..49d94a71 100644 --- a/src/overlay.h +++ b/src/overlay.h @@ -55,6 +55,7 @@ struct benchmark_stats { float ninety; float avg; float oneP; + float pointOneP; float total; std::vector fps_data; }; From 6178c5859c61ad067fde8df3b93d840ceee6fa60 Mon Sep 17 00:00:00 2001 From: Kingsley McDonald Date: Thu, 18 Jun 2020 15:32:59 +0100 Subject: [PATCH 9/9] adjust benchHeight for 0.1% and fix percentages. --- src/overlay.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/overlay.cpp b/src/overlay.cpp index d05c4b28..ad596961 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -785,12 +785,12 @@ void calculate_benchmark_data(){ benchmark.avg = benchmark.total / sorted.size(); // 1% min benchmark.total = 0.f; - for (size_t i = 0; i < sorted.size() * 0.1; i++){ + for (size_t i = 0; i < sorted.size() * 0.01; i++){ benchmark.total = sorted[i]; } benchmark.oneP = benchmark.total; // 0.1% min - benchmark.pointOneP = sorted[sorted.size() * 0.01]; + benchmark.pointOneP = sorted[sorted.size() * 0.001]; } void update_hud_info(struct swapchain_stats& sw_stats, struct overlay_params& params, uint32_t vendorID){ @@ -1017,7 +1017,7 @@ void render_mpris_metadata(swapchain_stats& data, const ImVec4& color, metadata& void render_benchmark(swapchain_stats& data, struct overlay_params& params, ImVec2& window_size, unsigned height, uint64_t now){ // TODO, FIX LOG_DURATION FOR BENCHMARK - int benchHeight = 5 * params.font_size + 10.0f + 58; + int benchHeight = 6 * params.font_size + 10.0f + 58; ImGui::SetNextWindowSize(ImVec2(window_size.x, benchHeight), ImGuiCond_Always); if (height - (window_size.y + data.main_window_pos.y + 5) < benchHeight) ImGui::SetNextWindowPos(ImVec2(data.main_window_pos.x, data.main_window_pos.y - benchHeight - 5), ImGuiCond_Always);