From 12ce06f39b2194685ddeadf656ebf2d334836992 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 14 Jun 2024 19:10:12 +0200 Subject: [PATCH] format: fix flipped r/b channels on legacy_renderer We don't wanna use an extension, but for gles2 there is no other option. fixes #6465 --- src/helpers/Format.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/helpers/Format.cpp b/src/helpers/Format.cpp index 9c94f68b..65828519 100644 --- a/src/helpers/Format.cpp +++ b/src/helpers/Format.cpp @@ -11,9 +11,13 @@ */ inline const std::vector GLES3_FORMATS = { { - .drmFormat = DRM_FORMAT_ARGB8888, - .flipRB = true, - .glFormat = GL_RGBA, + .drmFormat = DRM_FORMAT_ARGB8888, + .flipRB = true, +#ifndef GLES2 + .glFormat = GL_RGBA, +#else + .glFormat = GL_BGRA_EXT, +#endif .glType = GL_UNSIGNED_BYTE, .withAlpha = true, .alphaStripped = DRM_FORMAT_XRGB8888, @@ -22,7 +26,11 @@ inline const std::vector GLES3_FORMATS = { { .drmFormat = DRM_FORMAT_XRGB8888, .flipRB = true, - .glFormat = GL_RGBA, +#ifndef GLES2 + .glFormat = GL_RGBA, +#else + .glFormat = GL_BGRA_EXT, +#endif .glType = GL_UNSIGNED_BYTE, .withAlpha = false, .alphaStripped = DRM_FORMAT_XRGB8888,