anv: avoid setting image format twice for AHB image
AHB images are created with the right VkFormat when external format isn't used. When external format does get used, the proper VkFormat has already being set in the common runtime. Upon AHB props query, we resolve external format to VkFormat and set to the externalFormat field to be used by the app. The app would than chain the exact external format when creating the AHB image if it wants to go down the external format code path instead of being explicit. So in the end, the format we resolve is the format we get. Thus no need to set it twice. Reviewed-by: Lucas Fryzek <lfryzek@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36866>
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
#if ANDROID_API_LEVEL >= 26
|
||||
#include <vndk/hardware_buffer.h>
|
||||
|
||||
inline VkFormat
|
||||
static inline VkFormat
|
||||
vk_format_from_android(unsigned android_format, unsigned android_usage)
|
||||
{
|
||||
switch (android_format) {
|
||||
|
||||
@@ -2240,14 +2240,9 @@ resolve_ahw_image(struct anv_device *device,
|
||||
assert(result == VK_SUCCESS);
|
||||
isl_tiling_flags_t isl_tiling_flags = (1u << tiling);
|
||||
|
||||
/* Check format. */
|
||||
VkFormat vk_format = vk_format_from_android(desc.format, desc.usage);
|
||||
assert(vk_format != VK_FORMAT_UNDEFINED);
|
||||
|
||||
/* Now we are able to fill anv_image fields properly and create
|
||||
* isl_surface for it.
|
||||
*/
|
||||
vk_image_set_format(&image->vk, vk_format);
|
||||
image->n_planes = anv_get_format_planes(device->physical, image->vk.format);
|
||||
|
||||
result = add_all_surfaces_implicit_layout(device, image, NULL, desc.stride,
|
||||
|
||||
@@ -5611,9 +5611,6 @@ bool anv_formats_ccs_e_compatible(const struct anv_physical_device *device,
|
||||
VkImageUsageFlags vk_usage,
|
||||
const VkImageFormatListCreateInfo *fmt_list);
|
||||
|
||||
extern VkFormat
|
||||
vk_format_from_android(unsigned android_format, unsigned android_usage);
|
||||
|
||||
static inline VkFormat
|
||||
anv_get_compressed_format_emulation(const struct anv_physical_device *pdevice,
|
||||
VkFormat format)
|
||||
|
||||
Reference in New Issue
Block a user