Avoid ~63 ms Vulkan host memory imports on first texture upload #766
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot#766
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The idea
Reuse an existing host memory import when one already covers a texture. For eligible first uploads with contiguous backing, use Hookshot’s existing staging arena and keep the GPU unswizzle. This would avoid pinning new host memory on the presentation thread for that upload.
I noticed frame drops when jumping after climbing the vines inside the Great Deku Tree. In a Windows play session on an RTX 3070 with
honest-eta(bd9bcd71), two 2000×2000 uploads spent about 63 ms almost entirely in the import. The log does not mark the exact frame of the jump.Test settings were
RX_VK_WAIT_GPU=0,RX_VK_FRAMEGEN_MULT=2, andRX_VK_ASTC_BC_ALL=1. With the local staging experiment, the renderer logged that it took the new path for textures of the same size.The patched upload duration and before/after FPS were not measured. I have not playtested v2.0.2. The tagged source still calls
gpu_bufferdirectly in the GPU unswizzle path. v2.0.2 upload codeAnything else
The local experiment added
gpu_buffer_if_imported, which checks the imported range underpools_muand advances its last-use value. With the existing 8 MiB lower cutoff, the experiment opted into staging only for full first uploads from non-sparse virtual texture storage up to 16 MiB, after the existing format and geometry checks. The core change inupload_unswizzle_gpuwas:This excerpt illustrates the local experiment. An upstream version should stage the submit-time bytes so it respects replay ordering when the game rewrites or remaps the backing storage.
Tracked in #995, follow there. That issue collects every report of low FPS while the GPU is not fully used, and shader stutter, and this one is linked from it with its GPU, version and log details. If it still happens on v2.0.6 (https://github.com/NotRexed/Hookshot/releases/tag/v2.0.6; Update next to Play in the launcher), please add a comment there with your
hookshot_log.txt.