Make Cogl's Snippet API introspectable
Problem Description
Right now, the Cogl API for creating shaders is deprecated. The documentation says that one should use the Snippet API instead - however, this is not exposed to GJS. This makes it impossible to create custom shaders with GJS.
Current Situation
As a workaround, one can use the Clutter.ShaderEffect
or the Shell.GLSLEffect
, however both derive from Clutter.OffscreenEffect
which is not always needed or desired. In fact, some code of Shell.GLSLEffect
seems to exist mostly as a workaround for this missing API [1].
Next Steps
Yet I suspect that there is a reason for this not being exposed to GJS. Is it not wanted for some reason? I checked the roadmap for Clutter & Cogl and did not find anything related.
Anyways, I did some small tests and managed to create a pipeline with a custom shader in GJS using the newly exposed API and everything seemed to work nicely. Therefore, I created !2422 (merged) so that we can discuss this!
[1] https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/src/shell-glsl-effect.h#L10