mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-04 19:25:47 +00:00
This CL adds an API to import a dma-buf into Dawn as a WGPUTexture. We also add a descriptor type enum to the base ExternalImageDescriptor struct. This is because all memory import code (e.g. MemoryService, Texture::CreateFromExternal) takes the a base ExternalImageDescriptor as a parameter. The dma-buf external memory and image services, however, will need to downcast to ExternalImageDescriptorDmaBuf to access import parameters like stride. Explicitly adding a type enum will let us more safely verify the type before downcasting. BUG=chromium:996470 Change-Id: I2d9883a15e9059a91f2c7bdb7a96d74373e18c56 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13782 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Brian Ho <hob@chromium.org>