Repository navigation
perf(agc): store a DMA_DATA data fill larger than 64 KiB as a buffer fill - #5788
Merged
Merged
Conversation
…fill A DMA_DATA fill with an immediate value is resolved as a packet store, which is limited to 64 KiB. A larger fill was refused there, so the queue worker drained the device and Execute filled the memory on the CPU. Such a fill now goes through the fill kernels' store path (Driver::storeBufferFill, moved unchanged out of Driver::fillBuffer): FillBuffer into the host import, with the same CPU fallback.
11 tasks done
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
Collaborator
|
Checked on the PR merged onto current |
11 tasks done
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.
Minecraft Dungeons II (PPSA16064) gameplay: about 9
DMA_DATAfills per frame on the compute queue each drained the device. With this change, p50 is 79.1–79.5 ms in every run; before, runs land at 82.7–83.0 ms when the title issues these fills during the capture window.What
A
DMA_DATApacket that fills memory with an immediate value (SRC_SEL2) is resolved as a packet store, which is limited to 64 KiB. A larger fill is refused there, so the queue worker drains the device (submits and waits for all recorded work) andExecutefills the memory on the CPU. Minecraft Dungeons II issues about nine such fills per frame on queue 0x20. Every one waits for the GPU and then stores on the CPU, which costs about 9 ms of the compute worker's time per frame. Queue 0 waits for that worker once per frame, so most of the cost lands on the frame.VulkanDevice::FillBufferinto the host import, and the DCC key memo. The body ofDriver::fillBuffer's store is moved, unchanged, intoDriver::storeBufferFillso both callers share it.FillBuffercannot record the fill (no import, for example), the existing fallback waits for the device and fills on the CPU, as the drain did.DMA_DATAfills stay where they were, earlier inpreparePacketMemory, sostoreBufferFillskips its own copy of them for this caller.[sync]counter: DMA fills stored as buffer fills.Tested
Windows 11, WinLibs GCC 15.2, Release.
New check
testLargeDataFillintests/Submit.cpp(agc_driver): a 256 KiB GPU copy into a buffer, then a 256 KiBDMA_DATAdata fill of the same buffer, then a label. It requires every word to hold the fill value (the fill lands after the copy), no device drain, and one DMA fill stored as a buffer fill. Without the change it fails witha DMA_DATA fill larger than 64 KiB drained the device.Suite:
ctest -R "^agc"passes 500/500 (agc_driver_stencil_ref_exportskipped, as onmain).Conventions:
tools/check_conventions.pypasses.MCD2, Squid Coast spawn: the upstream performance trace,
APS5_TRACE_SECONDS=25:15from 25 s after the gameplay HUD appears, interleaved runs, RTX 5070, driver 610.88. Both sides are our test build (mainplus open PRs MCD2 needs, perf(agc): record a DMA copy of up to 64 KiB on the GPU when the GPU still stores into its source #5480 among them); "after" adds this change.[sync]reports 0 device drains (before: every drain was aDMA_DATAfill), and queue 0x20'sDMA_DATAtime drops from 1,021 to 86 ms per 10 s.Not run: Linux; AMD (the GPU tests ran on NVIDIA only); this exact head in the title (the game runs used our test build above).
Checklist
main; no other open PR implements the same functions. Other open PRs edit the same files, none for largeDMA_DATAfills: perf(agc): record a DMA copy of up to 64 KiB on the GPU when the GPU still stores into its source #5480, feat(agc): capture submissions and replay their decode and wait releases offline #4969 and fix(agc): store small pending storage results at each flip #4841 change other blocks ofpreparePacketMemory; perf(agc): read DCC keys behind a pattern fill kernel's fast clear without a wait #5497, perf(agc): take a dword fill of any inline constant as a buffer fill #5380 and perf(agc): pipeline queue-0 draw commits behind the packet worker #1201 edit the fill store this PR moves intoDriver::storeBufferFill, so whichever lands second needs a mechanical rebase.NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)