Commit Graph

6 Commits

Author SHA1 Message Date
Emmanuele Bassi
bfcd062e8e Use GLSL 3.30 shaders
We currently ask for anything above 3.2 GL contexts, but we're still
using GLSL 1.50 shaders all over the place. If a GL driver supports GL
3.2+ and GLSL 1.50 only then we'd be in trouble, but the chances of that
happening are really small.
2019-03-27 16:03:43 +00:00
Juan Pablo Ugarte
5fa8def9df Use GLSL version 110 for OpenGL 2 shaders.
According to docs and Intel legacy drivers,
GLSL version 130 is for GL 3.0 not GL 2.0/2.1

Validated files with reference compiler from
https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/
2016-11-01 11:58:16 -03:00
Emmanuele Bassi
f848450a70 gl: Use a uniform to flip R and B colors on GLES
This allows us to decide when the R and B color channels should be
flipped with a much better granularity.

For instance, when using GLX_EXT_texture_from_pixmap to create a GL
texture from a surface we don't need to swap the R and B channels, as
the internal representation of the texture data will already have the
appropriate colors.

We also don't need to flip color channels when blitting from a texture.
2016-04-25 14:33:36 +01:00
Emmanuele Bassi
fe25ba3c5f gl: Tweak the swizzle for GLES texture fragments
Cairo surfaces are in BGRA format, but we upload them as RGBA buffers on
GLES; this means that the R and B channels are flipped in the texture
data.

Instead of doing a costly channel flip before putting them on the GPU,
we can flip the values inside the GLSL shader we use specifically for
GLES.
2016-04-25 12:29:37 +01:00
Emmanuele Bassi
8bb4eb5544 gdk: Add GLES shaders
We cannot use GL shaders with GLES.
2016-04-25 12:29:36 +01:00
Emmanuele Bassi
55537cccbd gdk: Move GLSL shaders into GResource
Having the shaders inlined as C strings makes them harder to edit and
maintain.
2016-04-25 12:29:36 +01:00