diff --git a/README.md b/README.md index 540096e..14b61ca 100644 --- a/README.md +++ b/README.md @@ -382,6 +382,7 @@ Parameters that are enabled by default have to be explicitly disabled. These (cu | `af` | Anisotropic filtering level. Improves sharpness of textures viewed at an angle (0 to 16) | | `bicubic` | Force bicubic filtering | | `trilinear` | Force trilinear filtering | +| `retro` | Disables linear texture filtering. Makes textures look blocky | Example: `MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_size=32` Because comma is also used as option delimiter and needs to be escaped for values with a backslash, you can use `+` like `MANGOHUD_CONFIG=fps_limit=60+30+0` instead. diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp index 851ec70..e010848 100644 --- a/src/overlay_params.cpp +++ b/src/overlay_params.cpp @@ -554,6 +554,7 @@ parse_overlay_env(struct overlay_params *params, params->enabled[OVERLAY_PARAM_ENABLED_exec_name] = 0; params->enabled[OVERLAY_PARAM_ENABLED_trilinear] = 0; params->enabled[OVERLAY_PARAM_ENABLED_bicubic] = 0; + params->enabled[OVERLAY_PARAM_ENABLED_retro] = 0; } #define OVERLAY_PARAM_BOOL(name) \ if (!strcmp(#name, key)) { \ @@ -711,6 +712,7 @@ parse_overlay_config(struct overlay_params *params, params->enabled[OVERLAY_PARAM_ENABLED_exec_name] = 0; params->enabled[OVERLAY_PARAM_ENABLED_trilinear] = 0; params->enabled[OVERLAY_PARAM_ENABLED_bicubic] = 0; + params->enabled[OVERLAY_PARAM_ENABLED_retro] = 0; params->options.erase("full"); } for (auto& it : params->options) { diff --git a/src/overlay_params.h b/src/overlay_params.h index 33a05b9..065fbe3 100644 --- a/src/overlay_params.h +++ b/src/overlay_params.h @@ -93,6 +93,7 @@ typedef unsigned long KeySym; OVERLAY_PARAM_BOOL(exec_name) \ OVERLAY_PARAM_BOOL(trilinear) \ OVERLAY_PARAM_BOOL(bicubic) \ + OVERLAY_PARAM_BOOL(retro) \ OVERLAY_PARAM_CUSTOM(fps_sampling_period) \ OVERLAY_PARAM_CUSTOM(output_folder) \ OVERLAY_PARAM_CUSTOM(output_file) \ diff --git a/src/vulkan.cpp b/src/vulkan.cpp index 727b7fa..617715d 100644 --- a/src/vulkan.cpp +++ b/src/vulkan.cpp @@ -1960,6 +1960,12 @@ static VkResult overlay_CreateSampler( sampler.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; } + if (params->enabled[OVERLAY_PARAM_ENABLED_retro]){ + sampler.magFilter = VK_FILTER_NEAREST; + sampler.minFilter = VK_FILTER_NEAREST; + sampler.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; + } + struct device_data *device_data = FIND(struct device_data, device); VkResult result = device_data->vtable.CreateSampler(device, &sampler, pAllocator, pSampler);