A high-performance, GPU-accelerated 2D vector graphics library, ported from the original Rust implementation of Pathfinder 3. This version brings the power of massivly parallel vector rasterization to the C++ ecosystem, with native Vulkan, OpenGL, and Metal backends.
- Massively Parallel Rasterization: Leverages the GPU to rasterize complex vector scenes at high speeds.
- Dual Rendering Strategies:
- Hybrid Mode: CPU-assisted binning with hardware rasterization. Optimized for mobile devices and static path caching.
- GPU-Driven Mode: Full compute-shader-based pipeline. Minimizes CPU overhead by moving binning and tiling entirely to the GPU.
- Advanced Effects: Native support for shadows, blurs, gradients, and complex clipping paths.
- Cross-Platform: Designed for Windows, Linux, macOS, Android, and Web (Wasm).
| Backend | Hybrid Mode | GPU-Driven Mode | Notes |
|---|---|---|---|
| Vulkan | โ | โ | Best performance |
| Metal | โ | โ | Not MoltenVK |
| OpenGL 4.3+ | โ | โ | Desktop standard |
| OpenGL ES 3.1+ | โ | โ * | *Limited by Storage Image access on some ES devices |
| OpenGL ES 3.0 | โ | โ | Compatibility mode |
| WebGL2 | โ | โ | Web target |
- C++14 compatible compiler.
- CMake 3.15+.
- Vulkan SDK (if building with Vulkan support or regenerating shaders).
git clone --recursive https://github.com/your-repo/pathfinder-cpp.git
cd pathfinder-cpp
mkdir build && cd build
cmake ..
makeThe native demo uses a common application framework.
- Initialize submodules:
git submodule update --init --recursive. - Open the project in your favorite IDE (CLion, VS) and run the
demotarget.
- Copy
assetsintodemo/android/app/src/main. - Open
demo/androidin Android Studio. - Deploy to a device supporting GLES 3.0+.
- Set up the Emscripten environment.
- Run
./build_wasm.sh. - Run
./demo/web/serve.shand visithttp://127.0.0.1:8000.
This project is a port of the Pathfinder engine developed by the Servo project.