mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
lavapipe: implement GetMemoryAndroidHardwareBufferANDROID
lvp hasn't used common device memory obj, and it allocates and imports
ahb on its own. Thus it has to implement the AHB export api itself.
- before: total 116, skip 66, pass 24, fail 26
- after: total 116, skip 66, pass 36, fail 14
Fixes: cebb2bf266 ("lavapipe: Add AHB extension")
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36204>
This commit is contained in:
parent
3167e30ee2
commit
f1af533b2c
1 changed files with 20 additions and 0 deletions
|
|
@ -155,3 +155,23 @@ lvp_create_ahb_memory(struct lvp_device *device, struct lvp_device_memory *mem,
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
#if ANDROID_API_LEVEL >= 26
|
||||
VkResult
|
||||
lvp_GetMemoryAndroidHardwareBufferANDROID(
|
||||
VkDevice device,
|
||||
const VkMemoryGetAndroidHardwareBufferInfoANDROID *pInfo,
|
||||
struct AHardwareBuffer **pBuffer)
|
||||
{
|
||||
LVP_FROM_HANDLE(lvp_device_memory, mem, pInfo->memory);
|
||||
|
||||
if (mem->android_hardware_buffer) {
|
||||
*pBuffer = mem->android_hardware_buffer;
|
||||
/* Increase refcount. */
|
||||
AHardwareBuffer_acquire(*pBuffer);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
return VK_ERROR_INVALID_EXTERNAL_HANDLE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue