Skip to content

Instantly share code, notes, and snippets.

@bzm3r
Last active Aug 26, 2019
Embed
What would you like to do?
GSoC 2019 project overview.

Despite the ubiquity of text in computing applications, rendering high quality text using the GPU remains a challenging problem. Brief histories of the problem, and work done to date are discussed in this course description, and a recent blog post by Raph Levien and its accompanying HN discussion.

Patrick Walton et al. have produced a promising solution in the form of a Rust library, Pathfinder, whose general design has been beautifully documented by Nicolas Silva. Pathfinder 3 currently uses OpenGL as its GPU API, and we wondered if a port of it to more modern graphics APIs (e.g. Vulkan) might prove interesting in terms of performance results. To this end, I tried to use gfx-rs re-write how Pathfinder accesses/uses the GPU. While progress was made, I ultimately found that I had to stray quite a bit from the GPU API specified by traits in Pathfinder's current design. I described the issues I faced, my chosen solutions, and a summary of what works need to be done futher here.

Instead, my mentor (Raph Levien) and I decided to focus on progressing a promising solution to the 2D rendering problem he experimented on: piet-metal. This experiment is discussed in great detail here. Thus, I spent the remainder of my time on piet-dx12. Currently, piet-dx12 renders a 2D "stress test" scene composed of many circles of random size and color, and strings of text of random size and color. It can be run either in debug mode (cargo run) or release mode (cargo run --release). Statistics of how much time various actions take on the GPU are printed at the end of a run, and show that rendering is comfortably at least 60 fps, which requires that frames are drawn in at least ~16 ms, even on an intel integrated GPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment