From 989a10ab88367f751b14bf82f06d12040d0179cc Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 14 Sep 2018 10:42:26 +0200 Subject: [PATCH] [dxvk] Enable transform feedback device feature if available - Enable geometryStreams feature --- src/d3d11/d3d11_device.cpp | 5 +++++ src/dxvk/dxvk_adapter.cpp | 12 ++++++++++++ src/dxvk/dxvk_device_info.h | 1 + 3 files changed, 18 insertions(+) diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 5bfcc955f..c7c2380fa 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1338,6 +1338,9 @@ namespace dxvk { enabled.core.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; enabled.core.pNext = nullptr; + enabled.extTransformFeedback.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; + enabled.extTransformFeedback.pNext = nullptr; + enabled.extVertexAttributeDivisor.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT; enabled.extVertexAttributeDivisor.pNext = nullptr; @@ -1370,6 +1373,8 @@ namespace dxvk { enabled.core.features.shaderImageGatherExtended = VK_TRUE; enabled.core.features.textureCompressionBC = VK_TRUE; enabled.core.features.variableMultisampleRate = supported.core.features.variableMultisampleRate; + enabled.extTransformFeedback.transformFeedback = supported.extTransformFeedback.transformFeedback; + enabled.extTransformFeedback.geometryStreams = supported.extTransformFeedback.geometryStreams; } if (featureLevel >= D3D_FEATURE_LEVEL_10_1) { diff --git a/src/dxvk/dxvk_adapter.cpp b/src/dxvk/dxvk_adapter.cpp index d6344e111..079ade23f 100644 --- a/src/dxvk/dxvk_adapter.cpp +++ b/src/dxvk/dxvk_adapter.cpp @@ -183,6 +183,8 @@ namespace dxvk { || !required.core.features.variableMultisampleRate) && (m_deviceFeatures.core.features.inheritedQueries || !required.core.features.inheritedQueries) + && (m_deviceFeatures.extTransformFeedback.transformFeedback + || !required.extTransformFeedback.transformFeedback) && (m_deviceFeatures.extVertexAttributeDivisor.vertexAttributeInstanceRateDivisor || !required.extVertexAttributeDivisor.vertexAttributeInstanceRateDivisor) && (m_deviceFeatures.extVertexAttributeDivisor.vertexAttributeInstanceRateZeroDivisor @@ -226,6 +228,11 @@ namespace dxvk { // Create pNext chain for additional device features enabledFeatures.core.pNext = nullptr; + if (devExtensions.extTransformFeedback) { + enabledFeatures.extTransformFeedback.pNext = enabledFeatures.core.pNext; + enabledFeatures.core.pNext = &enabledFeatures.extTransformFeedback; + } + if (devExtensions.extVertexAttributeDivisor.revision() >= 3) { enabledFeatures.extVertexAttributeDivisor.pNext = enabledFeatures.core.pNext; enabledFeatures.core.pNext = &enabledFeatures.extVertexAttributeDivisor; @@ -352,6 +359,11 @@ namespace dxvk { m_deviceFeatures.core.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; m_deviceFeatures.core.pNext = nullptr; + 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); + } + if (m_deviceExtensions.supports(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) >= 3) { m_deviceFeatures.extVertexAttributeDivisor.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT; m_deviceFeatures.extVertexAttributeDivisor.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extVertexAttributeDivisor); diff --git a/src/dxvk/dxvk_device_info.h b/src/dxvk/dxvk_device_info.h index 4af697352..5434c44ca 100644 --- a/src/dxvk/dxvk_device_info.h +++ b/src/dxvk/dxvk_device_info.h @@ -28,6 +28,7 @@ namespace dxvk { */ struct DxvkDeviceFeatures { VkPhysicalDeviceFeatures2KHR core; + VkPhysicalDeviceTransformFeedbackFeaturesEXT extTransformFeedback; VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT extVertexAttributeDivisor; };