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.
This PR fixed the prefetching logic when the playing is not sequential.
New prefetching algorithm:
Constraint: The frames within the buffer are required to form a contiguous sequence, meaning that consecutive frame indices must be present without any gaps.
When the requested frame is not inside the prefetching buffer, it will discard all previous frames, and start to prefetch from current frames.
For example, if the current prefetch buffer contains these frames:
Then we request for the 10th frame, the prefetch buffer state will become:
Test:
Setting:
cargo run --bin vvplay_async -- --buffer-capacity=4 ./Ply
Test 1: Request for a ready frame inside the buffer
Extra note:
CameraPosition
of previous frame is retrievable, the program will use that; else, it will just use the defaultCameraPosition
FrameRequest
needs to be processed in order for the currentFrameRequest
to be handled.