1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[dxvk] Enable transform feedback device feature if available

- Enable geometryStreams feature
This commit is contained in:
Philip Rebohle 2018-09-14 10:42:26 +02:00
parent e27083a04f
commit 989a10ab88
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 18 additions and 0 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -28,6 +28,7 @@ namespace dxvk {
*/
struct DxvkDeviceFeatures {
VkPhysicalDeviceFeatures2KHR core;
VkPhysicalDeviceTransformFeedbackFeaturesEXT extTransformFeedback;
VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT extVertexAttributeDivisor;
};