Simplify fast scenechange code a bit #3320
Merged
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.
downscaled_frame_buffer
is anOption<([Plane<T>; 2], bool)>
. The bool is calledis_initialized
and is supposed to show whether the memory in the[Plane<T>; 2]
is initialized or not.As far as I can tell, there is no code path that results in the Planes being uninitialized:
downscaled_frame_buffer
starts out as aNone
, the first buffer access allocates & initializes the memory, and the memory should always be initialized after that. The bool never seems to befalse
from what I can tell, which would support my assumption, I think.There's also a field called
frame_ref_buffer
which caches theArc<Frame<T>>
when no downscaling is being done. Unless I am missing something, there's no real benefit to caching these pointers (because refs to both frames will always be passed into the function anyways), so i removed the buffer.I tested my changes to the best of my ability, and didn't notice any change in behaviour or performance. LMK what you think