glsl_type: Add a C wrapper to get struct field offsets