Sampler hook and picmip param

update-vulkan-gen
FlightlessMango 1 year ago
parent 80d394c0cd
commit 9b9e6e7b68

@ -378,6 +378,7 @@ Parameters that are enabled by default have to be explicitly disabled. These (cu
| `width=`<br>`height=` | Customizeable HUD dimensions (in pixels) |
| `wine_color` | Change color of the wine/proton text |
| `wine` | Shows current Wine or Proton version in use |
| `picmip` | Mip-map LoD bias. Negative values will increase texture sharpness (and aliasing). Positive values will increase texture blurriness (-16 to 16) |
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.

@ -419,6 +419,7 @@ parse_gl_size_query(const char *str)
#define parse_round_corners(s) parse_unsigned(s)
#define parse_fcat_overlay_width(s) parse_unsigned(s)
#define parse_fcat_screen_edge(s) parse_unsigned(s)
#define parse_picmip(s) parse_signed(s)
#define parse_cpu_color(s) parse_color(s)
#define parse_gpu_color(s) parse_color(s)
@ -645,6 +646,7 @@ parse_overlay_config(struct overlay_params *params,
params->round_corners = 0;
params->battery_color =0xff9078;
params->fsr_steam_sharpness = -1;
params->picmip = 0;
#ifdef HAVE_X11
params->toggle_hud = { XK_Shift_R, XK_F12 };

@ -164,6 +164,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_CUSTOM(fsr_steam_sharpness) \
OVERLAY_PARAM_CUSTOM(fcat_screen_edge) \
OVERLAY_PARAM_CUSTOM(fcat_overlay_width) \
OVERLAY_PARAM_CUSTOM(picmip) \
enum overlay_param_position {
LAYER_POSITION_TOP_LEFT,
@ -276,6 +277,7 @@ struct overlay_params {
int fsr_steam_sharpness;
unsigned short fcat_screen_edge;
unsigned short fcat_overlay_width;
int picmip;
size_t font_params_hash;
};

@ -1932,6 +1932,22 @@ static VkResult overlay_CreateInstance(
return result;
}
static VkResult overlay_CreateSampler(
VkDevice device,
const VkSamplerCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSampler* pSampler)
{
VkSamplerCreateInfo sampler = *pCreateInfo;
sampler.mipLodBias = HUDElements.params->picmip;
struct device_data *device_data = FIND(struct device_data, device);
VkResult result = device_data->vtable.CreateSampler(device, &sampler, pAllocator, pSampler);
return result;
}
static void overlay_DestroyInstance(
VkInstance instance,
const VkAllocationCallbacks* pAllocator)
@ -1969,6 +1985,7 @@ static const struct {
ADD_HOOK(CreateSwapchainKHR),
ADD_HOOK(QueuePresentKHR),
ADD_HOOK(DestroySwapchainKHR),
ADD_HOOK(CreateSampler),
ADD_HOOK(QueueSubmit),

Loading…
Cancel
Save