From 73f313f90435bd023c8ece0eda10e71d6d3b87c1 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 14 Jul 2022 19:41:40 +0200 Subject: [PATCH] [dxvk] Enable Vulkan 1.2 feature structs --- src/dxvk/dxvk_adapter.cpp | 31 +++++++++++++++++++++++++++++++ src/dxvk/dxvk_device_info.h | 2 ++ 2 files changed, 33 insertions(+) diff --git a/src/dxvk/dxvk_adapter.cpp b/src/dxvk/dxvk_adapter.cpp index 7dec71d0b..0bfd2d1b6 100644 --- a/src/dxvk/dxvk_adapter.cpp +++ b/src/dxvk/dxvk_adapter.cpp @@ -222,6 +222,20 @@ namespace dxvk { || !required.core.features.inheritedQueries) && (m_deviceFeatures.vk11.shaderDrawParameters || !required.vk11.shaderDrawParameters) + && (m_deviceFeatures.vk12.samplerMirrorClampToEdge + || !required.vk12.samplerMirrorClampToEdge) + && (m_deviceFeatures.vk12.drawIndirectCount + || !required.vk12.drawIndirectCount) + && (m_deviceFeatures.vk12.hostQueryReset + || !required.vk12.hostQueryReset) + && (m_deviceFeatures.vk12.timelineSemaphore + || !required.vk12.timelineSemaphore) + && (m_deviceFeatures.vk12.bufferDeviceAddress + || !required.vk12.bufferDeviceAddress) + && (m_deviceFeatures.vk12.shaderOutputViewportIndex + || !required.vk12.shaderOutputViewportIndex) + && (m_deviceFeatures.vk12.shaderOutputLayer + || !required.vk12.shaderOutputLayer) && (m_deviceFeatures.ext4444Formats.formatA4R4G4B4 || !required.ext4444Formats.formatA4R4G4B4) && (m_deviceFeatures.ext4444Formats.formatA4B4G4R4 @@ -376,6 +390,9 @@ namespace dxvk { enabledFeatures.vk11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; enabledFeatures.vk11.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.vk11); + enabledFeatures.vk12.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; + enabledFeatures.vk12.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.vk12); + if (devExtensions.ext4444Formats) { enabledFeatures.ext4444Formats.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; enabledFeatures.ext4444Formats.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.ext4444Formats); @@ -630,6 +647,9 @@ namespace dxvk { m_deviceInfo.vk11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES; m_deviceInfo.vk11.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.vk11); + m_deviceInfo.vk12.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES; + m_deviceInfo.vk12.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.vk12); + if (m_deviceExtensions.supports(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME)) { m_deviceInfo.extConservativeRasterization.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT; m_deviceInfo.extConservativeRasterization.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.extConservativeRasterization); @@ -706,6 +726,9 @@ namespace dxvk { m_deviceFeatures.vk11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; m_deviceFeatures.vk11.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.vk11); + m_deviceFeatures.vk12.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; + m_deviceFeatures.vk12.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.vk12); + if (m_deviceExtensions.supports(VK_EXT_4444_FORMATS_EXTENSION_NAME)) { m_deviceFeatures.ext4444Formats.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; m_deviceFeatures.ext4444Formats.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.ext4444Formats); @@ -854,6 +877,14 @@ namespace dxvk { "\n variableMultisampleRate : ", features.core.features.variableMultisampleRate ? "1" : "0", "\nVulkan 1.1", "\n shaderDrawParameters : ", features.vk11.shaderDrawParameters, + "\nVulkan 1.2", + "\n samplerMirrorClampToEdge : ", features.vk12.samplerMirrorClampToEdge, + "\n drawIndirectCount : ", features.vk12.drawIndirectCount, + "\n hostQueryReset : ", features.vk12.hostQueryReset, + "\n timelineSemaphore : ", features.vk12.timelineSemaphore, + "\n bufferDeviceAddress : ", features.vk12.bufferDeviceAddress, + "\n shaderOutputViewportIndex : ", features.vk12.shaderOutputViewportIndex, + "\n shaderOutputLayer : ", features.vk12.shaderOutputLayer, "\n", VK_EXT_4444_FORMATS_EXTENSION_NAME, "\n formatA4R4G4B4 : ", features.ext4444Formats.formatA4R4G4B4 ? "1" : "0", "\n formatA4B4G4R4 : ", features.ext4444Formats.formatA4B4G4R4 ? "1" : "0", diff --git a/src/dxvk/dxvk_device_info.h b/src/dxvk/dxvk_device_info.h index 501acb093..ffe5e5240 100644 --- a/src/dxvk/dxvk_device_info.h +++ b/src/dxvk/dxvk_device_info.h @@ -15,6 +15,7 @@ namespace dxvk { struct DxvkDeviceInfo { VkPhysicalDeviceProperties2 core; VkPhysicalDeviceVulkan11Properties vk11; + VkPhysicalDeviceVulkan12Properties vk12; VkPhysicalDeviceConservativeRasterizationPropertiesEXT extConservativeRasterization; VkPhysicalDeviceCustomBorderColorPropertiesEXT extCustomBorderColor; VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT extGraphicsPipelineLibrary; @@ -37,6 +38,7 @@ namespace dxvk { struct DxvkDeviceFeatures { VkPhysicalDeviceFeatures2 core; VkPhysicalDeviceVulkan11Features vk11; + VkPhysicalDeviceVulkan12Features vk12; VkPhysicalDevice4444FormatsFeaturesEXT ext4444Formats; VkPhysicalDeviceCustomBorderColorFeaturesEXT extCustomBorderColor; VkPhysicalDeviceDepthClipEnableFeaturesEXT extDepthClipEnable;