Skip to content

Commit 9483d28

Browse files
committed
mangoapp: pull engine from gamescope
1 parent 975815c commit 9483d28

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/app/main.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,26 @@ static void gamescope_frametime(uint64_t app_frametime_ns, uint64_t latency_ns){
149149
HUDElements.gamescope_debug_latency.erase(HUDElements.gamescope_debug_latency.begin());
150150
}
151151

152+
static EngineTypes engine_type_from_str(std::string engineName) {
153+
if (engineName == "DXVK")
154+
return DXVK;
155+
156+
else if (engineName == "vkd3d")
157+
return VKD3D;
158+
159+
else if(engineName == "mesa zink")
160+
return ZINK;
161+
162+
else if (engineName == "Damavand")
163+
return DAMAVAND;
164+
165+
else if (engineName == "Feral3D")
166+
return FERAL3D;
167+
168+
else
169+
return VULKAN;
170+
}
171+
152172
static void msg_read_thread(){
153173
for (size_t i = 0; i < 200; i++){
154174
HUDElements.gamescope_debug_app.push_back(0);
@@ -210,6 +230,13 @@ static void msg_read_thread(){
210230
screenWidth = mangoapp_v1->outputWidth;
211231
screenHeight = mangoapp_v1->outputHeight;
212232
}
233+
234+
if (msg_size > offsetof(mangoapp_msg_v1, engineName)) {
235+
if (!steam_focused)
236+
sw_stats.engine = engine_type_from_str(std::string(mangoapp_v1->engineName));
237+
} else {
238+
sw_stats.engine = EngineTypes::GAMESCOPE;
239+
}
213240
}
214241
} else {
215242
printf("Unsupported mangoapp struct version: %i\n", hdr->version);

src/app/mangoapp_proto.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ struct mangoapp_msg_v1 {
1717
uint64_t latency_ns;
1818
uint32_t outputWidth;
1919
uint32_t outputHeight;
20+
uint16_t displayRefresh;
21+
bool bAppWantsHDR : 1;
22+
bool bSteamFocused : 1;
23+
char engineName[40];
24+
2025
// WARNING: Always ADD fields, never remove or repurpose fields
2126
} __attribute__((packed));
2227

0 commit comments

Comments
 (0)