1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 16:24:12 +01:00

[dxvk] Enable device features for VK_EXT_vertex_attribute_divisor

This commit is contained in:
Philip Rebohle 2018-09-10 22:10:16 +02:00
parent ba65a1e36b
commit d7441f274b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 24 additions and 2 deletions

View File

@ -1324,6 +1324,9 @@ namespace dxvk {
enabled.core.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
enabled.core.pNext = nullptr;
enabled.extVertexAttributeDivisor.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT;
enabled.extVertexAttributeDivisor.pNext = nullptr;
if (featureLevel >= D3D_FEATURE_LEVEL_9_1) {
enabled.core.features.depthClamp = VK_TRUE;
@ -1376,6 +1379,12 @@ namespace dxvk {
enabled.core.features.vertexPipelineStoresAndAtomics = VK_TRUE;
}
if (supported.extVertexAttributeDivisor.vertexAttributeInstanceRateDivisor
&& supported.extVertexAttributeDivisor.vertexAttributeInstanceRateZeroDivisor) {
enabled.extVertexAttributeDivisor.vertexAttributeInstanceRateDivisor = VK_TRUE;
enabled.extVertexAttributeDivisor.vertexAttributeInstanceRateZeroDivisor = VK_TRUE;
}
return enabled;
}

View File

@ -182,7 +182,11 @@ namespace dxvk {
&& (m_deviceFeatures.core.features.variableMultisampleRate
|| !required.core.features.variableMultisampleRate)
&& (m_deviceFeatures.core.features.inheritedQueries
|| !required.core.features.inheritedQueries);
|| !required.core.features.inheritedQueries)
&& (m_deviceFeatures.extVertexAttributeDivisor.vertexAttributeInstanceRateDivisor
|| !required.extVertexAttributeDivisor.vertexAttributeInstanceRateDivisor)
&& (m_deviceFeatures.extVertexAttributeDivisor.vertexAttributeInstanceRateZeroDivisor
|| !required.extVertexAttributeDivisor.vertexAttributeInstanceRateZeroDivisor);
}
@ -217,7 +221,16 @@ namespace dxvk {
Logger::info("Enabled device extensions:");
this->logNameList(extensionNameList);
// Create pNext chain for additional device features
enabledFeatures.core.pNext = nullptr;
if (devExtensions.extVertexAttributeDivisor.revision() >= 3) {
enabledFeatures.extVertexAttributeDivisor.pNext = enabledFeatures.core.pNext;
enabledFeatures.core.pNext = &enabledFeatures.extVertexAttributeDivisor;
}
// Create one single queue for graphics and present
float queuePriority = 1.0f;
std::vector<VkDeviceQueueCreateInfo> queueInfos;
@ -241,7 +254,7 @@ namespace dxvk {
VkDeviceCreateInfo info;
info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
info.pNext = nullptr;
info.pNext = enabledFeatures.core.pNext;
info.flags = 0;
info.queueCreateInfoCount = queueInfos.size();
info.pQueueCreateInfos = queueInfos.data();