diff --git a/.pick_status.json b/.pick_status.json index b4c1af84013..d115927640f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2384,7 +2384,7 @@ "description": "lavapipe: implement GetMemoryAndroidHardwareBufferANDROID", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "cebb2bf26623e31aa1fbab0e73c7e2a1e3cfe956", "notes": null diff --git a/src/gallium/frontends/lavapipe/lvp_android.c b/src/gallium/frontends/lavapipe/lvp_android.c index 3b7898ee1e9..e6e7d708a87 100644 --- a/src/gallium/frontends/lavapipe/lvp_android.c +++ b/src/gallium/frontends/lavapipe/lvp_android.c @@ -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