and `macos_app` examples.
`winit` does not create an autorelease pool, so the Metal backend had not taken
the presence of one into account. Now the Metal backend creates and flushes
autorelease pools as necessary.
Closes#334.
Closes#376.
to `surfman`.
This is a large commit; explanations of each change follow.
This adds an optional compute shader path, off by default, for rendering fills
to alpha masks. It usually does not improve performance at present, but it
provides a good baseline for further optimizations. Later improvements will
likely aim to avoid writes to the mask texture entirely. Supporting
infrastructure for compute shader has been added to `pathfinder_gpu` for the
OpenGL and Metal backends.
The Metal backend has been optimized to avoid unneccessary buffer allocations
and reflection. As part of this, argument buffers have been removed, as the
current SPIRV-Cross compiler no longer requires them.
The GPU renderer has been improved to avoid stalls. Now, separate buffers are
allocated for each fill batch and for each frame. This can be extended in the
future to allow for separate buffers for tile draw operations as well.
SDL usage has been removed in favor of the native Rust `surfman` and `winit`.
Because `surfman` allows for selection of the integrated GPU on multi-GPU
system, it is chosen by default. The demo supports a new
`--high-performance-gpu` option to opt into the discrete GPU.
This commit substantially reworks the `pathfinder_gpu` API to better support
modern APIs like Metal. It should open the door to `gfx-rs`, `wgpu`, Vulkan,
and D3D12 backends relatively straightforwardly.
A new example, `canvas_metal_minimal`, has been added.
Note that the new Metal shaders require a patched version of `spirv-cross` to
build properly. An upstream patch is forthcoming.