-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Effects refactoring: loaded effect #4426
Merged
Be-ing
merged 8 commits into
mixxxdj:effects_refactoring
from
daschuer:effects_refactoring_loaded_effect
Oct 18, 2021
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5c79125
Rename loaded_effect related variables to match the CO name
daschuer 890bd1b
Remove redundant check in loadEffectWithDefaults()
daschuer 8c77516
Do not write m_pManifest before we are sure it is actually loaded.
daschuer 272ad22
Remove redundant copy of default constructed EffectParameterPreset
daschuer 32e7c40
Exit effect parameter presets loop once we have a match to save some …
daschuer c0b1864
Added missing 0 set of loaded_effect when it has been unloaded
daschuer f488375
Assert that m_pManifest is null after unloadEffect()
daschuer b7dfb7a
Assert for pManifest and pEffectPreset both set or null
daschuer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong.
m_pManifest
being nullptr indicates that the EffectSlot is empty, which needs to happen before this function returns.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_pManifest is always cleared at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, if loading nullptr this function would return before setting
m_pManifest
to nullptr.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already cleared via unloadEffect();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but that's not obvious. There's no benefit to this change; it only makes the code harder to read. Rebase to remove this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well then a DEBUG_ASSERT must be added instead of implicitly assuming unloadEffect does what the caller expects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Daniel just pointed the actual bug out that I didn't even spot after telling me there is one. The problem occurs when calling loadEffectInner with pManifest being valid but pEffectPreset being nullptr. The slot would result in being unloaded, but having a valid m_pManifest. From what I can tell, this violates an invariant.
The proposed change would eliminate the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. The DEBUG_ASSERT is still needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So have we found the consensus of sticking with the reordering but adding a debug assert between unloadEffect and return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I think a debug assertion should be added checking that pEffectPreset is not nullptr when pManifest is valid.