Live effect parameter editing in the scaling overlay - #4
Open
Kristijan1001 wants to merge 2 commits into
Open
Conversation
Adds an Effect Parameters window to the scaling overlay so effect parameters can be tuned without stopping scaling and switching back to the main window. - Toolbar toggle opens a window that builds its controls from EffectDesc::params, so every effect is supported without per-effect UI code. Labels that enumerate their values, e.g. "NR Style (0 Default, 1 Natural, 2 Cinematic)", become combo boxes, 0/1 integers become checkboxes. - Renderer::SetEffectParameter posts the change to the backend thread, where edits made in one frame are coalesced and applied before the next render. A render is forced afterwards so the result is visible even when the source window is static. - Shader effects only need the constant buffer updated (EffectDrawer::UpdateParameters). Native SDK backends declare how they respond through NativeEffectBackend::UpdateParameters: the default is to recreate the backend, and DLSSNR applies everything but NR Preset in place because those parameters are submitted to NGX every frame. - The backend now keeps its own copy of the effect options, so resizing the scaling window no longer reverts live edits. - Parameters that can only be read at initialization (frame generation, Frame Rate Filter, and shader effects compiled with inline parameters) are shown disabled with a note that scaling must be restarted. - Save writes the tuned values back to the scaling mode.
…s live The first cut locked these two behind a restart, which left the panel fully disabled for the DLSSFG scaling mode - the mode where the toolbar is most useful. - The DLSSFG presentation ring is now allocated at the maximum slot count whenever frame generation is active, and the frontend opens every allocated slot, so changing the multiplier only moves _sharedTextureSlotCount. Rebuilding the feature itself was already supported: the failure-recovery path does it mid-scaling. - Frame rate limits moved out of _InitBackend into _UpdateFrameRateLimits, which both initialization and live edits call, so Target Frame Rate now retunes StepTimer and the DLSSFG pacing interval. StepTimer::Initialize resets its intervals first so it can run more than once. - Parameters declared as floats with step 1 and integral bounds - which is how frame generation declares its multiplier and toggles - now get integer sliders and checkboxes instead of decimal sliders. XeSS frame generation stays restart-only; it runs through a separate presenter.
Owner
|
很好的想法 但是我编译测试了一下 可能还有很多问题 有些效果可能需要完全重载 That's a great idea. I compiled and tested it, though, and it looks like there are still quite a few issues. Some effects may need to be fully reloaded for their parameters to update correctly. I agree that being able to adjust the FrameRate Filter in real time is genuinely useful. I might consider temporarily adopting just part of this implementation. Right now I'm investigating some issues with VSR. I'll take another look at this later and see if I can make some improvements. |
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.
Adds an Effect Parameters window to the scaling overlay, so effect parameters can be tuned while scaling instead of stopping scaling, editing the scaling mode, and starting again.
UI
The window is generated from
EffectDesc::params, so every effect is covered without per-effect UI code:NR Style (0 Default, 1 Natural, 2 Cinematic), become combo boxesSTEP 1and integral bounds — how frame generation declares its multiplier and toggles — get integer slidersRevertrestores the values the scaling session started with.Savewrites the current values back into the scaling mode through a newScalingOptions::saveEffectParameterscallback.How changes are applied
Edits are posted to the backend thread, coalesced per frame, and applied before the next render. A render is forced afterwards so the result is visible even when the source window is static.
EffectDrawer::UpdateParametersrewrites the constant buffer; parameters never affect texture sizes, so no resources are rebuiltNativeEffectBackend::UpdateParametersdefaults to recreating the backend, so a backend responds correctly without implementing anything_InitializeDLSSFrameGeneratorwas already called at runtime by the failure-recovery path_UpdateFrameRateLimitsretunesStepTimerand the DLSSFG pacing intervalTo make the frame generation multiplier changeable, the presentation ring is now allocated at
MAX_SHARED_TEXTURE_SLOTSwhenever frame generation is active, and the frontend opens every allocated slot. A multiplier change then only moves_sharedTextureSlotCountinstead of renegotiating shared textures.StepTimer::Initializeresets its intervals first so it can run more than once.Parameters that genuinely cannot change mid-session — XeSS frame generation, and shader effects compiled with inline parameters — are shown disabled with a note that scaling must be restarted.
The backend now keeps its own copy of the effect options, so resizing the scaling window no longer reverts live edits.
Strings
Added to
Resources.language-en-US.reswandResources.language-zh-Hans.resw.FONTS_CACHE_VERSIONis bumped because the toolbar button adds an icon glyph (E9E9, the same one the scaling modes page uses for parameters).Testing
Built with MSVC x64 and tested on an RTX 5080 against the DLSSNR and DLSSFG scaling modes.
Two notes about CI, both pre-existing and unrelated to this change:
build.ymlprovisions no SDKs, soEnableDLSSSR/EnableDLSSFrameGeneration/EnableDLSSNRare false there and the native paths above are not exercised by CI builds. I tested with the public NVIDIA DLSS headers and import library provisioned in the workflow.ARM64 + ClangCLcurrently fails onexperimentalwith-Werror,-Wunused-private-fieldon ten fields inDLSSSRUpscaler.handDLSSNRFilter.h, files this PR does not touch. Happy to send a separate fix for that.