Repository navigation
Version box: tell the upscaler's DLL which version the player selected - #2
Merged
Merged
Conversation
When the player selects a version in the version box, the upscaler's DLL is told first through WrongGpuHostSelectedV1(versionId), if it exports it. WrongGPU's FFX DLL does, and records a selection of one of its models as the player's model choice. The upscaler is then recreated as before, so the choice runs at once. If WrongGPU recorded the choice, selecting the entry that is already selected recreates the upscaler too, because the model that ran may have been chosen elsewhere (WrongGPU's launcher or menu plugin). A notification says when WrongGPU could not save the choice. The call is made only for a selection in the menu, never for the index read from the ini. A DLL without the export is never called. WRONGGPU-EDITION.md: item 6. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…t saved) The result of WrongGpuHostSelectedV1 decides: - 1, the selected model runs from now on: the upscaler is recreated, also when the entry was already selected; - 0, nothing changed for WrongGPU: as before, a new entry recreates the upscaler; - negative, not saved: nothing changes (no new index, no recreate), and a notification says "Not saved, try again". There is no "not saved yet" or session-only case any more. WRONGGPU-EDITION.md item 6 is updated to match. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…ed header - OptiScaler/misc/WrongGpuHostEvent.h: OnVersionSelected (what the version box does with WrongGPU's result: 1 recreate, also for the entry already selected; 0 as before; negative "not saved", nothing changes), CallHostSelected (the export, or 0), and ListOrderMatches (WrongGPU's model entries in a version list against the copied header). - OptiScaler/include/wronggpu/wg_model_entries.h: a byte-identical copy of WrongGPU's clean/wgshared/include/wg_model_entries.h (the order of its model entries); static_asserts on it; a list in another order is logged. WrongGPU's CI checks the copy's hash. - wronggpu-edition-tests/host_event_test.cpp and the "WrongGPU edition tests" workflow build and run the header's tests. - WRONGGPU-EDITION.md item 6 says so. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 15, 2026 22:43
phantoslayer21
added a commit
to phantoslayer21/wronggpu
that referenced
this pull request
Nov 16, 2026
…K) (#213) On a hosted OptiScaler install with WrongGPU's menu plugin hooked, the launcher's Model L choice was ignored: the plugin's saved state could only be M, K or AMD, and the front end took the plugin's model unconditionally. - One model choice record per game, model-choice.ini in the game's WrongGPU state folder (model, seq, source). The highest seq is the most recent choice, on every route. - It is written only for a choice the player made: the launcher's Apply or set <game> model=, a selection in OptiScaler's list (WrongGpuHostSelectedV1, in the WrongGPU edition of OptiScaler, phantoslayer21/OptiScaler#2), or a click on one of the menu plugin's model entries. OptiScaler's stored index and wronggpu.ini's model item are never a choice. - Every read and write holds the game's state lock (wg_state.h). A choice that can't be saved in time changes nothing and says "not saved, try again". - CI checks that wg_model_entries.h and the fork's copy at a pinned commit are byte-identical. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When the player selects a version in the version box, the upscaler's DLL is told first, through
WrongGpuHostSelectedV1(versionId), if it exports that function. Its result decides what happens next (OnVersionSelectedinOptiScaler/misc/WrongGpuHostEvent.h):Who calls it, and who doesn't:
OptiScaler.iniat start is never sent, so a stored index is never taken for a choice.Entry order. The index OptiScaler stores is a position in the list the DLL returns. The order of WrongGPU's model entries in that list (Model M, then K, then L, as each build lists them) is defined on the WrongGPU side in
clean/wgshared/include/wg_model_entries.h. This fork holds a byte-identical copy inOptiScaler/include/wronggpu/wg_model_entries.h:WrongGpuHostEvent.hstatic-asserts the order it expects from it;The WrongGPU side is phantoslayer21/wronggpu#213:
clean/fsr/include/wronggpu_host_event.h(the signature and result codes) andFrontEnd::HostSelected.Files
OptiScaler/misc/WrongGpuHostEvent.h: the version-box logic (OnVersionSelected), the export call (CallHostSelected), and the list-order check (ListOrderMatches). It has no ImGui or Windows dependency, so it is unit tested.OptiScaler/include/wronggpu/wg_model_entries.h: the copied header (excluded from the format check like the other included headers).OptiScaler/menu/menu_common.cpp:NotifyHostSelectedand the version box use the helper. The DLL is the custom upscaler's module, or, for the regular DX12 FFX list,FfxApiProxy::UpscalerModule(versionId).wronggpu-edition-tests/host_event_test.cppand.github/workflows/wronggpu-edition-tests.yml: the helper's tests, built with MSVC (/W4 /WX) and run on every push and pull request.WRONGGPU-EDITION.md: item 6.Tested
host_event_test: 23 checks pass. They cover:clang-format22, the version of the check: the new lines are clean.Util.cpp,hooks/D3D12_Hooks.cpp,inputs/NVNGX_DLSS_Dx12.cpp,plugins/PluginApi.cpp, and three older hunks inmenu/menu_common.cpp.Build (No Signing), run by hand): it built the branch's first head; not run again for the later heads.Not tested yet
source=ffx. That game run follows after the merge.