skyline/app
Billy Laws de796cd2cd Implement overhead-free sequenced buffer updates with megabuffers
Previously constant buffer updates would be handled on the CPU and only the end result would be synced to the GPU before execute. This caused issues as if the constant buffer contents was changed between each draw in a renderpass (e.g. text rendering) the draws themselves would only see the final resulting constant buffer.

We had earlier tried to fix this by using vkCmdUpdateBuffer however this caused significant performance loss due to an oversight in Adreno drivers. We could have worked around this simply by using vkCmdCopy buffer however there would still be a performance loss due to renderpasses being split up with copies inbetween.

To avoid this we introduce 'megabuffers', a brand new technique not done before in any other switch emulators. Rather than replaying the copies in sequence on the GPU, we take advantage of the fact that buffers are generally small in order to replay buffers on the GPU instead. Each write and subsequent usage of a buffer will cause a copy of the buffer with that write, and all prior applied to be pushed into the megabuffer, this way at the start of execute the megabuffer will hold all used states of the buffer simultaneously. Draws then reference these individual states in sequence to allow everything to work without any copies. In order to support this buffers have been moved to an immediate sync model, with synchronisation being done at usage-time rather than execute (in order to keep contents properly sequenced) and GPU-side writes now need to be explictly marked (since they prevent megabuffering). It should also be noted that a fallback path using cmdCopyBuffer exists for the cases where buffers are too large or GPU dirty.
2022-04-23 22:48:28 +01:00
..
libraries Swap out boostorg/boost for skyline-emu/boost 2022-04-14 14:14:52 +05:30
src/main Implement overhead-free sequenced buffer updates with megabuffers 2022-04-23 22:48:28 +01:00
.gitignore libNX FS Initalization (v0.3) 2019-10-18 16:22:38 +05:30
build.gradle Swap out boostorg/boost for skyline-emu/boost 2022-04-14 14:14:52 +05:30
CMakeLists.txt Implement QuadList support for non-indexed draws 2022-04-20 18:17:10 +02:00
proguard-rules.pro Keep member names in pro guard 2020-11-12 22:19:55 +05:30