Map AHARDWAREBUFFER_FORMAT_R8_UNORM to GL_R8

Bug: b/259551816
Test: cvd start --gpu_mode=guest_swiftshader
Test: atest librenderengine_test
Change-Id: I874278fe50dd1b501c11c484c55ed91e67a7013b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4034130
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Jason Macnak 2022-11-17 09:52:36 -08:00 коммит произвёл Angle LUCI CQ
Родитель 7e7a47dffc
Коммит dcf3ab1228
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -192,6 +192,15 @@ enum {
#endif // ANGLE_AHARDWARE_BUFFER_SUPPORT
#if !defined(ANGLE_AHARDWARE_BUFFER_SUPPORT) || __ANDROID_API__ < 33
/**
* Corresponding formats:
* Vulkan: VK_FORMAT_R8_UNORM
* OpenGL ES: GR_GL_R8
*/
AHARDWAREBUFFER_FORMAT_R8_UNORM = 0x38,
#endif
AHARDWAREBUFFER_FORMAT_YV12 = 0x32315659,
AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED = 0x22,
};
@ -257,6 +266,8 @@ GLenum GetPixelFormatInfo(int pixelFormat, bool *isYUV)
return GL_DEPTH32F_STENCIL8;
case AHARDWAREBUFFER_FORMAT_S8_UINT:
return GL_STENCIL_INDEX8;
case AHARDWAREBUFFER_FORMAT_R8_UNORM:
return GL_R8;
case AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420:
case AHARDWAREBUFFER_FORMAT_YV12:
case AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED:
@ -358,6 +369,8 @@ int GLInternalFormatToNativePixelFormat(GLenum internalFormat)
{
switch (internalFormat)
{
case GL_R8:
return AHARDWAREBUFFER_FORMAT_R8_UNORM;
case GL_RGBA8:
return AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
case GL_RGB8: