Input (my_shader.vert.glsl):
#version 330 core
layout (location = 0) in vec3 aPos;
void main()
{
gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);
}
Desired output would be something like
namespace my_shader
{
struct aPos
{
using type = vec3_t;
static constexpr auto location = 0;
};
}
I can use glslangValidator
to dump the AST, in a human-readable form, which is one way forward, but then I would need to find the list of “Linker Objects” and parse them again. Would it be possible to dump the AST in json format, or maybe even better, use some Python bindings towards glslang
in order to generate the interface file directly.