From 0015a34498d7068c3b4aea0a56bf9d22afae55f8 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Thu, 9 Jun 2022 17:07:59 +0200 Subject: [PATCH] [dxvk] Enable VK_EXT_non_seamless_cube_map if requested. --- src/dxvk/dxvk_adapter.cpp | 17 ++++++++++++++++- src/dxvk/dxvk_device_info.h | 1 + src/dxvk/dxvk_extensions.h | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_adapter.cpp b/src/dxvk/dxvk_adapter.cpp index 4af554fca..ee9a13f83 100644 --- a/src/dxvk/dxvk_adapter.cpp +++ b/src/dxvk/dxvk_adapter.cpp @@ -238,6 +238,8 @@ namespace dxvk { || !required.extHostQueryReset.hostQueryReset) && (m_deviceFeatures.extMemoryPriority.memoryPriority || !required.extMemoryPriority.memoryPriority) + && (m_deviceFeatures.extNonSeamlessCubeMap.nonSeamlessCubeMap + || !required.extNonSeamlessCubeMap.nonSeamlessCubeMap) && (m_deviceFeatures.extRobustness2.robustBufferAccess2 || !required.extRobustness2.robustBufferAccess2) && (m_deviceFeatures.extRobustness2.robustImageAccess2 @@ -263,7 +265,7 @@ namespace dxvk { DxvkDeviceFeatures enabledFeatures) { DxvkDeviceExtensions devExtensions; - std::array devExtensionList = {{ + std::array devExtensionList = {{ &devExtensions.amdMemoryOverallocationBehaviour, &devExtensions.amdShaderFragmentMask, &devExtensions.ext4444Formats, @@ -275,6 +277,7 @@ namespace dxvk { &devExtensions.extHostQueryReset, &devExtensions.extMemoryBudget, &devExtensions.extMemoryPriority, + &devExtensions.extNonSeamlessCubeMap, &devExtensions.extRobustness2, &devExtensions.extShaderDemoteToHelperInvocation, &devExtensions.extShaderStencilExport, @@ -379,6 +382,11 @@ namespace dxvk { enabledFeatures.extMemoryPriority.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.extMemoryPriority); } + if (devExtensions.extNonSeamlessCubeMap) { + enabledFeatures.extNonSeamlessCubeMap.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; + enabledFeatures.extNonSeamlessCubeMap.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.extNonSeamlessCubeMap); + } + if (devExtensions.extShaderDemoteToHelperInvocation) { enabledFeatures.extShaderDemoteToHelperInvocation.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT; enabledFeatures.extShaderDemoteToHelperInvocation.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.extShaderDemoteToHelperInvocation); @@ -684,6 +692,11 @@ namespace dxvk { m_deviceFeatures.extMemoryPriority.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extMemoryPriority); } + if (m_deviceExtensions.supports(VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME)) { + m_deviceFeatures.extNonSeamlessCubeMap.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT; + m_deviceFeatures.extNonSeamlessCubeMap.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extNonSeamlessCubeMap); + } + if (m_deviceExtensions.supports(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) { m_deviceFeatures.extRobustness2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT; m_deviceFeatures.extRobustness2.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extRobustness2); @@ -789,6 +802,8 @@ namespace dxvk { "\n hostQueryReset : ", features.extHostQueryReset.hostQueryReset ? "1" : "0", "\n", VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME, "\n memoryPriority : ", features.extMemoryPriority.memoryPriority ? "1" : "0", + "\n", VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME, + "\n nonSeamlessCubeMap : ", features.extNonSeamlessCubeMap.nonSeamlessCubeMap ? "1" : "0", "\n", VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, "\n robustBufferAccess2 : ", features.extRobustness2.robustBufferAccess2 ? "1" : "0", "\n robustImageAccess2 : ", features.extRobustness2.robustImageAccess2 ? "1" : "0", diff --git a/src/dxvk/dxvk_device_info.h b/src/dxvk/dxvk_device_info.h index d832bec14..d3f9eb164 100644 --- a/src/dxvk/dxvk_device_info.h +++ b/src/dxvk/dxvk_device_info.h @@ -43,6 +43,7 @@ namespace dxvk { VkPhysicalDeviceExtendedDynamicStateFeaturesEXT extExtendedDynamicState; VkPhysicalDeviceHostQueryResetFeaturesEXT extHostQueryReset; VkPhysicalDeviceMemoryPriorityFeaturesEXT extMemoryPriority; + VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT extNonSeamlessCubeMap; VkPhysicalDeviceRobustness2FeaturesEXT extRobustness2; VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT extShaderDemoteToHelperInvocation; VkPhysicalDeviceTransformFeedbackFeaturesEXT extTransformFeedback; diff --git a/src/dxvk/dxvk_extensions.h b/src/dxvk/dxvk_extensions.h index 8a3912bfe..7f2d8e349 100644 --- a/src/dxvk/dxvk_extensions.h +++ b/src/dxvk/dxvk_extensions.h @@ -287,6 +287,7 @@ namespace dxvk { DxvkExt extHostQueryReset = { VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extMemoryBudget = { VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, DxvkExtMode::Passive }; DxvkExt extMemoryPriority = { VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME, DxvkExtMode::Optional }; + DxvkExt extNonSeamlessCubeMap = { VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extRobustness2 = { VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, DxvkExtMode::Required }; DxvkExt extShaderDemoteToHelperInvocation = { VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extShaderStencilExport = { VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, DxvkExtMode::Optional };