mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[dxvk] Enable VK_KHR_maintenance5 if available.
This commit is contained in:
parent
fb71c08d8c
commit
aa41a7a351
@ -398,6 +398,10 @@ namespace dxvk {
|
||||
m_deviceFeatures.extSwapchainMaintenance1.swapchainMaintenance1 &&
|
||||
instance->extensions().extSurfaceMaintenance1;
|
||||
|
||||
// Enable maintenance5 if supported
|
||||
enabledFeatures.khrMaintenance5.maintenance5 =
|
||||
m_deviceFeatures.khrMaintenance5.maintenance5;
|
||||
|
||||
// Enable present id and present wait together, if possible
|
||||
enabledFeatures.khrPresentId.presentId =
|
||||
m_deviceFeatures.khrPresentId.presentId;
|
||||
@ -590,6 +594,10 @@ namespace dxvk {
|
||||
enabledFeatures.extVertexAttributeDivisor = *reinterpret_cast<const VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*>(f);
|
||||
break;
|
||||
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR:
|
||||
enabledFeatures.khrMaintenance5 = *reinterpret_cast<const VkPhysicalDeviceMaintenance5FeaturesKHR*>(f);
|
||||
break;
|
||||
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR:
|
||||
enabledFeatures.khrPresentId = *reinterpret_cast<const VkPhysicalDevicePresentIdFeaturesKHR*>(f);
|
||||
break;
|
||||
@ -760,6 +768,11 @@ namespace dxvk {
|
||||
m_deviceInfo.extVertexAttributeDivisor.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.extVertexAttributeDivisor);
|
||||
}
|
||||
|
||||
if (m_deviceExtensions.supports(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) {
|
||||
m_deviceInfo.khrMaintenance5.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR;
|
||||
m_deviceInfo.khrMaintenance5.pNext = std::exchange(m_deviceInfo.core.pNext, &m_deviceInfo.khrMaintenance5);
|
||||
}
|
||||
|
||||
// Query full device properties for all enabled extensions
|
||||
m_vki->vkGetPhysicalDeviceProperties2(m_handle, &m_deviceInfo.core);
|
||||
|
||||
@ -899,6 +912,11 @@ namespace dxvk {
|
||||
if (m_deviceExtensions.supports(VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME))
|
||||
m_deviceFeatures.khrExternalSemaphoreWin32 = VK_TRUE;
|
||||
|
||||
if (m_deviceExtensions.supports(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) {
|
||||
m_deviceFeatures.khrMaintenance5.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR;
|
||||
m_deviceFeatures.khrMaintenance5.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.khrMaintenance5);
|
||||
}
|
||||
|
||||
if (m_deviceExtensions.supports(VK_KHR_PRESENT_ID_EXTENSION_NAME)) {
|
||||
m_deviceFeatures.khrPresentId.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR;
|
||||
m_deviceFeatures.khrPresentId.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.khrPresentId);
|
||||
@ -970,11 +988,12 @@ namespace dxvk {
|
||||
&devExtensions.extVertexAttributeDivisor,
|
||||
&devExtensions.khrExternalMemoryWin32,
|
||||
&devExtensions.khrExternalSemaphoreWin32,
|
||||
&devExtensions.khrWin32KeyedMutex,
|
||||
&devExtensions.khrMaintenance5,
|
||||
&devExtensions.khrPipelineLibrary,
|
||||
&devExtensions.khrPresentId,
|
||||
&devExtensions.khrPresentWait,
|
||||
&devExtensions.khrSwapchain,
|
||||
&devExtensions.khrWin32KeyedMutex,
|
||||
&devExtensions.nvxBinaryImport,
|
||||
&devExtensions.nvxImageViewHandle,
|
||||
}};
|
||||
@ -1099,8 +1118,10 @@ namespace dxvk {
|
||||
if (devExtensions.khrExternalSemaphoreWin32)
|
||||
enabledFeatures.khrExternalSemaphoreWin32 = VK_TRUE;
|
||||
|
||||
if (devExtensions.nvxBinaryImport)
|
||||
enabledFeatures.nvxBinaryImport = VK_TRUE;
|
||||
if (devExtensions.khrMaintenance5) {
|
||||
enabledFeatures.khrMaintenance5.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR;
|
||||
enabledFeatures.khrMaintenance5.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.khrMaintenance5);
|
||||
}
|
||||
|
||||
if (devExtensions.khrPresentId) {
|
||||
enabledFeatures.khrPresentId.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR;
|
||||
@ -1112,6 +1133,9 @@ namespace dxvk {
|
||||
enabledFeatures.khrPresentWait.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.khrPresentWait);
|
||||
}
|
||||
|
||||
if (devExtensions.nvxBinaryImport)
|
||||
enabledFeatures.nvxBinaryImport = VK_TRUE;
|
||||
|
||||
if (devExtensions.nvxImageViewHandle)
|
||||
enabledFeatures.nvxImageViewHandle = VK_TRUE;
|
||||
|
||||
@ -1249,6 +1273,8 @@ namespace dxvk {
|
||||
"\n extension supported : ", features.khrExternalMemoryWin32 ? "1" : "0",
|
||||
"\n", VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME,
|
||||
"\n extension supported : ", features.khrExternalSemaphoreWin32 ? "1" : "0",
|
||||
"\n", VK_KHR_MAINTENANCE_5_EXTENSION_NAME,
|
||||
"\n maintenance5 : ", features.khrMaintenance5.maintenance5 ? "1" : "0",
|
||||
"\n", VK_KHR_PRESENT_ID_EXTENSION_NAME,
|
||||
"\n presentId : ", features.khrPresentId.presentId ? "1" : "0",
|
||||
"\n", VK_KHR_PRESENT_WAIT_EXTENSION_NAME,
|
||||
|
@ -25,6 +25,7 @@ namespace dxvk {
|
||||
VkPhysicalDeviceRobustness2PropertiesEXT extRobustness2;
|
||||
VkPhysicalDeviceTransformFeedbackPropertiesEXT extTransformFeedback;
|
||||
VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT extVertexAttributeDivisor;
|
||||
VkPhysicalDeviceMaintenance5PropertiesKHR khrMaintenance5;
|
||||
};
|
||||
|
||||
|
||||
@ -64,6 +65,7 @@ namespace dxvk {
|
||||
VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT extVertexAttributeDivisor;
|
||||
VkBool32 khrExternalMemoryWin32;
|
||||
VkBool32 khrExternalSemaphoreWin32;
|
||||
VkPhysicalDeviceMaintenance5FeaturesKHR khrMaintenance5;
|
||||
VkPhysicalDevicePresentIdFeaturesKHR khrPresentId;
|
||||
VkPhysicalDevicePresentWaitFeaturesKHR khrPresentWait;
|
||||
VkBool32 nvxBinaryImport;
|
||||
|
@ -319,11 +319,12 @@ namespace dxvk {
|
||||
DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt khrExternalMemoryWin32 = { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt khrExternalSemaphoreWin32 = { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt khrWin32KeyedMutex = { VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt khrMaintenance5 = { VK_KHR_MAINTENANCE_5_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt khrPipelineLibrary = { VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt khrPresentId = { VK_KHR_PRESENT_ID_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt khrPresentWait = { VK_KHR_PRESENT_WAIT_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt khrSwapchain = { VK_KHR_SWAPCHAIN_EXTENSION_NAME, DxvkExtMode::Required };
|
||||
DxvkExt khrWin32KeyedMutex = { VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt nvxBinaryImport = { VK_NVX_BINARY_IMPORT_EXTENSION_NAME, DxvkExtMode::Disabled };
|
||||
DxvkExt nvxImageViewHandle = { VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME, DxvkExtMode::Disabled };
|
||||
};
|
||||
|
@ -436,7 +436,14 @@ namespace dxvk::vk {
|
||||
VULKAN_FN(vkImportSemaphoreWin32HandleKHR);
|
||||
#endif
|
||||
|
||||
#ifdef VK_KHR_PRESENT_WAIT_EXTENSION_NAME
|
||||
#ifdef VK_KHR_maintenance5
|
||||
VULKAN_FN(vkCmdBindIndexBuffer2KHR);
|
||||
VULKAN_FN(vkGetRenderingAreaGranularityKHR);
|
||||
VULKAN_FN(vkGetDeviceImageSubresourceLayoutKHR);
|
||||
VULKAN_FN(vkGetImageSubresourceLayout2KHR);
|
||||
#endif
|
||||
|
||||
#ifdef VK_KHR_present_wait
|
||||
VULKAN_FN(vkWaitForPresentKHR);
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user