From 4335eccae9f233fbf8180395845258a27cb2f180 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sun, 18 Dec 2022 17:25:18 +0000 Subject: [PATCH] [dxvk] Enable VK_EXT_swapchain_colorspace --- VP_DXVK_requirements.json | 9 ++++++++- src/dxvk/dxvk_adapter.cpp | 13 ++++++++++++- src/dxvk/dxvk_device_info.h | 1 + src/dxvk/dxvk_extensions.h | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/VP_DXVK_requirements.json b/VP_DXVK_requirements.json index 751203d43..133d6c1ca 100644 --- a/VP_DXVK_requirements.json +++ b/VP_DXVK_requirements.json @@ -185,7 +185,8 @@ "VK_EXT_memory_priority": 1, "VK_EXT_vertex_attribute_divisor": 1, "VK_EXT_custom_border_color": 1, - "VK_EXT_depth_clip_enable": 1 + "VK_EXT_depth_clip_enable": 1, + "VK_EXT_swapchain_colorspace": 1 }, "features": { "VkPhysicalDeviceFeatures": { @@ -385,6 +386,12 @@ } }, "history": [ + { + "revision": 4, + "date": "2022-12-18", + "author": "Joshua Ashton", + "comment": "Add VK_EXT_swapchain_colorspace to d3d11_baseline_optional" + }, { "revision": 3, "date": "2022-10-13", diff --git a/src/dxvk/dxvk_adapter.cpp b/src/dxvk/dxvk_adapter.cpp index e7ef26226..5bafb9f98 100644 --- a/src/dxvk/dxvk_adapter.cpp +++ b/src/dxvk/dxvk_adapter.cpp @@ -316,6 +316,8 @@ namespace dxvk { || !required.extShaderModuleIdentifier.shaderModuleIdentifier) && (m_deviceFeatures.extShaderStencilExport || !required.extShaderStencilExport) + && (m_deviceFeatures.extShaderStencilExport + || !required.extSwapchainColorSpace) && (m_deviceFeatures.extTransformFeedback.transformFeedback || !required.extTransformFeedback.transformFeedback) && (m_deviceFeatures.extVertexAttributeDivisor.vertexAttributeInstanceRateDivisor @@ -335,7 +337,7 @@ namespace dxvk { DxvkDeviceFeatures enabledFeatures) { DxvkDeviceExtensions devExtensions; - std::array devExtensionList = {{ + std::array devExtensionList = {{ &devExtensions.amdMemoryOverallocationBehaviour, &devExtensions.amdShaderFragmentMask, &devExtensions.extAttachmentFeedbackLoopLayout, @@ -352,6 +354,7 @@ namespace dxvk { &devExtensions.extRobustness2, &devExtensions.extShaderModuleIdentifier, &devExtensions.extShaderStencilExport, + &devExtensions.extSwapchainColorSpace, &devExtensions.extTransformFeedback, &devExtensions.extVertexAttributeDivisor, &devExtensions.khrExternalMemoryWin32, @@ -537,6 +540,9 @@ namespace dxvk { if (devExtensions.extShaderStencilExport) enabledFeatures.extShaderStencilExport = VK_TRUE; + if (devExtensions.extSwapchainColorSpace) + enabledFeatures.extSwapchainColorSpace = VK_TRUE; + if (devExtensions.extTransformFeedback) { enabledFeatures.extTransformFeedback.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; enabledFeatures.extTransformFeedback.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.extTransformFeedback); @@ -875,6 +881,9 @@ namespace dxvk { if (m_deviceExtensions.supports(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME)) m_deviceFeatures.extShaderStencilExport = VK_TRUE; + if (m_deviceExtensions.supports(VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME)) + m_deviceFeatures.extSwapchainColorSpace = VK_TRUE; + if (m_deviceExtensions.supports(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME)) { m_deviceFeatures.extTransformFeedback.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; m_deviceFeatures.extTransformFeedback.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extTransformFeedback); @@ -1024,6 +1033,8 @@ namespace dxvk { "\n shaderModuleIdentifier : ", features.extShaderModuleIdentifier.shaderModuleIdentifier ? "1" : "0", "\n", VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, "\n extension supported : ", features.extShaderStencilExport ? "1" : "0", + "\n", VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, + "\n extension supported : ", features.extSwapchainColorSpace ? "1" : "0", "\n", VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, "\n transformFeedback : ", features.extTransformFeedback.transformFeedback ? "1" : "0", "\n geometryStreams : ", features.extTransformFeedback.geometryStreams ? "1" : "0", diff --git a/src/dxvk/dxvk_device_info.h b/src/dxvk/dxvk_device_info.h index 21b1b68cc..7b3527969 100644 --- a/src/dxvk/dxvk_device_info.h +++ b/src/dxvk/dxvk_device_info.h @@ -54,6 +54,7 @@ namespace dxvk { VkPhysicalDeviceRobustness2FeaturesEXT extRobustness2; VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT extShaderModuleIdentifier; VkBool32 extShaderStencilExport; + VkBool32 extSwapchainColorSpace; VkPhysicalDeviceTransformFeedbackFeaturesEXT extTransformFeedback; VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT extVertexAttributeDivisor; VkBool32 khrExternalMemoryWin32; diff --git a/src/dxvk/dxvk_extensions.h b/src/dxvk/dxvk_extensions.h index 1684f6caa..3d3d979b9 100644 --- a/src/dxvk/dxvk_extensions.h +++ b/src/dxvk/dxvk_extensions.h @@ -292,6 +292,7 @@ namespace dxvk { DxvkExt extRobustness2 = { VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, DxvkExtMode::Required }; DxvkExt extShaderModuleIdentifier = { VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extShaderStencilExport = { VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, DxvkExtMode::Optional }; + DxvkExt extSwapchainColorSpace = { VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extTransformFeedback = { VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt khrExternalMemoryWin32 = { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, DxvkExtMode::Optional };