Merge branch 'master' into develop

pull/237/head
FlightlessMango 4 years ago
commit 8e34e752e5

@ -37,11 +37,21 @@ 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
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
@ -155,6 +165,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`

@ -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
@ -107,7 +107,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 #################

@ -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

@ -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')

@ -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')

@ -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 : [

@ -785,10 +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.001];
}
void update_hud_info(struct swapchain_stats& sw_stats, struct overlay_params& params, uint32_t vendorID){
@ -1032,14 +1034,14 @@ static void render_mpris_metadata(struct overlay_params& params, metadata& meta,
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);
else
ImGui::SetNextWindowPos(ImVec2(data.main_window_pos.x, data.main_window_pos.y + window_size.y + 5), ImGuiCond_Always);
vector<pair<string, float>> benchmark_data = {{"97%", benchmark.ninety}, {"AVG", benchmark.avg}, {"1% ", benchmark.oneP}};
vector<pair<string, float>> benchmark_data = {{"97% ", benchmark.ninety}, {"AVG ", benchmark.avg}, {"1% ", benchmark.oneP}, {"0.1%", benchmark.pointOneP}};
float display_time = float(now - log_end) / 1000000;
static float display_for = 10.0f;
float alpha;
@ -1071,12 +1073,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);

@ -55,6 +55,7 @@ struct benchmark_stats {
float ninety;
float avg;
float oneP;
float pointOneP;
float total;
std::vector<float> fps_data;
};

Loading…
Cancel
Save