mangoapp: FSR

This commit is contained in:
FlightlessMango 2022-02-09 00:23:08 +01:00 committed by Joshie
parent f65d54e61d
commit c61d936cd9

View file

@ -4,6 +4,8 @@
#include <cstring> #include <cstring>
#include "steamcompmgr.hpp" #include "steamcompmgr.hpp"
#include "main.hpp"
static bool inited = false; static bool inited = false;
static int msgid = 0; static int msgid = 0;
uint64_t now, last_frametime = 0; uint64_t now, last_frametime = 0;
@ -18,6 +20,8 @@ struct mangoapp_msg_v1 {
uint32_t pid; uint32_t pid;
uint64_t frametime_ns; uint64_t frametime_ns;
uint8_t fsrUpscale;
uint8_t fsrSharpness;
// WARNING: Always ADD fields, never remove or repurpose fields // WARNING: Always ADD fields, never remove or repurpose fields
} __attribute__((packed)) mangoapp_msg_v1; } __attribute__((packed)) mangoapp_msg_v1;
@ -26,6 +30,8 @@ void init_mangoapp(){
msgid = msgget(key, 0666 | IPC_CREAT); msgid = msgget(key, 0666 | IPC_CREAT);
mangoapp_msg_v1.hdr.msg_type = 1; mangoapp_msg_v1.hdr.msg_type = 1;
mangoapp_msg_v1.hdr.version = 1; mangoapp_msg_v1.hdr.version = 1;
mangoapp_msg_v1.fsrUpscale = 0;
mangoapp_msg_v1.fsrSharpness = 0;
inited = true; inited = true;
} }
@ -36,5 +42,7 @@ void mangoapp_update(){
now = get_time_in_nanos(); now = get_time_in_nanos();
mangoapp_msg_v1.frametime_ns = now - last_frametime; mangoapp_msg_v1.frametime_ns = now - last_frametime;
last_frametime = now; last_frametime = now;
mangoapp_msg_v1.fsrUpscale = g_fsrUpscale;
mangoapp_msg_v1.fsrSharpness = g_fsrSharpness;
msgsnd(msgid, &mangoapp_msg_v1, sizeof(mangoapp_msg_v1), IPC_NOWAIT); msgsnd(msgid, &mangoapp_msg_v1, sizeof(mangoapp_msg_v1), IPC_NOWAIT);
} }