aboutsummaryrefslogtreecommitdiff
path: root/render/gles2/pixel_format.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-29 23:24:09 +0100
committeremersion <contact@emersion.fr>2018-01-29 23:24:09 +0100
commit51c22d39a4a1a3c4ecfe39ee3df90ba7e66633af (patch)
treeb9fd9fd6fddc8a869f3500bf92944b47c01c578c /render/gles2/pixel_format.c
parent2cc989e09716eed5974dc9a76b7b6dbee9c3d730 (diff)
parented5b1fdedd775a7acec3d6814cc2ac007e34fd29 (diff)
Merge remote-tracking branch 'upstream/master' into output-damage
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