Skip to content

SYSTEM Cited by 1 source

GLSL

GLSL (OpenGL Shading Language) is the shading language shipped with OpenGL and WebGL. Long history; multiple dialects. The two relevant in the WebGPU-migration context:

  • WebGL 1 GLSL — older; individual uniform declarations (uniform vec3 x) permitted at the top level of a shader; no required explicit binding slots.
  • Later GLSL dialects (WebGL 2 and beyond) — require uniforms to be grouped in blocks, closer to WGSL's model. Easier to translate to WGSL via naga.

Why the WebGL 1 dialect matters

Applications that shipped early on WebGL (pre-WebGL 2) often wrote their shaders in WebGL 1 GLSL. Migrating that corpus to WGSL typically can't go through naga directly — naga's GLSL input expects a newer dialect. The usual path: pre-process the older GLSL to a newer GLSL dialect first, then feed that to naga. Figma's shader pipeline is a canonical instance.

Seen in

Last updated · 200 distilled / 1,178 read