repro:
fn vertex ()
using import glsl
using import glm
buffer attr :
struct Attributes plain
data : (array vec2)
gl_Position = (vec4 (attr.data @ gl_VertexID) 0 1)
fn fragment ()
using import glsl
using import glm
out fcolor : vec4
fcolor = (vec4 1)
# use your own link-shader fn here
let program =
link-shader
static-compile-glsl 420 'vertex (static-typify vertex)
static-compile-glsl 420 'fragment (static-typify fragment)
# will yield this runtime (OpenGL) error:
#0:3(16): error: syntax error, unexpected NEW_IDENTIFIER
# it can be solved by patching in (inserts after the #version line):
let vsource =
patch-shader
static-compile-glsl 420 'vertex (static-typify vertex)
"#extension GL_ARB_shader_storage_buffer_object : require\n"