Skip to content

Stabilize viewport behavior under FSR2 (fallback to Bilinear)#110119

Open
mechalynx wants to merge 1 commit intogodotengine:masterfrom
mechalynx:viewport_limit_fix_no_resize
Open

Stabilize viewport behavior under FSR2 (fallback to Bilinear)#110119
mechalynx wants to merge 1 commit intogodotengine:masterfrom
mechalynx:viewport_limit_fix_no_resize

Conversation

@mechalynx
Copy link
Copy Markdown
Contributor

@mechalynx mechalynx commented Aug 30, 2025

Edit - I've closed that one in favor of this one to simplify things - that one still has most of the details if needed, but briefly:

  • this enforces a maximum limit of 16384 for the dimensions of viewports in the inspector (previously only a minimum of 2x2 was enforced, which allowed viewports to grow beyond what is allowed anywhere else in the engine and exceeds most device limits anyway)
  • ensures FSR1 viewports don't fall below 1x1 after scaling
  • ensures FSR2 viewports don't fall below 64x64 (also after scaling)
  • ensures viewports can't exceed 16384 on either dimension
    • but I am slightly concerned about not having an error message about this since it likely just crops the buffer silently - user may want to make something like a 2x16384 texture as a LUT or palette using a viewport, which is about as big as a 181x181 texture in data, but now they wouldn't know the viewport is cropped - might do a followup for that...
  • correctly switches off temporal antialiasing jitter when falling back to Bilinear.

See this comment for comparisons between FSR2 and Bilinear at 64x64px. With this PR, one can still set a SubViewport to 64x64px using FSR2, just can't go below that without it falling back to Bilinear. The previous PR attempts to resize the SubViewport's internal render size so that it is always of valid dimensions to avoid the crash and error spam reported in #105509 but this may be superfluous as per Calinou's comment and the comparison.

Unlike the previous PR, this one is very unlikely to cause problems to existing projects and I feel it can be backported safely.

Opened as draft since there may be preference between the two fixes.

edit - also, if merged, please fix the typo in the commit message, I don't want to trigger a build just for that... (Stablize -> Stabilize) Fixed

@mechalynx mechalynx force-pushed the viewport_limit_fix_no_resize branch from 63b51ca to 24f7b6f Compare August 30, 2025 17:06
@mechalynx mechalynx changed the title Stablize viewport behavior under FSR2 Stabilize viewport behavior under FSR2 Aug 30, 2025
@mechalynx mechalynx changed the title Stabilize viewport behavior under FSR2 Stabilize viewport behavior under FSR2 (fallback to Bilinear) Aug 30, 2025
@Calinou Calinou added bug topic:rendering topic:3d cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Aug 30, 2025
@Calinou Calinou added this to the 4.6 milestone Aug 30, 2025
@Calinou
Copy link
Copy Markdown
Member

Calinou commented Aug 30, 2025

edit - also, if merged, please fix the typo in the commit message, I don't want to trigger a build just for that... (Stablize -> Stabilize)

We don't use GitHub's squash and merge feature on the main Godot repository, since it loses the merge commit in the process. We prefer keeping the merge commit to make the Git history more self-documented (even if that makes it longer when not using the --no-merges option).

Since merge commits keep the original commit message, you have to fix the commit message in your fork.

@mechalynx mechalynx force-pushed the viewport_limit_fix_no_resize branch from 24f7b6f to 3278827 Compare August 30, 2025 22:23
@Repiteo Repiteo modified the milestones: 4.6, 4.x Jan 26, 2026
@mechalynx mechalynx force-pushed the viewport_limit_fix_no_resize branch from 3278827 to bf68bf7 Compare February 27, 2026 23:35
@mechalynx mechalynx marked this pull request as ready for review February 27, 2026 23:55
@mechalynx mechalynx requested review from a team as code owners February 27, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release topic:rendering topic:3d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FSR2 Crash and Error FFX_ERROR_INVALID_ARGUMENT

3 participants