Ryujinx/Ryujinx.Graphics.Vulkan
riperiperi a64fee29dc
Vulkan: add situational "Fast Flush" mode (#4667)
* Flush in the middle of long command buffers.

* Vulkan: add situational "Fast Flush" mode

The AutoFlushCounter class was added to periodically flush Vulkan command buffers throughout a frame, which reduces latency to the GPU as commands are submitted and processed much sooner. This was done by allowing command buffers to flush when framebuffer attachments changed.

However, some games have incredibly long render passes with a large number of draws, and really aggressive data access that forces GPU sync.

The Vulkan backend could potentially end up building a single command buffer for 4-5ms if a pass has enough draws, such as in BOTW. In the scenario where sync is waited on immediately after submission, this would have to wait for the completion of a much longer command buffer than usual.

The solution is to force command buffer submission periodically in a "fast flush" mode. This will end up splitting render passes, but it will only enable if sync is aggressive enough.

This should improve performance in GPU limited scenarios, or in games that aggressively wait on synchronization. In some games, it may only kick in when res scaling. It won't trigger in games like SMO where sync is not an issue.

Improves performance in Pokemon Scarlet/Violet (res scaled) and BOTW (in general).

* Add conversions in milliseconds next to flush timers.
2023-04-11 09:23:41 +02:00
..
Effects
MoltenVK
Queries
Shaders
Auto.cs
AutoFlushCounter.cs
BackgroundResources.cs
BitMap.cs
BufferAllocationType.cs
BufferHolder.cs
BufferManager.cs
BufferState.cs
BufferUsageBitmap.cs
CacheByRange.cs
CommandBufferPool.cs
CommandBufferScoped.cs
Constants.cs
DescriptorSetCollection.cs
DescriptorSetManager.cs
DescriptorSetUpdater.cs
DisposableBuffer.cs
DisposableBufferView.cs
DisposableFramebuffer.cs
DisposableImage.cs
DisposableImageView.cs
DisposableMemory.cs
DisposablePipeline.cs
DisposableRenderPass.cs
DisposableSampler.cs
EnumConversion.cs
FenceHelper.cs
FenceHolder.cs
FormatCapabilities.cs
FormatConverter.cs
FormatTable.cs
FramebufferParams.cs
HardwareCapabilities.cs
HashTableSlim.cs
HelperShader.cs
IdList.cs
IndexBufferPattern.cs
IndexBufferState.cs
MemoryAllocation.cs
MemoryAllocator.cs
MemoryAllocatorBlockList.cs
MultiFenceHolder.cs
NativeArray.cs
PersistentFlushBuffer.cs
PipelineBase.cs
PipelineConverter.cs
PipelineDynamicState.cs
PipelineFull.cs
PipelineHelperShader.cs
PipelineLayoutCache.cs
PipelineLayoutCacheEntry.cs
PipelineLayoutFactory.cs
PipelineState.cs
PipelineUid.cs
Ryujinx.Graphics.Vulkan.csproj
SamplerHolder.cs
SemaphoreHolder.cs
Shader.cs
ShaderCollection.cs
SpecInfo.cs
StagingBuffer.cs
SyncManager.cs
TextureBuffer.cs
TextureCopy.cs
TextureStorage.cs
TextureView.cs
Vendor.cs
VertexBufferState.cs
VulkanConfiguration.cs
VulkanDebugMessenger.cs
VulkanException.cs
VulkanInitialization.cs
VulkanInstance.cs
VulkanPhysicalDevice.cs
VulkanRenderer.cs
Window.cs
WindowBase.cs