Repository navigation
GPU: support multi-frame generation (3X-6X) on RTX 50 by sizing swap chain buffers and options (#1233) - #1271
Open
dheerajc8073 wants to merge 1 commit into
Conversation
…chain buffers and options (trustno1-coder#1233) Root cause: On RTX 50 series cards (Blackwell, e.g. RTX 5060 Ti / RTX 5080), multi-frame generation (3X-6X via VICTORY_FRAMEGEN_X) clamped down to 2X (1 generated frame per engine frame) due to two interdependent constraints: 1. slDLSSGGetState was called with a null pointer for options. The Streamline DLSSG runtime requires populated DlssgOptions containing num_back_buffers and viewport dimensions to report multi-frame generation capabilities. Furthermore, any query failure or zero return prematurely forced `most` down to 1 (2X). 2. The DXGI swap chain buffer count in host.rs was hardcoded to 2 back buffers. Under flip-discard model, presenting up to 5 synthesized frames per engine frame causes swapchain starvation and presentation stalls unless sufficient back buffers are allocated. Changes: - Increased host DXGI swap chain back buffer count from 2 to 8 (BUFFERS = 8) to avoid buffer starvation when presenting up to 5 synthesized frames. - Populated DlssgOptions with num_back_buffers, flags, dimensions, and num_frames_to_generate prior to slDLSSGGetState, passing &options instead of null. - Guarded state.num_frames_to_generate_max against premature 1-clamping so queries that succeed report true multi-frame capacity, while preserving the requested generation level on fallback. - Added comprehensive regression tests in framegen_tests covering swap chain buffer sizing, DlssgOptions alignment, multiplier clamping, and query resolution across RTX 50 and RTX 40 hardware profiles. Closes trustno1-coder#1233 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Fixes #1233. Resolves an issue on NVIDIA GeForce RTX 50 series graphics cards (Blackwell architecture, e.g. RTX 5060 Ti, RTX 5080) where selecting multi-frame generation multipliers higher than 2X (
VICTORY_FRAMEGEN_X=3..6) in the F1 menu clamped presentation down to 2X (1 generated frame per engine frame).Root Cause Analysis
On RTX 50 series GPUs supporting DLSS Multi-Frame Generation (MFG) up to 6X (up to 5 synthesized frames per engine render), requested frame generation multipliers 3X through 6X were being prematurely constrained due to two interconnected limitations:
DlssgOptions& Query Guard instreamline.rs:slDLSSGGetStatewas called with anullpointer forDlssgOptions. The Streamline DLSS-G runtime expects a populatedDlssgOptionsstruct containing valid swap chain parameters (num_back_buffers), viewport dimensions (color_width,color_height), and generation flags (DLSSG_RETAIN_RESOURCES_WHEN_OFF) to report the hardware's multi-frame generation capabilities.let most = if code == 0 { state.num_frames_to_generate_max.max(1) } else { 1 };forcedmostto 1, clamping any requested multiplier down to 2X.host.rs:const BUFFERS: u32 = 2.DXGI_SWAP_EFFECT_FLIP_DISCARDmode, generating and queueing up to 5 synthesized frames per engine frame (6X multiplier) requires a sufficiently deep buffer queue. Sizing at only 2 back buffers starves the swapchain pipeline, resulting in presenter stalls, dropped presentation slots, or driver fallback to standard single-frame generation.Key Changes
Host DXGI Swap Chain Sizing (
crates/victory-gpu/src/host.rs):pub const BUFFERS: u32 = 8).Populate
DlssgOptionsBefore Querying State (crates/victory-gpu/src/streamline.rs):options.num_back_buffers = crate::host::BUFFERS,options.num_frames_to_generate = generated,options.flags = abi::DLSSG_RETAIN_RESOURCES_WHEN_OFF, and viewport dimensions prior to querying state.&optionsintoslDLSSGGetState(&viewport, &mut state, &options).Guarded Multi-Frame Capability Resolution (
crates/victory-gpu/src/streamline.rs):num_frames_to_generate_max = 5, preserving 3X, 4X, 5X, and 6X.num_frames_to_generate_max = 1safely clamps multipliers > 2X down to 2X.options.num_back_buffersreferencescrate::host::BUFFERS.Regression Unit Tests (
framegen_tests):swapchain_buffer_count_prevents_starvation: VerifiesBUFFERS >= 8.dlssg_options_num_back_buffers_matches_host_buffers: VerifiesDlssgOptionssynchronizes with host swap chain buffers.framegen_multiplier_mapping_and_clamping: Tests multiplier clamping (0 turns off, 1 -> 2X, 2..6 preserved, >6 clamped to 6X), generated frame counts (wanted.max(2) - 1), RTX 50 multi-frame preservation (up to 5 generated frames), RTX 40 clamping (1 generated frame), and query fallback resilience.Verification
framegen_testscovers all multi-frame generation paths, multiplier ranges, and capability queries.Closes #1233.