Files
harfbuzz/util/gpu/demo-vertex.glsl
T
Behdad EsfahbodandClaude Opus 4.6 03c2688436 [gpu] Add GPU demo app in util/gpu
Port the glyphy-demo to use the hb-gpu API.  Builds as util/hb-gpu
and requires GLEW, GLFW3, and OpenGL 3.3.  Includes default text
and embedded font for quick testing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:30:13 -06:00

27 lines
519 B
GLSL

uniform mat4 u_matViewProjection;
uniform vec2 u_viewport;
in vec2 a_position;
in vec2 a_texcoord;
in vec2 a_normal;
in float a_emPerPos;
in uint a_glyphLoc;
out vec2 v_texcoord;
flat out uint v_glyphLoc;
void main ()
{
vec2 pos = a_position;
vec2 tex = a_texcoord;
vec4 jac = vec4 (a_emPerPos, 0.0, 0.0, -a_emPerPos);
hb_gpu_dilate (pos, tex, a_normal, jac,
u_matViewProjection, u_viewport);
gl_Position = u_matViewProjection * vec4 (pos, 0.0, 1.0);
v_texcoord = tex;
v_glyphLoc = a_glyphLoc;
}