1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-04-03 07:25:18 +02:00

[dxvk] Remove fallback path in queryImageSubresourceLayout

This commit is contained in:
Philip Rebohle 2025-03-23 22:11:56 +01:00
parent 6a008513f7
commit 29bdbd7416

View File

@ -70,7 +70,6 @@ namespace dxvk {
info.pNext = &formatList; info.pNext = &formatList;
} }
if (m_features.khrMaintenance5.maintenance5) {
VkImageSubresource2KHR subresourceInfo = { VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR }; VkImageSubresource2KHR subresourceInfo = { VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR };
subresourceInfo.imageSubresource = subresource; subresourceInfo.imageSubresource = subresource;
@ -81,22 +80,6 @@ namespace dxvk {
VkSubresourceLayout2KHR layout = { VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR }; VkSubresourceLayout2KHR layout = { VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR };
m_vkd->vkGetDeviceImageSubresourceLayoutKHR(m_vkd->device(), &query, &layout); m_vkd->vkGetDeviceImageSubresourceLayoutKHR(m_vkd->device(), &query, &layout);
return layout.subresourceLayout; return layout.subresourceLayout;
} else {
// Technically, there is no guarantee that all images with the same
// properties are going to have consistent subresource layouts if
// maintenance5 is not supported, but the only such use case we care
// about is RenderDoc.
VkImage image = VK_NULL_HANDLE;
VkResult vr = m_vkd->vkCreateImage(m_vkd->device(), &info, nullptr, &image);
if (vr != VK_SUCCESS)
throw DxvkError(str::format("Failed to create temporary image: ", vr));
VkSubresourceLayout layout = { };
m_vkd->vkGetImageSubresourceLayout(m_vkd->device(), image, &subresource, &layout);
m_vkd->vkDestroyImage(m_vkd->device(), image, nullptr);
return layout;
}
} }