-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
area: renderrender/* packagerender/* packagearea: textText/font renderingText/font renderingpriority: mediumNormal priorityNormal prioritytype: featureNew capabilityNew capability
Description
Text is not visible when using RenderDirect because it only renders GPU-accelerated shapes. Text is currently CPU-rasterized to an internal pixel buffer, and RenderDirect (zero-copy GPU→surface path) does not upload that buffer.
Current behavior
| Method | GPU shapes | CPU text |
|---|---|---|
RenderDirect |
✅ | ❌ |
RenderTo |
✅ | ✅ |
Workaround
Use RenderTo instead of RenderDirect:
canvas.RenderTo(dc.AsTextureDrawer())Solution
Integrate the existing MSDF text pipeline into the unified GPU render session so DrawString goes through a GPU MSDF batch instead of CPU rasterization.
Completed infrastructure
| Task | Description | Status |
|---|---|---|
| TASK-050 Phase 1 | Text pipeline: shaper, bidi, layout, cache | ✅ Done |
| TASK-050b | Glyph-as-path conversion | ✅ Done |
| TASK-050c | Glyph cache | ✅ Done |
| TASK-050f | MSDF generator (Pure Go) | ✅ Done |
| TASK-050g | MSDF atlas packer | ✅ Done |
| TASK-050h | MSDF WGSL shader (msdf_text.wgsl) |
✅ Done |
| TASK-050i | Emoji support | ✅ Done |
| TASK-050j | Subpixel positioning | ✅ Done |
Existing code:
internal/gpu/text_pipeline.go—TextPipelinestruct (stubRenderText)internal/gpu/shaders/msdf_text.wgsl— WGSL shader with fill, outline, shadow modes- Spec:
msdfgen-go-spec.md— standalone Pure Go MSDF library design
Remaining work
Wire DrawString → TextPipeline.RenderText within the GPU render session:
- Upload MSDF atlas to GPU texture
- Glyph layout → vertex buffer (quad per glyph)
- Integrate text batch into unified render pass
- Zero readbacks, resolution-independent
Related
- Reported by @amortaza in Discussion #47
- Backlog task: GG-TXT-001 (milestone v0.31.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: renderrender/* packagerender/* packagearea: textText/font renderingText/font renderingpriority: mediumNormal priorityNormal prioritytype: featureNew capabilityNew capability