diff options
author | Georg Lehmann <49841484+DadSchoorse@users.noreply.github.com> | 2022-12-15 00:53:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-14 20:53:33 -0300 |
commit | 0f50de72beb52585ee032a72990bb505885eab19 (patch) | |
tree | c0831fccbea758303c1d623a3ef849e107301524 /Ryujinx.Graphics.Vulkan/VulkanInitialization.cs | |
parent | df758eddd1d61f776415422dc4dd1fa8a776719c (diff) |
Vulkan: enable VK_EXT_custom_border_color features (#4116)1.1.469
* Vulkan: enable VK_EXT_custom_border_color features
radv only create the border color bo if this feature is enabled, so it crashed when creating samplers with custom border colors
Fixes #4072
Fixes #3993
* Address gdkchan's comment
Co-authored-by: Mary <mary@mary.zone>
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/VulkanInitialization.cs')
-rw-r--r-- | Ryujinx.Graphics.Vulkan/VulkanInitialization.cs | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs b/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs index 942970c2..68462825 100644 --- a/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs +++ b/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs @@ -374,7 +374,24 @@ namespace Ryujinx.Graphics.Vulkan api.GetPhysicalDeviceProperties(physicalDevice, out var properties); bool useRobustBufferAccess = VendorUtils.FromId(properties.VendorID) == Vendor.Nvidia; - var supportedFeatures = api.GetPhysicalDeviceFeature(physicalDevice); + PhysicalDeviceFeatures2 features2 = new PhysicalDeviceFeatures2() + { + SType = StructureType.PhysicalDeviceFeatures2 + }; + + PhysicalDeviceCustomBorderColorFeaturesEXT featuresCustomBorderColorSupported = new PhysicalDeviceCustomBorderColorFeaturesEXT() + { + SType = StructureType.PhysicalDeviceCustomBorderColorFeaturesExt + }; + + if (supportedExtensions.Contains("VK_EXT_custom_border_color")) + { + features2.PNext = &featuresCustomBorderColorSupported; + } + + api.GetPhysicalDeviceFeatures2(physicalDevice, &features2); + + var supportedFeatures = features2.Features; var features = new PhysicalDeviceFeatures() { @@ -491,6 +508,23 @@ namespace Ryujinx.Graphics.Vulkan pExtendedFeatures = &featuresSubgroupSizeControl; } + PhysicalDeviceCustomBorderColorFeaturesEXT featuresCustomBorderColor; + + if (supportedExtensions.Contains("VK_EXT_custom_border_color") && + featuresCustomBorderColorSupported.CustomBorderColors && + featuresCustomBorderColorSupported.CustomBorderColorWithoutFormat) + { + featuresCustomBorderColor = new PhysicalDeviceCustomBorderColorFeaturesEXT() + { + SType = StructureType.PhysicalDeviceCustomBorderColorFeaturesExt, + PNext = pExtendedFeatures, + CustomBorderColors = true, + CustomBorderColorWithoutFormat = true, + }; + + pExtendedFeatures = &featuresCustomBorderColor; + } + var enabledExtensions = RequiredExtensions.Union(DesirableExtensions.Intersect(supportedExtensions)).ToArray(); IntPtr* ppEnabledExtensions = stackalloc IntPtr[enabledExtensions.Length]; |