Repository navigation
Publish replacement textures within the frame budget - #323
Open
CharlieMacnamara wants to merge 2 commits into
Open
CharlieMacnamara wants to merge 2 commits into
CharlieMacnamara wants to merge 2 commits into
Conversation
write_texture writes whole mip levels. Uploading a decoded replacement texture over several frames needs to write any row range of any level, with the same layout and upload path so that the result is identical. The row range loop moves into a shared helper; write_texture calls it with the whole level.
A decoded replacement goes up in one frame on the presenting thread. publish_fits_budget exempts the first publish of a frame from the limit, so a single large chain is uploaded whole: 4096x4096 BC7 textures in a texture pack stalled for 2 to 3 s each. A publish now spends at most ReplacementPublishBudgetBytes per frame, a row range at a time, and the handle reaches the replacement cache only after the last row arrives, so a draw never samples a partly written texture. Rows still to write are kept across frames; a publishing entry that is no longer selected is dropped. s_readyPublishes becomes a deque because publishes are consumed from the front one at a time.
CharlieMacnamara
force-pushed
the
texture-replacement-publish-budget
branch
from
November 19, 2026 01:15
056d5ad to
5e2dff2
Compare
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.
A decoded replacement is uploaded in one frame on the presenting thread.
publish_fits_budgetexempts the first publish of a frame from the limit, so a single large chain goes up whole: 4096x4096 BC7 replacement textures stalled for 2 to 3 s each with a 4K texture pack.A publish now spends at most
ReplacementPublishBudgetBytesper frame, a row range at a time, and its handle reaches the replacement cache only after the last row, so a draw never samples a partly written texture. The rows still to write are kept for the next frame, and a publish whose entry stops being selected is dropped.With the pack: worst publish 0.1 MB in 2.2 ms, no multi-second frame. The first commit adds
write_texture_rowsso a range of a mip level goes through the same upload path as a whole level.