Repository navigation
Conversation
nitoygo
added a commit
to nitoygo/MuMain
that referenced
this pull request
Nov 15, 2026
Builds on the previous commit (sven-n#1132), which lets uploads outside a load batch share the open submission until the frame's flush. The uploader still kept three staging slots and waited for the oldest one's fence when the ring wrapped, and a browser frame can't wait at all. - A slot the GPU is still copying is skipped: the uploader takes the next finished slot or adds one, up to 16 (64 MiB); only past that, or out of memory, does it wait. Idle slots past the first three are released after 60 frames without growth. - With every upload sharing the open slot until the next flush, the load batch's begin/end on the uploader is gone; a load ends with a flush. - StagedLoad::Pump takes a hold-back check between steps; startup leaves its next step to the next frame while more than 32 MiB of staging is still being copied. - A finished fence is still waited on (it returns at once): SDL's Vulkan backend cleans up finished submissions only on a fence wait or a frame submit, and without it texture creation slowed during loads. - The control socket's `frames` query reports the longest frame and slow frames since the last reset.
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.
Bug
Opening a window for the first time uploaded its textures one at a time inside the frame. Outside a load batch, every bitmap upload was its own GPU submission. Reusing a staging slot then waited on the previous submission's fence, so the game thread stalled and frames were dropped.
Change
Uploads outside a load batch now share the open submission until a staging slot is full or the frame's
Flushtakes it.Flushalready runs before the frame submit, so a texture is on the GPU before the first frame that draws it.Behaviour to be aware of: outside a batch,
Uploadcan return success before its submission is in. A submit or fence failure is reported byFlush, not by theUploadcall. This is documented inBitmapGpuResources.h.Tests
Flush()at the frame boundary.69889acwithCHECK( 0 == 1024 )and passes on this change.test_bitmap_gpu_resources.cppfile passes.The test build uses
tests/main.cppas its doctest entry point, becausebuild/standalone/main.cppdoes not exist in the repository.Not done: the browser and desktop frame-time measurements from the issue's acceptance criteria. They need a running build and were not run in this change.
Regression test: fails on commit 69889ac twice (/CHECK( 0 == 1024 )/), passes on fix twice (
mkdir -p build/standalone && g++ -std=c++20 -I tests/third_party/doctest -I src/ThirdParty/SDL/include -I src/source -Wl,--unresolved-symbols=ignore-all -o build/standalone/bgr tests/main.cpp tests/render/test_bitmap_gpu_resources.cpp src/source/Render/Renderer/BitmapGpuResources.cpp && ./build/standalone/bgr -tc="uploads outside a batch*")Refs #1094