From 7be167856e0a3a6f0d0131b3ce052832f8912486 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 5 Aug 2018 18:09:35 -0700 Subject: [PATCH] Only enable game optimizations when streaming at officially supported resolutions --- app/streaming/session.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index afe49376..64bdb3bc 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -594,6 +594,18 @@ void Session::exec() Q_ASSERT(m_Computer->currentGameId == 0 || m_Computer->currentGameId == m_App.id); + bool enableGameOptimizations = false; + for (const NvDisplayMode &mode : m_Computer->displayModes) { + if (mode.width == m_StreamConfig.width && + mode.height == m_StreamConfig.height) { + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Found host supported resolution: %dx%d", + mode.width, mode.height); + enableGameOptimizations = prefs.gameOptimizations; + break; + } + } + try { NvHTTP http(m_Computer->activeAddress); if (m_Computer->currentGameId != 0) { @@ -601,7 +613,7 @@ void Session::exec() } else { http.launchApp(m_App.id, &m_StreamConfig, - prefs.gameOptimizations, + enableGameOptimizations, prefs.playAudioOnHost, inputHandler.getAttachedGamepadMask()); }