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

[d3d11] Report D3D11_FORMAT_SUPPORT2_SHAREABLE appropriately

This commit is contained in:
Philip Rebohle 2022-09-11 15:41:47 +02:00
parent 299fc4c4cf
commit 8dc9400045

View File

@ -2147,6 +2147,20 @@ namespace dxvk {
| D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE
| D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD;
}
// Query whether the format is shareable
if ((fmtProperties->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_PLANE_0_BIT))
&& (m_dxvkDevice->features().khrExternalMemoryWin32)) {
constexpr VkExternalMemoryFeatureFlags featureMask
= VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT
| VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT;
formatQuery.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
limits = m_dxvkDevice->getFormatLimits(formatQuery);
if (limits && (limits->externalFeatures & featureMask))
flags2 |= D3D11_FORMAT_SUPPORT2_SHAREABLE;
}
}
// Format can be used for storage images or storage texel buffers