diff --git a/src/dxvk/dxvk_adapter.cpp b/src/dxvk/dxvk_adapter.cpp index ee9a13f83ac..1ceda524915 100644 --- a/src/dxvk/dxvk_adapter.cpp +++ b/src/dxvk/dxvk_adapter.cpp @@ -265,7 +265,7 @@ namespace dxvk { DxvkDeviceFeatures enabledFeatures) { DxvkDeviceExtensions devExtensions; - std::array devExtensionList = {{ + std::array devExtensionList = {{ &devExtensions.amdMemoryOverallocationBehaviour, &devExtensions.amdShaderFragmentMask, &devExtensions.ext4444Formats, @@ -289,6 +289,7 @@ namespace dxvk { &devExtensions.khrDepthStencilResolve, &devExtensions.khrDrawIndirectCount, &devExtensions.khrDriverProperties, + &devExtensions.khrDynamicRendering, &devExtensions.khrExternalMemoryWin32, &devExtensions.khrImageFormatList, &devExtensions.khrSamplerMirrorClampToEdge, @@ -334,6 +335,8 @@ namespace dxvk { enabledFeatures.extRobustness2.nullDescriptor = VK_TRUE; + enabledFeatures.khrDynamicRendering.dynamicRendering = VK_TRUE; + Logger::info(str::format("Device properties:" "\n Device name: : ", m_deviceInfo.core.properties.deviceName, "\n Driver version : ", @@ -412,6 +415,11 @@ namespace dxvk { enabledFeatures.khrBufferDeviceAddress.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.khrBufferDeviceAddress); } + if (devExtensions.khrDynamicRendering) { + enabledFeatures.khrDynamicRendering.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR; + enabledFeatures.khrDynamicRendering.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.khrDynamicRendering); + } + // Report the desired overallocation behaviour to the driver VkDeviceMemoryOverallocationCreateInfoAMD overallocInfo; overallocInfo.sType = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD; @@ -722,6 +730,11 @@ namespace dxvk { m_deviceFeatures.khrBufferDeviceAddress.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.khrBufferDeviceAddress); } + if (m_deviceExtensions.supports(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME)) { + m_deviceFeatures.khrDynamicRendering.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR; + m_deviceFeatures.khrDynamicRendering.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.khrDynamicRendering); + } + m_vki->vkGetPhysicalDeviceFeatures2(m_handle, &m_deviceFeatures.core); } @@ -817,7 +830,9 @@ namespace dxvk { "\n vertexAttributeInstanceRateDivisor : ", features.extVertexAttributeDivisor.vertexAttributeInstanceRateDivisor ? "1" : "0", "\n vertexAttributeInstanceRateZeroDivisor : ", features.extVertexAttributeDivisor.vertexAttributeInstanceRateZeroDivisor ? "1" : "0", "\n", VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, - "\n bufferDeviceAddress : ", features.khrBufferDeviceAddress.bufferDeviceAddress)); + "\n bufferDeviceAddress : ", features.khrBufferDeviceAddress.bufferDeviceAddress ? "1" : "0", + "\n", VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME, + "\n dynamicRendering : ", features.khrDynamicRendering.dynamicRendering ? "1" : "0")); } diff --git a/src/dxvk/dxvk_device_info.h b/src/dxvk/dxvk_device_info.h index d3f9eb164c1..5f4ee91f232 100644 --- a/src/dxvk/dxvk_device_info.h +++ b/src/dxvk/dxvk_device_info.h @@ -49,6 +49,7 @@ namespace dxvk { VkPhysicalDeviceTransformFeedbackFeaturesEXT extTransformFeedback; VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT extVertexAttributeDivisor; VkPhysicalDeviceBufferDeviceAddressFeaturesKHR khrBufferDeviceAddress; + VkPhysicalDeviceDynamicRenderingFeaturesKHR khrDynamicRendering; }; } \ No newline at end of file diff --git a/src/dxvk/dxvk_extensions.h b/src/dxvk/dxvk_extensions.h index 7f2d8e349ff..b3596607b7c 100644 --- a/src/dxvk/dxvk_extensions.h +++ b/src/dxvk/dxvk_extensions.h @@ -296,9 +296,10 @@ namespace dxvk { DxvkExt extVertexAttributeDivisor = { VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt khrBufferDeviceAddress = { VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, DxvkExtMode::Disabled }; DxvkExt khrCreateRenderPass2 = { VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME, DxvkExtMode::Optional }; - DxvkExt khrDepthStencilResolve = { VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME, DxvkExtMode::Optional }; + DxvkExt khrDepthStencilResolve = { VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME, DxvkExtMode::Required }; DxvkExt khrDrawIndirectCount = { VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt khrDriverProperties = { VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, DxvkExtMode::Optional }; + DxvkExt khrDynamicRendering = { VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME, DxvkExtMode::Required }; DxvkExt khrExternalMemoryWin32 = { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt khrImageFormatList = { VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, DxvkExtMode::Required }; DxvkExt khrSamplerMirrorClampToEdge = { VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME, DxvkExtMode::Optional }; diff --git a/src/vulkan/vulkan_loader.h b/src/vulkan/vulkan_loader.h index 9ff7f14522e..ba5def69178 100644 --- a/src/vulkan/vulkan_loader.h +++ b/src/vulkan/vulkan_loader.h @@ -365,6 +365,11 @@ namespace dxvk::vk { VULKAN_FN(vkGetBufferDeviceAddressKHR); #endif + #ifdef VK_KHR_dynamic_rendering + VULKAN_FN(vkCmdBeginRenderingKHR); + VULKAN_FN(vkCmdEndRenderingKHR); + #endif + #ifdef VK_KHR_external_memory_win32 VULKAN_FN(vkGetMemoryWin32HandleKHR); VULKAN_FN(vkGetMemoryWin32HandlePropertiesKHR);