Repository navigation
Fix PDA parallel delegate accumulation - #2186
Closed
Sreevalli20 wants to merge 2 commits into
Closed
Sreevalli20 wants to merge 2 commits into
Sreevalli20 wants to merge 2 commits into
Conversation
When opening and closing the PDA, a delegate to CUILogsWnd::PerformWork was being pushed to Device.seqParallel on every frame in Update() but never removed. This caused the delegate to accumulate in the parallel execution queue with each open/close cycle, leading to progressively more work being executed each frame and severe FPS degradation over time. The fix moves the delegate registration to Show(true) and adds removal in Show(false), ensuring the delegate is registered exactly once per PDA session and properly cleaned up when the PDA is closed. This prevents accumulation and maintains consistent performance across multiple open/close cycles. Changes: - Added m_logs_work_delegate member to store the delegate for removal - Register delegate in Show(true) when PDA opens - Remove delegate in Show(false) when PDA closes - Removed per-frame push from Update() Fixes OpenXRay#2089 Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Adds a defensive cleanup of the logs work delegate in the destructor to handle edge cases where Show(false) might not be called during shutdown or destruction. This ensures the delegate is always removed from Device.seqParallel before the CUILogsWnd object is destroyed, preventing potential dangling delegate references. The main fix remains in Show(true)/Show(false) for normal lifecycle management; this destructor cleanup is an additional safety measure. Fixes OpenXRay#2089 Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Member
|
AI slope. |
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.
Fixes issue #2089: Opening and closing the PDA causes progressively worse FPS degradation over time.
Root Cause
In
CUIPdaWnd::Update(), a delegate toCUILogsWnd::PerformWorkwas being pushed toDevice.seqParallelon every frame when the PDA was open. This delegate was never removed, causing it to accumulate in the parallel execution queue with each open/close cycle. SinceseqParallelis executed every frame, the accumulated delegates caused increasing work per frame, leading to FPS degradation.Implementation
m_logs_work_delegatemember toCUIPdaWndto store the delegate instance for proper removalUpdate()toShow(true)when PDA opensShow(false)when PDA closes usingDevice.remove_from_seq_parallel()Update()Show(false)might not be called during shutdownShow(true)to prevent duplicate registration on repeated show callsVerification
git diff --checkpasses with no whitespace issuesShow(true)(with duplicate removal safeguard)Show(false)using the same delegate instanceremove_from_seq_parallel()usesstd::findto locate and remove the exact delegateGenerated with Devin