mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +00:00
Add AHardwareBuffer support
Initial pass at adding AHardwareBufferSupport so that Dawn can display content on Android. Confirmed that this will allow many WebGPU pages to render when paired with https://chromium-review.googlesource.com/c/chromium/src/+/3877262 Bug: dawn:286 Change-Id: I627fa2ab71f85bd3cb7ea21b0588dbd2089cdf5f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101460 Commit-Queue: Brandon Jones <bajones@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
0d7cd27fd3
commit
7edef20bdd
@@ -229,6 +229,7 @@ enum ExternalImageType {
|
||||
IOSurface,
|
||||
DXGISharedHandle,
|
||||
EGLImage,
|
||||
AHardwareBuffer,
|
||||
};
|
||||
|
||||
// Common properties of external images
|
||||
|
||||
@@ -126,6 +126,26 @@ struct DAWN_NATIVE_EXPORT ExternalImageExportInfoDmaBuf : ExternalImageExportInf
|
||||
ExternalImageExportInfoDmaBuf();
|
||||
};
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
||||
// Descriptor for AHardwareBuffer image import
|
||||
struct DAWN_NATIVE_EXPORT ExternalImageDescriptorAHardwareBuffer : ExternalImageDescriptorVk {
|
||||
public:
|
||||
ExternalImageDescriptorAHardwareBuffer();
|
||||
|
||||
struct AHardwareBuffer* handle; // The AHardwareBuffer which contains the memory of the image
|
||||
std::vector<int> waitFDs; // File descriptors of semaphores which will be waited on
|
||||
|
||||
protected:
|
||||
using ExternalImageDescriptorVk::ExternalImageDescriptorVk;
|
||||
};
|
||||
|
||||
struct DAWN_NATIVE_EXPORT ExternalImageExportInfoAHardwareBuffer : ExternalImageExportInfoFD {
|
||||
ExternalImageExportInfoAHardwareBuffer();
|
||||
};
|
||||
|
||||
#endif // __ANDROID__
|
||||
|
||||
#endif // __linux__
|
||||
|
||||
// Imports external memory into a Vulkan image. Internally, this uses external memory /
|
||||
|
||||
Reference in New Issue
Block a user