From 1f42f6bd1e3287977696eafd45595c0b722d2970 Mon Sep 17 00:00:00 2001 From: Maksim Sisov Date: Wed, 3 Nov 2021 13:28:01 +0200 Subject: [PATCH] Add GL_RGB10_EXT format into list of supported formats. When running with Wayland, EGL returns rgb10 buffer format in egl config, which makes assertion to explode in formatutils as this format is not in list of supported formats. GL_RGB10_EXT is under the ES1 extension GL_OES_required_internalformat. Thus, add it to the format table. Bug: chromium:1231934 Change-Id: Ib47af538b16d6c7a652a44e0674757d292ac1394 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3253376 Reviewed-by: Geoff Lang Reviewed-by: Shahbaz Youssefi Commit-Queue: Maksim Sisov --- src/libANGLE/formatutils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libANGLE/formatutils.cpp b/src/libANGLE/formatutils.cpp index 6e7ca7a8e..697e0c323 100644 --- a/src/libANGLE/formatutils.cpp +++ b/src/libANGLE/formatutils.cpp @@ -1376,6 +1376,13 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() // | Internal format | sized | Cr | Y | Cb | A | S | Format | Type | Comp | SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | Blend AddYUVFormat(&map, GL_G8_B8R8_2PLANE_420_UNORM_ANGLE, true, 8, 8, 8, 0, 0, GL_G8_B8R8_2PLANE_420_UNORM_ANGLE, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, NeverSupported, NeverSupported); AddYUVFormat(&map, GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE, true, 8, 8, 8, 0, 0, GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, RequireExt<&Extensions::yuvInternalFormatANGLE>, NeverSupported, NeverSupported); + +#if defined(ANGLE_PLATFORM_LINUX) + // From GL_OES_required_internalformat + // The |shared| bit shouldn't be 2. But given this hits assertion when bits + // are checked, it's fine to have this bit set as 2 as a workaround. + AddRGBAFormat(&map, GL_RGB10_EXT, true, 10, 10, 10, 0, 2, GL_RGB, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_NORMALIZED, false, RequireES<1, 0>, NeverSupported, RequireES<1, 0>, RequireES<1, 0>, NeverSupported); +#endif // clang-format on return map;