JinxRyu/src
riperiperi 795539bc82
Vulkan: Use staging buffer for temporary constants (#6168)
* 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.
2024-01-25 19:29:53 +01:00
..
ARMeilleure Implement SQSHL (immediate) CPU instruction (#6155) 2024-01-24 23:50:43 +01:00
Ryujinx Change shader cache init wait method (#6131) 2024-01-18 14:17:38 -03:00
Ryujinx.Audio Fix integer overflow on downsample surround to stereo (#6160) 2024-01-21 21:11:46 +01:00
Ryujinx.Audio.Backends.OpenAL editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Audio.Backends.SDL2 editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Audio.Backends.SoundIo editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Ava Change shader cache init wait method (#6131) 2024-01-18 14:17:38 -03:00
Ryujinx.Common Support portable mode using the macOS app bundle. (#6147) 2024-01-20 03:09:51 +01:00
Ryujinx.Cpu Implement a new JIT for Arm devices (#6057) 2024-01-20 11:11:28 -03:00
Ryujinx.Graphics.Device Add a separate device memory manager (#6153) 2024-01-22 17:14:46 -03:00
Ryujinx.Graphics.GAL Implement support for multi-range buffers using Vulkan sparse mappings (#5427) 2023-12-04 20:30:19 +01:00
Ryujinx.Graphics.Gpu Fix missing data for new copy dependency textures with mismatching size (#6161) 2024-01-22 17:42:26 -03:00
Ryujinx.Graphics.Host1x Add a separate device memory manager (#6153) 2024-01-22 17:14:46 -03:00
Ryujinx.Graphics.Nvdec Add a separate device memory manager (#6153) 2024-01-22 17:14:46 -03:00
Ryujinx.Graphics.Nvdec.FFmpeg editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Graphics.Nvdec.Vp9 editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Graphics.OpenGL Implement support for multi-range buffers using Vulkan sparse mappings (#5427) 2023-12-04 20:30:19 +01:00
Ryujinx.Graphics.Shader editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Graphics.Texture editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Graphics.Vic Add a separate device memory manager (#6153) 2024-01-22 17:14:46 -03:00
Ryujinx.Graphics.Video editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Graphics.Vulkan Vulkan: Use staging buffer for temporary constants (#6168) 2024-01-25 19:29:53 +01:00
Ryujinx.Headless.SDL2 Change shader cache init wait method (#6131) 2024-01-18 14:17:38 -03:00
Ryujinx.HLE Use unix timestamps on GetFileTimeStampRaw (#6169) 2024-01-24 19:26:59 -03:00
Ryujinx.Horizon editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Horizon.Common editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Horizon.Generators editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Horizon.Kernel.Generators editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Input Input: Improve controller identification (#6029) 2024-01-22 17:02:44 -03:00
Ryujinx.Input.SDL2 Input: Improve controller identification (#6029) 2024-01-22 17:02:44 -03:00
Ryujinx.Memory Implement support for multi-range buffers using Vulkan sparse mappings (#5427) 2023-12-04 20:30:19 +01:00
Ryujinx.SDL2.Common editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.ShaderTools editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Tests Implement SQSHL (immediate) CPU instruction (#6155) 2024-01-24 23:50:43 +01:00
Ryujinx.Tests.Memory editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Tests.Unicorn editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Ryujinx.Ui.Common Fix architecture preference for MacOS game shortcuts (#6145) 2024-01-22 23:10:25 +01:00
Ryujinx.Ui.LocaleGenerator editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00
Spv.Generator editorconfig: Set default encoding to UTF-8 (#5793) 2023-12-04 14:17:13 +01:00