weston/libweston/renderer-gl
Pekka Paalanen 477bdc85c9 gl-renderer: rewrite fragment shaders
The main goal of this patch is to improve the readability of how and
what fragment shaders are generated.

Instead of having C code that assembles each shader variant from literal
string snippets, create one big fragment shader source that has
everything in it. This relies on a GLSL compiler to optimize statically
false conditions and unused uniforms away.

Having all the fragment shader code in one file, uncluttered by C string
literal syntax, improves readability significantly. A disadvantage is
that the code is more verbose, but it allows comments much better.

The actual shader code is kept unchanged except:
- FRAGMENT_CONVERT_YUV macro is now a proper function
- GLSL version is explicitly set to 1.00 ES
- RGBA and EXTERNAL use the same path, the difference is how the sampler
  is declared

Further shader code consolidation is possible, but is left for another
time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
..
egl-glue.c gl-renderer: Move EGL display creation to egl-glue.c 2020-02-18 18:11:26 +13:00
fragment.glsl gl-renderer: rewrite fragment shaders 2021-02-25 13:16:02 +02:00
gl-renderer-internal.h gl-renderer: split into gl-shaders.c 2021-02-25 13:16:02 +02:00
gl-renderer.c gl-renderer: split into gl-shaders.c 2021-02-25 13:16:02 +02:00
gl-renderer.h gl-renderer: Replace pbuffer-create args with struct 2020-03-20 15:25:24 +00:00
gl-shaders.c gl-renderer: rewrite fragment shaders 2021-02-25 13:16:02 +02:00
meson.build gl-renderer: rewrite fragment shaders 2021-02-25 13:16:02 +02:00
vertex.glsl gl-renderer: move vertex shader into new file 2021-02-25 13:16:02 +02:00