aboutsummaryrefslogtreecommitdiff
path: root/render/gles2/pixel_format.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/gles2/pixel_format.c')
-rw-r--r--render/gles2/pixel_format.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c
index a0b9d09f..a544077b 100644
--- a/render/gles2/pixel_format.c
+++ b/render/gles2/pixel_format.c
@@ -2,7 +2,10 @@
#include <GLES2/gl2ext.h>
#include "render/gles2.h"
-// Adapted from weston
+/*
+* The wayland formats are little endian while the GL formats are big endian,
+* so WL_SHM_FORMAT_ARGB8888 is actually compatible with GL_BGRA_EXT.
+*/
struct pixel_format formats[] = {
{
.wl_format = WL_SHM_FORMAT_ARGB8888,
@@ -22,12 +25,16 @@ struct pixel_format formats[] = {
},
{
.wl_format = WL_SHM_FORMAT_XBGR8888,
+ .depth = 24,
+ .bpp = 32,
.gl_format = GL_RGBA,
.gl_type = GL_UNSIGNED_BYTE,
.shader = &shaders.rgbx
},
{
.wl_format = WL_SHM_FORMAT_ABGR8888,
+ .depth = 32,
+ .bpp = 32,
.gl_format = GL_RGBA,
.gl_type = GL_UNSIGNED_BYTE,
.shader = &shaders.rgba