diff options
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/VulkanRenderer.cs')
-rw-r--r-- | Ryujinx.Graphics.Vulkan/VulkanRenderer.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs b/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs index b2f69636..bacb74cc 100644 --- a/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs +++ b/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs @@ -188,11 +188,22 @@ namespace Ryujinx.Graphics.Vulkan SType = StructureType.PhysicalDeviceRobustness2FeaturesExt }; + PhysicalDeviceShaderFloat16Int8FeaturesKHR featuresShaderInt8 = new PhysicalDeviceShaderFloat16Int8FeaturesKHR() + { + SType = StructureType.PhysicalDeviceShaderFloat16Int8Features + }; + if (supportedExtensions.Contains("VK_EXT_robustness2")) { features2.PNext = &featuresRobustness2; } + if (supportedExtensions.Contains("VK_KHR_shader_float16_int8")) + { + featuresShaderInt8.PNext = features2.PNext; + features2.PNext = &featuresShaderInt8; + } + Api.GetPhysicalDeviceFeatures2(_physicalDevice, &features2); Capabilities = new HardwareCapabilities( @@ -202,6 +213,7 @@ namespace Ryujinx.Graphics.Vulkan supportedExtensions.Contains("VK_EXT_fragment_shader_interlock"), supportedExtensions.Contains("VK_NV_geometry_shader_passthrough"), supportedExtensions.Contains("VK_EXT_subgroup_size_control"), + featuresShaderInt8.ShaderInt8, supportedExtensions.Contains(ExtConditionalRendering.ExtensionName), supportedExtensions.Contains(ExtExtendedDynamicState.ExtensionName), features2.Features.MultiViewport, @@ -506,6 +518,24 @@ namespace Ryujinx.Graphics.Vulkan PrintGpuInformation(); } + public bool NeedsVertexBufferAlignment(int attrScalarAlignment, out int alignment) + { + if (Vendor != Vendor.Nvidia) + { + // Vulkan requires that vertex attributes are globally aligned by their component size, + // so buffer strides that don't divide by the largest scalar element are invalid. + // Guest applications do this, NVIDIA GPUs are OK with it, others are not. + + alignment = attrScalarAlignment; + + return true; + } + + alignment = 1; + + return false; + } + public void PreFrame() { _syncManager.Cleanup(); |