mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 02:04:41 +08:00
vulkan/android: Add missing AHB formats
Signed-off-by: dawnhan <dawnhan@google.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30310>
This commit is contained in:
parent
ceece45b2b
commit
6df5ace3a3
@ -158,6 +158,13 @@ enum AHardwareBuffer_Format {
|
||||
* cube-maps or multi-layered textures.
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 = 0x23,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_R8_UNORM
|
||||
* OpenGL ES: GR_GL_R8
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_R8_UNORM = 0x38,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -403,6 +403,10 @@ vk_ahb_format_to_image_format(uint32_t ahb_format)
|
||||
return VK_FORMAT_D32_SFLOAT_S8_UINT;
|
||||
case AHARDWAREBUFFER_FORMAT_S8_UINT:
|
||||
return VK_FORMAT_S8_UINT;
|
||||
#if ANDROID_API_LEVEL >= 33
|
||||
case AHARDWAREBUFFER_FORMAT_R8_UNORM:
|
||||
return VK_FORMAT_R8_UNORM;
|
||||
#endif
|
||||
default:
|
||||
return VK_FORMAT_UNDEFINED;
|
||||
}
|
||||
@ -440,6 +444,10 @@ vk_image_format_to_ahb_format(VkFormat vk_format)
|
||||
return AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT;
|
||||
case VK_FORMAT_S8_UINT:
|
||||
return AHARDWAREBUFFER_FORMAT_S8_UINT;
|
||||
#if ANDROID_API_LEVEL >= 33
|
||||
case VK_FORMAT_R8_UNORM:
|
||||
return AHARDWAREBUFFER_FORMAT_R8_UNORM;
|
||||
#endif
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user