Commit graph

4 commits

Author SHA1 Message Date
Simon Ser
67fa22a8b5 render/gles2: check shaders once
We'd always check shaders each time we were building, even if the
shaders didn't change. This is caused by the check not producing
any file, so ninja can't check whether the output file is up-to-date.

Fix this by capturing the output and write to a file.

TODO: error messages are no longer visible.
2025-01-27 18:20:27 +01:00
Simon Ser
2b4f30dc1d render/gles2: validate shaders at build time
Use glslang to validate GLSL shaders at build time. This is
optional: if glslang is not found, shader validation is skipped.
2024-12-15 13:59:42 +01:00
Simon Ser
4d04144b92 render/gles2: de-duplicate vertex shaders
The vertex shaders for quads and textures are identical.
2022-10-28 13:49:03 +02:00
Simon Ser
a75f9be2e8 render/gles2: move shaders to individual files
Instead of having a C file with strings for each shader, move each
shader into its own file. Use a small POSIX shell script to convert
the files into C strings (can't wait for C23 #embed...).

The benefits from this are:

- Improved readability and syntax highlighting.
- Line numbers in shader compiler errors are easier to make sense of.
- Consistency with the Vulkan renderer.
- Shaders will become more complicated as we add color management
  features.
2022-10-28 11:46:06 +00:00