Skip to content

fix: prioritize current frame for single-LOD case (typical volume rendering case)#667

Merged
aganders3 merged 2 commits into
mainfrom
aganders3/single-lod-regressions
May 21, 2026
Merged

fix: prioritize current frame for single-LOD case (typical volume rendering case)#667
aganders3 merged 2 commits into
mainfrom
aganders3/single-lod-regressions

Conversation

@aganders3

Copy link
Copy Markdown
Collaborator

Summary

When working with remote rendering, I noticed a bug I introduced in #665 that results in the volume layer stalling until the entire prefetch queue drains.

That PR rewrote updateChunksForVolume and replaced the per-chunk isCurrentLOD = chunk.lod === currentLOD_ derivation with a markVolumeChunkVisible(chunk, isFallbackLOD) helper that computes isCurrentLOD = !isFallbackLOD. When currentLOD === fallbackLOD, only the current-LOD pass runs, so every chunk is marked with isFallbackLOD=false, isCurrentLOD=true. computePriority then returns visibleCurrent (priority 2 under createPlaybackPolicy) instead of fallbackVisible (priority 0) — and since prefetchTime is priority 1 in the same policy, the current frame's chunks land in the queue behind the entire prefetch backlog.

This restores previous behavior by getting both isFallbackLOD and isCurrentLOD from the chunk's own chunk.lod inside markVolumeChunkVisible, so for single LOD (we configure this typically by setting min LOD === max LOD in the policy) both flags are true and computePriority returns fallbackVisible as it did before #665.

Tests & Checks

I confirmed this fix restores the expected (previous) behavior in a reef idetik-remote session.

@aganders3 aganders3 changed the title fix: prioritize current frame for single-LOD case (typical volume rendering case) fix[small]: prioritize current frame for single-LOD case (typical volume rendering case) May 18, 2026
@aganders3 aganders3 requested a review from shlomnissan May 18, 2026 17:50
@aganders3 aganders3 changed the title fix[small]: prioritize current frame for single-LOD case (typical volume rendering case) fix: prioritize current frame for single-LOD case (typical volume rendering case) May 18, 2026

@shlomnissan shlomnissan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@aganders3 aganders3 merged commit fb47437 into main May 21, 2026
11 of 12 checks passed
@czi-github-helper

Copy link
Copy Markdown

🎉 This PR is included in version 0.22.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants