Add support for large sampler arrays on Vulkan (#6489)

* Add support for large sampler arrays on Vulkan

* Shader cache version bump

* Format whitespace

* Move DescriptorSetManager to PipelineLayoutCacheEntry to allow different pool sizes per layout

* Handle array textures with different types on the same buffer

* Somewhat better caching system

* Avoid useless buffer data modification checks

* Move redundant bindings update checking to the backend

* Fix an issue where texture arrays would get the same bindings across stages on Vulkan

* Backport some fixes from part 2

* Fix typo

* PR feedback

* Format whitespace

* Add some missing XML docs
This commit is contained in:
gdkchan 2024-04-07 18:25:55 -03:00 committed by GitHub
parent 808803d97a
commit 3e6e0e4afa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
83 changed files with 3263 additions and 955 deletions

View file

@ -241,7 +241,9 @@ namespace Ryujinx.Graphics.Vulkan
if (currentDescriptor.Binding + currentCount != descriptor.Binding ||
currentDescriptor.Type != descriptor.Type ||
currentDescriptor.Stages != descriptor.Stages)
currentDescriptor.Stages != descriptor.Stages ||
currentDescriptor.Count > 1 ||
descriptor.Count > 1)
{
if (currentCount != 0)
{
@ -249,7 +251,8 @@ namespace Ryujinx.Graphics.Vulkan
currentDescriptor.Binding,
currentCount,
currentDescriptor.Type,
currentDescriptor.Stages));
currentDescriptor.Stages,
currentDescriptor.Count > 1));
}
currentDescriptor = descriptor;
@ -267,7 +270,8 @@ namespace Ryujinx.Graphics.Vulkan
currentDescriptor.Binding,
currentCount,
currentDescriptor.Type,
currentDescriptor.Stages));
currentDescriptor.Stages,
currentDescriptor.Count > 1));
}
segments[setIndex] = currentSegments.ToArray();
@ -293,7 +297,9 @@ namespace Ryujinx.Graphics.Vulkan
if (currentUsage.Binding + currentCount != usage.Binding ||
currentUsage.Type != usage.Type ||
currentUsage.Stages != usage.Stages)
currentUsage.Stages != usage.Stages ||
currentUsage.ArrayLength > 1 ||
usage.ArrayLength > 1)
{
if (currentCount != 0)
{
@ -301,11 +307,12 @@ namespace Ryujinx.Graphics.Vulkan
currentUsage.Binding,
currentCount,
currentUsage.Type,
currentUsage.Stages));
currentUsage.Stages,
currentUsage.ArrayLength > 1));
}
currentUsage = usage;
currentCount = 1;
currentCount = usage.ArrayLength;
}
else
{
@ -319,7 +326,8 @@ namespace Ryujinx.Graphics.Vulkan
currentUsage.Binding,
currentCount,
currentUsage.Type,
currentUsage.Stages));
currentUsage.Stages,
currentUsage.ArrayLength > 1));
}
segments[setIndex] = currentSegments.ToArray();
@ -344,7 +352,13 @@ namespace Ryujinx.Graphics.Vulkan
if (segments != null && segments.Length > 0)
{
templates[setIndex] = new DescriptorSetTemplate(_gd, _device, segments, _plce, IsCompute ? PipelineBindPoint.Compute : PipelineBindPoint.Graphics, setIndex);
templates[setIndex] = new DescriptorSetTemplate(
_gd,
_device,
segments,
_plce,
IsCompute ? PipelineBindPoint.Compute : PipelineBindPoint.Graphics,
setIndex);
}
}