mirror of
https://github.com/xemu-project/xemu.git
synced 2026-07-11 01:24:41 +02:00
ui: Force NVIDIA present method to native
Setting the NVIDIA driver Vulkan/OpenGL present method to "Prefer layerd on DXGI Swapchain" with vsync enabled within xemu causes framerate to be ~halved. This change overrides the driver setting to force the legacy/native value to be used. Resolves one identified issue with #2790
This commit is contained in:
Vendored
+12
@@ -152,6 +152,18 @@ bool nvapi_setup_profile(NvApiProfileOpts opts)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
NVDRS_SETTING setting_dxpresent = {
|
||||
.version = NVDRS_SETTING_VER,
|
||||
.settingId = OGL_CPL_PREFER_DXPRESENT_ID,
|
||||
.settingType = NVDRS_DWORD_TYPE,
|
||||
.u32CurrentValue = opts.present_method,
|
||||
};
|
||||
if (NvAPI_DRS_SetSetting(session, profile, &setting_dxpresent)) {
|
||||
LOG("NvAPI_DRS_SetSetting for settingId %x failed",
|
||||
setting_dxpresent.settingId);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (NvAPI_DRS_SaveSettings(session)) {
|
||||
LOG("NvAPI_DRS_SaveSettings failed");
|
||||
goto cleanup;
|
||||
|
||||
Vendored
+9
@@ -27,10 +27,19 @@
|
||||
#include <windows.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
enum EValues_OGL_CPL_PREFER_DXPRESENT {
|
||||
OGL_CPL_PREFER_DXPRESENT_PREFER_DISABLED = 0x00000000,
|
||||
OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED = 0x00000001,
|
||||
OGL_CPL_PREFER_DXPRESENT_AUTO = 0x00000002,
|
||||
OGL_CPL_PREFER_DXPRESENT_NUM_VALUES = 3,
|
||||
OGL_CPL_PREFER_DXPRESENT_DEFAULT = OGL_CPL_PREFER_DXPRESENT_AUTO
|
||||
};
|
||||
|
||||
typedef struct NvApiProfileOpts {
|
||||
const wchar_t *profile_name;
|
||||
const wchar_t *executable_name;
|
||||
bool threaded_optimization;
|
||||
enum EValues_OGL_CPL_PREFER_DXPRESENT present_method;
|
||||
} NvApiProfileOpts;
|
||||
|
||||
bool nvapi_init(void);
|
||||
|
||||
Vendored
+1
@@ -32,6 +32,7 @@
|
||||
|
||||
enum ESetting {
|
||||
OGL_THREAD_CONTROL_ID = 0x20C1221E,
|
||||
OGL_CPL_PREFER_DXPRESENT_ID = 0x20D690F8,
|
||||
};
|
||||
|
||||
enum EValues_OGL_THREAD_CONTROL {
|
||||
|
||||
Reference in New Issue
Block a user