mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
panvk: fill in VkExternalBufferProperties
Opaque fds are internally dma-bufs. We also support both export and
import.
Fixes: 17b81d1fdc ("panvk: expose KHR_external_memory and KHR_external_memory_capabilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31649>
This commit is contained in:
parent
50a9d1b987
commit
75f833ca82
1 changed files with 23 additions and 1 deletions
|
|
@ -1477,5 +1477,27 @@ panvk_GetPhysicalDeviceExternalBufferProperties(
|
||||||
const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo,
|
const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo,
|
||||||
VkExternalBufferProperties *pExternalBufferProperties)
|
VkExternalBufferProperties *pExternalBufferProperties)
|
||||||
{
|
{
|
||||||
panvk_stub();
|
const VkExternalMemoryHandleTypeFlags supported_handle_types =
|
||||||
|
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT |
|
||||||
|
VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
|
||||||
|
|
||||||
|
/* From the Vulkan 1.3.298 spec:
|
||||||
|
*
|
||||||
|
* compatibleHandleTypes must include at least handleType.
|
||||||
|
*/
|
||||||
|
VkExternalMemoryHandleTypeFlags handle_types =
|
||||||
|
pExternalBufferInfo->handleType;
|
||||||
|
VkExternalMemoryFeatureFlags features = 0;
|
||||||
|
if (pExternalBufferInfo->handleType & supported_handle_types) {
|
||||||
|
handle_types |= supported_handle_types;
|
||||||
|
features |= VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT |
|
||||||
|
VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
pExternalBufferProperties->externalMemoryProperties =
|
||||||
|
(VkExternalMemoryProperties){
|
||||||
|
.externalMemoryFeatures = features,
|
||||||
|
.exportFromImportedHandleTypes = handle_types,
|
||||||
|
.compatibleHandleTypes = handle_types,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue