forked from Mirror/Ryujinx
795539bc82
* Vulkan: Use staging buffer for temporary constants Helper shaders and post processing effects typically need some parameters to tell them what to do, which we pass via constant buffers that are created and destroyed each time. This can vary in cost between different Vulkan drivers. It shows up on profiles on mesa and MoltenVK, so it's worth avoiding. Some games only do it once (BlitColor for present), others multiple times. It's also done for post processing filters and FSR upscaling, which creates two buffers. For mirrors, I added the ability to reserve a range on the staging buffer for use as any type of binding. This PR allows these constant buffers to be instead temporarily allocated on the staging buffer, skipping allocation and buffer management costs entirely. Two temporary allocations do remain: - DrawTexture, because it doesn't have access to the command buffer scope - Index buffer indirect conversion, because one of them is a storage buffer and thus is a little more complicated. There's a small cost in that the uniform buffer takes up more space due to alignment requirements. At worst that's 256 bytes (on a GTX 1070) but more modern GPUs should have a better time. Worth testing across different games and post effects to make sure they still work. * Use temporary buffer for ConvertIndexBufferIndirect * Simplify alignment passing for now * Fix shader params length for CopyIncompatibleFormats * Set data for helpershaders without overlap checks The data is in the staging buffer, so its usage range is guarded using that. |
||
---|---|---|
.. | ||
ARMeilleure | ||
Ryujinx | ||
Ryujinx.Audio | ||
Ryujinx.Audio.Backends.OpenAL | ||
Ryujinx.Audio.Backends.SDL2 | ||
Ryujinx.Audio.Backends.SoundIo | ||
Ryujinx.Ava | ||
Ryujinx.Common | ||
Ryujinx.Cpu | ||
Ryujinx.Graphics.Device | ||
Ryujinx.Graphics.GAL | ||
Ryujinx.Graphics.Gpu | ||
Ryujinx.Graphics.Host1x | ||
Ryujinx.Graphics.Nvdec | ||
Ryujinx.Graphics.Nvdec.FFmpeg | ||
Ryujinx.Graphics.Nvdec.Vp9 | ||
Ryujinx.Graphics.OpenGL | ||
Ryujinx.Graphics.Shader | ||
Ryujinx.Graphics.Texture | ||
Ryujinx.Graphics.Vic | ||
Ryujinx.Graphics.Video | ||
Ryujinx.Graphics.Vulkan | ||
Ryujinx.Headless.SDL2 | ||
Ryujinx.HLE | ||
Ryujinx.Horizon | ||
Ryujinx.Horizon.Common | ||
Ryujinx.Horizon.Generators | ||
Ryujinx.Horizon.Kernel.Generators | ||
Ryujinx.Input | ||
Ryujinx.Input.SDL2 | ||
Ryujinx.Memory | ||
Ryujinx.SDL2.Common | ||
Ryujinx.ShaderTools | ||
Ryujinx.Tests | ||
Ryujinx.Tests.Memory | ||
Ryujinx.Tests.Unicorn | ||
Ryujinx.Ui.Common | ||
Ryujinx.Ui.LocaleGenerator | ||
Spv.Generator |