aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-09-25 21:00:02 -0300
committerGitHub <noreply@github.com>2023-09-26 02:00:02 +0200
commit4744bde0e59578baeb5f94126087953f6d8ddba0 (patch)
tree6f85ea9241d2b1dbdc67b73c072f145395153eab /src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
parent4a835bb2b9130b91d35968b2f7800084cf286de4 (diff)
Reduce the amount of descriptor pool allocations on Vulkan (#5673)1.1.1030
* Reduce the amount of descriptor pool allocations on Vulkan * Formatting * Slice can be simplified * Make GetDescriptorPoolSizes static * Adjust CanFit calculation so that TryAllocateDescriptorSets never fails * Remove unused field
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs')
-rw-r--r--src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs b/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
index 14e4c02f..a9a92df1 100644
--- a/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
+++ b/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs
@@ -59,6 +59,8 @@ namespace Ryujinx.Graphics.Vulkan
private BitMapStruct<Array2<long>> _uniformMirrored;
private BitMapStruct<Array2<long>> _storageMirrored;
+ private bool _updateDescriptorCacheCbIndex;
+
[Flags]
private enum DirtyFlags
{
@@ -218,6 +220,7 @@ namespace Ryujinx.Graphics.Vulkan
public void SetProgram(ShaderCollection program)
{
_program = program;
+ _updateDescriptorCacheCbIndex = true;
_dirty = DirtyFlags.All;
}
@@ -490,7 +493,13 @@ namespace Ryujinx.Graphics.Vulkan
var dummyBuffer = _dummyBuffer?.GetBuffer();
- var dsc = program.GetNewDescriptorSetCollection(_gd, cbs.CommandBufferIndex, setIndex, out var isNew).Get(cbs);
+ if (_updateDescriptorCacheCbIndex)
+ {
+ _updateDescriptorCacheCbIndex = false;
+ program.UpdateDescriptorCacheCommandBufferIndex(cbs.CommandBufferIndex);
+ }
+
+ var dsc = program.GetNewDescriptorSetCollection(setIndex, out var isNew).Get(cbs);
if (!program.HasMinimalLayout)
{
@@ -697,6 +706,7 @@ namespace Ryujinx.Graphics.Vulkan
public void SignalCommandBufferChange()
{
+ _updateDescriptorCacheCbIndex = true;
_dirty = DirtyFlags.All;
_uniformSet.Clear();