mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 23:30:10 +01:00
vulkan: Add an ahardware_buffer_format field to vk_image
Reviewed-by: Lina Versace <lina@kiwitree.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
This commit is contained in:
parent
dc0749adab
commit
906944b210
2 changed files with 14 additions and 2 deletions
|
|
@ -23,8 +23,6 @@
|
|||
|
||||
#include "vk_image.h"
|
||||
|
||||
#include <vulkan/vulkan_android.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <drm-uapi/drm_fourcc.h>
|
||||
#endif
|
||||
|
|
@ -40,6 +38,11 @@
|
|||
#include "vk_util.h"
|
||||
#include "vulkan/wsi/wsi_common.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#include "vk_android.h"
|
||||
#include <vulkan/vulkan_android.h>
|
||||
#endif
|
||||
|
||||
void
|
||||
vk_image_init(struct vk_device *device,
|
||||
struct vk_image *image,
|
||||
|
|
@ -97,6 +100,8 @@ vk_image_init(struct vk_device *device,
|
|||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
image->ahardware_buffer_format = 0;
|
||||
|
||||
const VkExternalFormatANDROID *ext_format =
|
||||
vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID);
|
||||
if (ext_format && ext_format->externalFormat != 0) {
|
||||
|
|
|
|||
|
|
@ -70,6 +70,13 @@ struct vk_image {
|
|||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
/* AHARDWAREBUFFER_FORMAT for this image or 0
|
||||
*
|
||||
* A default is provided by the Vulkan runtime code based on the VkFormat
|
||||
* but it may be overridden by the driver as needed.
|
||||
*/
|
||||
unsigned ahardware_buffer_format;
|
||||
|
||||
/* VK_ANDROID_external_memory_android_hardware_buffer */
|
||||
uint64_t android_external_format;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue