mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
anv/android: fix images created with external format support
This fixes a case where user first creates image and then later binds it
with memory created from AHW buffer.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit e4a826b2c8)
This commit is contained in:
parent
9052318565
commit
06b8b29a0a
1 changed files with 12 additions and 0 deletions
|
|
@ -735,6 +735,17 @@ anv_CreateImage(VkDevice device,
|
|||
return anv_image_from_external(device, pCreateInfo, create_info,
|
||||
pAllocator, pImage);
|
||||
|
||||
bool use_external_format = false;
|
||||
const struct VkExternalFormatANDROID *ext_format =
|
||||
vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID);
|
||||
|
||||
/* "If externalFormat is zero, the effect is as if the
|
||||
* VkExternalFormatANDROID structure was not present. Otherwise, the image
|
||||
* will have the specified external format."
|
||||
*/
|
||||
if (ext_format && ext_format->externalFormat != 0)
|
||||
use_external_format = true;
|
||||
|
||||
const VkNativeBufferANDROID *gralloc_info =
|
||||
vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID);
|
||||
if (gralloc_info)
|
||||
|
|
@ -750,6 +761,7 @@ anv_CreateImage(VkDevice device,
|
|||
return anv_image_create(device,
|
||||
&(struct anv_image_create_info) {
|
||||
.vk_info = pCreateInfo,
|
||||
.external_format = use_external_format,
|
||||
},
|
||||
pAllocator,
|
||||
pImage);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue