Commit Graph

3 Commits

Author SHA1 Message Date
Loïc Molinari
bcd04e0fad gl-renderer: Derive texcoords from position in the vertex shader
Let the graphics hardware handle the transformation from surface
position to texture coordinates. Paint nodes now have a single vertex
position attribute from which texture coordinates are derived. A new
vertex shader variant handles the transformation.

Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
2023-06-12 11:15:51 +00:00
Daniel Stone
e07be58dc4 gl-renderer: Use highest precision for vertex shaders
Whilst GLSL requires highp for the vertex shader stage, highp is
optional for the fragment shader.

Make sure that we work in highp by default during the vertex shader
stage, using either highp or mediump for the texcoord varying according
to what the fragment shader supports.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-02-02 21:46:06 +00:00
Pekka Paalanen
d913363394 gl-renderer: move vertex shader into new file
This patch adds the tooling for incorporating files as C data, so that
files can be built into the binaries. The tool is in Python to avoid
adding extra dependencies like xxd.

xxd.py is copied from Mesa as-is, from commit
b729cd58d76f97f3fc04a67569535ee5ef2f5278 (master branch on 2021-01-26),
a.k.a 21.0-branchpoint-635-gb729cd58d76.

Moving the GLSL vertex shader into a separate file is not that
interesting, the purpose of this commit is to provide a simple
demonstration of the tooling. The real benefits come in a following
patch where the fragment shaders are re-written and externalized.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00