Skip to content

Merge upstream OptiScaler master into dlss-neural-rendering - #15

Open
y4my4my4m wants to merge 10 commits into
Dagherbou:dlss-neural-renderingfrom
y4my4my4m:merge-upstream-master
Open

y4my4my4m wants to merge 10 commits into
Dagherbou:dlss-neural-renderingfrom
y4my4my4m:merge-upstream-master

Conversation

@y4my4my4m

Copy link
Copy Markdown

Merges the current optiscaler/OptiScaler master into dlss-neural-rendering. The branch was 9 commits behind and 127 ahead; this brings it back onto current upstream without disturbing any DLSS-NR work.

What upstream brings

The dxvk-nvapi recursion fix and the D3D11 resource-management work matter most here, since DLSS-NR exercises both paths.

Conflicts and how they were resolved

Three files conflicted, all under OptiScaler/menu/input/:

  • input_system_internal.h
  • input_system_messages.cpp
  • input_system_raw.cpp

All three conflicted over the same underlying bug: a key held while the menu opens stays stuck down. The branch carried a fix for it, and upstream landed its own fix for the same bug in 82eb45fb/8030ecca.

Both fixes make the same two changes. SetKeyDown records BlockedDown inside the down-transition rather than on every message, so auto-repeat arriving after the menu opens cannot mark a press the game already saw. GetRawKeyboardSanitizeActionLocked guards the same flag with !_state.Keys[vk].Down for the raw-input path. And HandleRawInputLocked returns bool so WM_INPUT carrying an owed release still reaches the game.

Upstream's version goes further:

  • The sanitize decision is computed once and cached against the HRAWINPUT, so the GetRawInputData hook reuses the same verdict instead of recomputing a possibly different one.
  • Mouse packets are covered too, not just keyboard — SanitizeMouseKeepAllowedButtonUps lets owed button-ups through while movement and new presses are still withheld.
  • Consumed foreground WM_INPUT messages get DefWindowProc cleanup, in both OptiInputWndProc and ProcessRemovedMessage.
  • Hook removal drains pending XInput keystrokes and DirectInput buffered data, and the various Remove* functions now return bool.

The branch's version was a strict subset of upstream's, so upstream's version was taken for all three files. No DLSS-NR behaviour was dropped — the stuck-key fix is still present, in a broader form.

Verification

Built clean with MSBuild via the repo's own Build (No Signing) workflow on windows-latest, Release x64. Both OptiScaler.dll and nvngx.dll_dlssnr.dll link and are valid PE32+ x86-64.

Not runtime-tested in a game.

Note on clang-format

The clang-format Check workflow fails on this branch, and did so before this merge. It flags roughly 100 spots in branch code that predate it — Config.cpp lines 1189-1248, several lines in Config.h, and files under dlssnr/. Mostly braced-init spacing and line-length wrapping against upstream's .clang-format. Untouched here to keep this merge reviewable; worth a separate formatting pass.

FakeMichau and others added 10 commits September 1, 2026 03:40
queryNvapi() calls NvAPI_Initialize, which (via dxvk-nvapi) internally
creates a DXGI factory and enumerates adapters. That enumeration hits
OptiScaler's hooked EnumAdapters/EnumAdapters1, which calls getAllGpus()
again while is_fetching is already set and returns an empty list.
dxvk-nvapi then sees zero adapters, NvAPI_Initialize fails, and
dlssCapable is never set - hiding DLSS in games like Death Stranding 2.

Wrap queryNvapi in ScopedSkipDxgiLoadChecks so nvapi's internal DXGI
enumeration passes through to the real adapters.
…ursion

Fix dxvk-nvapi recursion in IdentifyGpu::queryNvapi (fixes optiscaler#1101)
Disabled HID mouse hooks
…ring

# Conflicts:
#	OptiScaler/menu/input/input_system_internal.h
#	OptiScaler/menu/input/input_system_messages.cpp
#	OptiScaler/menu/input/input_system_raw.cpp
@y4my4my4m

Copy link
Copy Markdown
Author

TLDR: i couldn't use it properly on linux without the GPU recursion bug fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants