From ba76d3810713bb67569114e9458416df0f78687a Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 27 Sep 2026 13:02:41 +0100 Subject: Draw symbols on the GPU from the point table as it is OpenGL ES 3.1: the file's points go up as one storage buffer, each symbol gets 16 row bands listing the curves they reach (cut by integer division of doubled coordinates, so CPU and shader agree), and every pixel of a symbol's box sums the exact area of its bands' curves, as vega_coverage does. vega-symbols gpu draws every symbol against the CPU reference and times 1080p pages. On the Pi 5's V3D it matches the reference (mean 0.001-0.1 levels, worst 4) but takes 142-757 ms a page, 83% of it in the area function. A sorting network in registers made it 2.3x faster yet computes wrong rows in the fragment stage with this driver, while the same code is exact in a compute shader; so drawing each glyph size once into an atlas by compute comes next. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8cbdff8..d121123 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,11 @@ $(BUILD)/vega: $(SOURCES) src/vega.h $(PURE_SOURCES) | $(BUILD) # Building symbol files reads fonts through FreeType; reading them does not. FREETYPE_CFLAGS ?= $(shell pkg-config --cflags freetype2) FREETYPE_LIBS ?= $(shell pkg-config --libs freetype2) -$(BUILD)/vega-symbols: src/symbols-tool.c src/symbols.c src/symbols.h | $(BUILD) - $(CC) $(CPPFLAGS) $(CFLAGS) $(FREETYPE_CFLAGS) src/symbols-tool.c src/symbols.c $(LDFLAGS) $(FREETYPE_LIBS) -lm $(LDLIBS) -o $@ +# Drawing them on the GPU takes OpenGL ES 3.1 through EGL. +GL_LIBS ?= $(shell pkg-config --libs egl glesv2) +$(BUILD)/vega-symbols: src/symbols-tool.c src/symbols.c src/symbols.h src/symbols-gl.c src/symbols-gl.h | $(BUILD) + $(CC) $(CPPFLAGS) $(CFLAGS) $(FREETYPE_CFLAGS) src/symbols-tool.c src/symbols.c src/symbols-gl.c $(LDFLAGS) \ + $(FREETYPE_LIBS) $(GL_LIBS) -lm $(LDLIBS) -o $@ check: $(BUILD)/vega $(BUILD)/vega-symbols $(MAKE) -C $(AUP) build/aup -- cgit v1.2.3