mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-28 07:59:17 +00:00
Vulkan Package Update - Part 1 (#16)
As described. Should hopefully bring speed-ups for macOS devices (thanks Ori!) and general improvements across the board for the vulkan backend (maybe). This will be followed up with a PR from @KeatonTheBot. Co-authored-by: V380-Ori <infiniteloop0finsanity@gmail.com> Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/16
This commit is contained in:
@@ -16,15 +16,15 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
{
|
||||
DescriptorSetLayout[] layouts = new DescriptorSetLayout[setDescriptors.Count];
|
||||
bool[] updateAfterBindFlags = new bool[setDescriptors.Count];
|
||||
|
||||
|
||||
bool isMoltenVk = gd.IsMoltenVk;
|
||||
|
||||
|
||||
for (int setIndex = 0; setIndex < setDescriptors.Count; setIndex++)
|
||||
{
|
||||
ResourceDescriptorCollection rdc = setDescriptors[setIndex];
|
||||
|
||||
ResourceStages activeStages = ResourceStages.None;
|
||||
|
||||
|
||||
if (isMoltenVk)
|
||||
{
|
||||
for (int descIndex = 0; descIndex < rdc.Descriptors.Count; descIndex++)
|
||||
@@ -42,12 +42,13 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
ResourceDescriptor descriptor = rdc.Descriptors[descIndex];
|
||||
ResourceStages stages = descriptor.Stages;
|
||||
|
||||
if (descriptor.Type == ResourceType.StorageBuffer && isMoltenVk)
|
||||
if (descriptor.Type == ResourceType.StorageBuffer && gd.IsMoltenVk)
|
||||
{
|
||||
// There's a bug on MoltenVK where using the same buffer across different stages
|
||||
// There's a bug in MoltenVK where using the same buffer across different stages
|
||||
// causes invalid resource errors, allow the binding on all active stages as workaround.
|
||||
// https://github.com/KhronosGroup/MoltenVK/issues/1870
|
||||
stages = activeStages;
|
||||
}
|
||||
}
|
||||
|
||||
layoutBindings[descIndex] = new DescriptorSetLayoutBinding
|
||||
{
|
||||
|
||||
@@ -435,8 +435,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
|
||||
features2.Features.MultiViewport && !(IsMoltenVk && Vendor == Vendor.Amd), // Workaround for AMD on MoltenVK issue
|
||||
featuresRobustness2.NullDescriptor || IsMoltenVk,
|
||||
supportsPushDescriptors && !IsMoltenVk,
|
||||
propertiesPushDescriptor.MaxPushDescriptors,
|
||||
supportsPushDescriptors,
|
||||
IsMoltenVk ? 16 : propertiesPushDescriptor.MaxPushDescriptors, // In case an old version of MoltenVK is used, apply a limit to prevent vertex explosions.
|
||||
featuresPrimitiveTopologyListRestart.PrimitiveTopologyListRestart,
|
||||
featuresPrimitiveTopologyListRestart.PrimitiveTopologyPatchListRestart,
|
||||
supportsTransformFeedback,
|
||||
@@ -775,10 +775,11 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
supportsShaderBallot: false,
|
||||
supportsShaderBarrierDivergence: Vendor != Vendor.Intel,
|
||||
supportsShaderFloat64: Capabilities.SupportsShaderFloat64,
|
||||
|
||||
supportsShaderNonUniformIndexing:
|
||||
featuresVk12.ShaderSampledImageArrayNonUniformIndexing &&
|
||||
featuresVk12.ShaderStorageImageArrayNonUniformIndexing,
|
||||
supportsTextureGatherOffsets: features2.Features.ShaderImageGatherExtended && !IsMoltenVk,
|
||||
supportsTextureGatherOffsets: features2.Features.ShaderImageGatherExtended,
|
||||
supportsTextureShadowLod: false,
|
||||
supportsVertexStoreAndAtomics: features2.Features.VertexPipelineStoresAndAtomics,
|
||||
supportsViewportIndexVertexTessellation: featuresVk12.ShaderOutputViewportIndex,
|
||||
|
||||
Reference in New Issue
Block a user