mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
Explicit vkImage create to wrap video frame
This uses VkImageDrmFormatModifierExplicitCreateInfoEXT instead of VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT to import mulit-planar external images. More discussions about this change can be found at this Mesa issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6530 Bug: chromium:1258986 Change-Id: Ifde3d89e7ddf37d6a295c9d7fcc7c762f8da1e81 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91940 Reviewed-by: Jie A Chen <jie.a.chen@intel.com> Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Loko Kung <lokokung@google.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
#include "dawn/dawn_wsi.h"
|
||||
@@ -92,11 +93,20 @@ struct DAWN_NATIVE_EXPORT ExternalImageDescriptorOpaqueFD : ExternalImageDescrip
|
||||
uint32_t memoryTypeIndex; // Must match VkMemoryAllocateInfo from image creation
|
||||
};
|
||||
|
||||
// The plane-wise offset and stride.
|
||||
struct DAWN_NATIVE_EXPORT PlaneLayout {
|
||||
uint64_t offset;
|
||||
uint32_t stride;
|
||||
};
|
||||
|
||||
// Descriptor for dma-buf file descriptor image import
|
||||
struct DAWN_NATIVE_EXPORT ExternalImageDescriptorDmaBuf : ExternalImageDescriptorFD {
|
||||
ExternalImageDescriptorDmaBuf();
|
||||
// To be removed after chromium's switch to planeLayouts.
|
||||
uint32_t stride = 0u; // Stride of the buffer in bytes
|
||||
|
||||
uint32_t stride; // Stride of the buffer in bytes
|
||||
static constexpr uint32_t kMaxPlanes = 3;
|
||||
std::array<PlaneLayout, kMaxPlanes> planeLayouts;
|
||||
uint64_t drmModifier; // DRM modifier of the buffer
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user