mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-01 09:08:00 +02:00
glamor: make use of GL_EXT_texture_format_BGRA8888
For 24 and 32 bit depth pictures xserver uses PICT_x8r8g8b8 and PICT_a8r8g8b8 formats,
which must be backed with GL_BGRA format. It is present in OpenGL ES 2.0 only with
GL_EXT_texture_format_BGRA8888 extension. We require such extension in glamor_init,
so, why not to make use of it?
Fixes #1208
Fixes #1354
Signed-off-by: Konstantin Pugin <ria.freelander@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
(cherry picked from commit 24cd5f34f8)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1546>
This commit is contained in:
parent
03bbf4b121
commit
408432fbd0
2 changed files with 6 additions and 9 deletions
|
|
@ -586,10 +586,10 @@ glamor_setup_formats(ScreenPtr screen)
|
|||
|
||||
if (glamor_priv->is_gles) {
|
||||
assert(X_BYTE_ORDER == X_LITTLE_ENDIAN);
|
||||
glamor_add_format(screen, 24, PICT_x8b8g8r8,
|
||||
GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, TRUE);
|
||||
glamor_add_format(screen, 32, PICT_a8b8g8r8,
|
||||
GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, TRUE);
|
||||
glamor_add_format(screen, 24, PICT_x8r8g8b8,
|
||||
GL_BGRA, GL_BGRA, GL_UNSIGNED_BYTE, TRUE);
|
||||
glamor_add_format(screen, 32, PICT_a8r8g8b8,
|
||||
GL_BGRA, GL_BGRA, GL_UNSIGNED_BYTE, TRUE);
|
||||
} else {
|
||||
glamor_add_format(screen, 24, PICT_x8r8g8b8,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, TRUE);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen,
|
|||
*tex_format = GL_BGRA;
|
||||
*tex_type = GL_UNSIGNED_INT_8_8_8_8;
|
||||
} else {
|
||||
*tex_format = GL_RGBA;
|
||||
*tex_format = GL_BGRA;
|
||||
*tex_type = GL_UNSIGNED_BYTE;
|
||||
|
||||
swizzle[0] = GL_GREEN;
|
||||
|
|
@ -113,12 +113,9 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen,
|
|||
*tex_format = GL_BGRA;
|
||||
*tex_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
} else {
|
||||
*tex_format = GL_RGBA;
|
||||
*tex_format = GL_BGRA;
|
||||
*tex_type = GL_UNSIGNED_BYTE;
|
||||
|
||||
swizzle[0] = GL_BLUE;
|
||||
swizzle[2] = GL_RED;
|
||||
|
||||
if (!is_little_endian)
|
||||
byte_swap_swizzle(swizzle);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue