Skip to content

Custom slot: a failed create is remembered per size and flags - #79

Merged
phantoslayer21 merged 1 commit into
mainfrom
fix/60-failure-key-size
Nov 13, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
fix/60-failure-key-size

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

Fixes #60

What was wrong

In the custom slot, a failed create is remembered under FailureKey, which held the backend name and the option string only. It did not include maxRenderSize, maxUpscaleSize or the create flags. A create that failed for a reason tied to the size (for example out of VRAM at 4K) therefore blocked every later create for the rest of the session, at any size, and the host's own upscaler stayed in use until the game restarted.

The fix

FrontEnd::FailureKey (clean/fsr/src/frontend.cpp) now also holds maxRenderSize, maxUpscaleSize and create.flags. A host that re-creates with the same parameters is still stopped; a resolution change gets its own attempt. A permanently broken runtime now fails once for each distinct size and flags instead of once in total, which is bounded and still logged. The optional retry of transient errors from the issue is not part of this change.

The test

TestCustomSlotFailureKeyHasSize in clean/fsr/tests/test_frontend.cpp (ctest fsr_frontend_unit, part of the CI set). The fake runtime fails a create while output_width == 3840 (a new g_failCreateOutputWidth switch). It checks that:

  • a create at 4K fails and is remembered;
  • the same 4K parameters again make no new runtime attempt;
  • a create at 2560x1440 gets a new attempt, works, and the context is WrongGPU's own (no AMD call);
  • another maximum render size at 4K, and other create flags at 4K, each get their own attempt and are then remembered.

Before / after (MSVC, Release, cmake -S clean/fsr -B <out> -G Ninja -DWG_MODEL_K=OFF -DWG_BUILD_ID=ci -DWG_BUILD_ASI=ON, then cmake --build <out> --target test_frontend and <out>\test_frontend.exe):

  • main plus the test only: 1135 checks, 6 failures (all in the new test: the 2560x1440 create is refused as "failed earlier").
  • with the fix: 1135 checks, 0 failures.

Tested

  • test_frontend as above, before and after.
  • The CI set (ctest -R "unit|hosted|diagnostic|support" -E "overlay|split|d3d12") plus fsr_custom_slot (WARP): 16 tests, all passed (fsr_asi_scan_unit skipped, as usual).
  • Repository gates (secrets, personal data, licence, view layout): pass.

Not tested

  • No game and no GPU. The issue was found by reading the code and has not been reproduced in a game.
  • The retry of transient errors (the optional second item of the issue) is not implemented.

The key of a remembered failed create held the backend name and the option
string only. A create that failed for a reason tied to the size (out of memory
at 4K) therefore blocked every later create in the session, at any size.
The key now also holds maxRenderSize, maxUpscaleSize and the create flags: the
same parameters are still stopped, another size gets its own attempt.

Fixes #60

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 13, 2026 20:56
@phantoslayer21
phantoslayer21 merged commit f3f795e into main Nov 13, 2026
2 checks passed
@phantoslayer21
phantoslayer21 deleted the fix/60-failure-key-size branch November 13, 2026 21:02
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.

Custom slot: one create failure blocks all later creates for the session, at any size

1 participant