diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 916a1cf7c9..ef7b452411 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1094,6 +1094,11 @@ bool Device::GetSuitability(bool requires_swapchain) { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; SetNext(next, properties.transform_feedback); } + if (extensions.maintenance5) { + properties.maintenance5.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR; + SetNext(next, properties.maintenance5); + } // Perform the property fetch. physical.GetProperties2(properties2); @@ -1365,6 +1370,17 @@ void Device::RemoveUnsuitableExtensions() { // VK_KHR_maintenance5 extensions.maintenance5 = features.maintenance5.maintenance5; + + if (extensions.maintenance5) { + LOG_INFO(Render_Vulkan, "VK_KHR_maintenance5 properties: polygonModePointSize={} " + "depthStencilSwizzleOne={} earlyFragmentTests={} nonStrictWideLines={}", + properties.maintenance5.polygonModePointSize, + properties.maintenance5.depthStencilSwizzleOneSupport, + properties.maintenance5.earlyFragmentMultisampleCoverageAfterSampleCounting && + properties.maintenance5.earlyFragmentSampleMaskTestBeforeSampleCounting, + properties.maintenance5.nonStrictWideLinesUseParallelogram); + } + RemoveExtensionFeatureIfUnsuitable(extensions.maintenance5, features.maintenance5, VK_KHR_MAINTENANCE_5_EXTENSION_NAME); diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 17e644d4e7..ab61301d0f 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -786,6 +786,23 @@ public: return extensions.maintenance5; } + /// Returns true if polygon mode POINT supports gl_PointSize. + bool SupportsPolygonModePointSize() const { + return extensions.maintenance5 && properties.maintenance5.polygonModePointSize; + } + + /// Returns true if depth/stencil swizzle ONE is supported. + bool SupportsDepthStencilSwizzleOne() const { + return extensions.maintenance5 && properties.maintenance5.depthStencilSwizzleOneSupport; + } + + /// Returns true if early fragment tests optimizations are available. + bool SupportsEarlyFragmentTests() const { + return extensions.maintenance5 && + properties.maintenance5.earlyFragmentMultisampleCoverageAfterSampleCounting && + properties.maintenance5.earlyFragmentSampleMaskTestBeforeSampleCounting; + } + /// Returns true if the device supports VK_KHR_maintenance6. bool IsKhrMaintenance6Supported() const { return extensions.maintenance6; @@ -920,6 +937,7 @@ private: VkPhysicalDevicePushDescriptorPropertiesKHR push_descriptor{}; VkPhysicalDeviceSubgroupSizeControlProperties subgroup_size_control{}; VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback{}; + VkPhysicalDeviceMaintenance5PropertiesKHR maintenance5{}; VkPhysicalDeviceProperties properties{}; };