Patrick Walton
a2d87a6624
Update the C canvas example
2020-06-23 13:31:53 -07:00
Patrick Walton
9ff46b39cd
Update examples
2020-06-23 13:31:53 -07:00
Patrick Walton
423a91ea1a
Update the demo for the D3D11 backend
2020-06-23 13:15:59 -07:00
Patrick Walton
72cdef2c2a
Update the C backend
2020-06-23 13:15:59 -07:00
Patrick Walton
7a1db16340
Update the WebGL backend
2020-06-23 13:15:59 -07:00
Patrick Walton
769dae4a9c
Update various front-end libraries
2020-06-23 13:15:59 -07:00
Patrick Walton
13b2c91dde
Update the scene proxy
2020-06-23 13:15:59 -07:00
Patrick Walton
f92c631f97
Rework the tile builder for D3D11
2020-06-23 13:15:59 -07:00
Patrick Walton
17356311d6
Rework renderer options
2020-06-23 13:15:59 -07:00
Patrick Walton
7a996d330c
Update `pathfinder_renderer::{paint, scene}`
2020-06-23 13:15:59 -07:00
Patrick Walton
df15c855c4
Significantly rework the GPU renderer for the D3D11 backend
2020-06-23 13:15:59 -07:00
Patrick Walton
58a76f0f16
Update `gpu_data`
2020-06-23 13:15:59 -07:00
Patrick Walton
eabe1b239d
Update `pathfinder_content`
2020-06-23 13:15:59 -07:00
Patrick Walton
385272851a
Remove the separate `z_buffer` module
2020-06-23 13:15:59 -07:00
Patrick Walton
b8055c38c1
Update `pathfinder_geometry`
2020-06-23 13:15:59 -07:00
Patrick Walton
23c171fb6f
Refactor GPU a bit more
2020-06-23 13:15:59 -07:00
Patrick Walton
3bb4a47757
Remove old shaders
2020-06-23 13:15:59 -07:00
Patrick Walton
79326025af
Rework the blit shader
2020-06-23 13:15:59 -07:00
Patrick Walton
661da5e12b
Refactor GPU performance measurement
2020-06-23 13:15:59 -07:00
Patrick Walton
61833168e5
Update the debug UI
2020-06-23 13:15:59 -07:00
Patrick Walton
ff7c13c8fb
Add a new compute-based D3D11 backend
2020-06-23 13:10:06 -07:00
Patrick Walton
4091fe7ce1
Update the Metal backend
2020-06-23 13:10:06 -07:00
Patrick Walton
21a82ae049
Update the OpenGL backend
2020-06-23 13:10:06 -07:00
Patrick Walton
7771fd877d
Add a unified GPU allocator
2020-06-23 13:10:06 -07:00
Patrick Walton
754a44ae22
Rename the existing renderer to `d3d9` in preparation for the D3D11 branch
2020-06-23 13:10:05 -07:00
bors-servo
5e3fb5fed0
Auto merge of #356 - linkmauve:c-resources-path, r=pcwalton
...
Expose creating a resource loader from a path to C
This is useful when Pathfinder is shipped by a Linux distribution, and not with everything bundled.
2020-06-16 12:11:35 -04:00
bors-servo
22d5dbc26a
Auto merge of #353 - linkmauve:no-foreign-types, r=pcwalton
...
Only use foreign-types on macOS in the C API
Its only use is for `CoreAnimationLayerRef::from_ptr()` in `PFMetalDeviceCreate`, so this fixes a warning on other platforms.
The last time I tried to fix this warning I didn’t notice that it was actually used, and thus 2d2bc14e5c
broke the macOS build in #257 .
2020-06-16 11:54:58 -04:00
bors-servo
1b63996fef
Auto merge of #347 - as-cii:metal-manifest, r=pcwalton
...
Add missing Metal shader to resources/MANIFEST
This fixes an issue that caused `pathfinder_metal` to panic when [attempting to load shaders](0f35009215/metal/src/lib.rs (L854)
) using the embedded resource loader.
/cc: @nathansobo
2020-06-16 11:37:25 -04:00
Patrick Walton
a47c703518
Merge pull request #358 from windexlight/scalar-u32x2-fix
...
Implement BitAnd, BitOr, and Not for U32x2 in scalar version.
2020-06-16 08:37:02 -07:00
Sam Schanken
714421b3c6
Implement BitAnd, BitOr, and Not for U32x2 in scalar version.
2020-06-13 17:18:49 -07:00
Emmanuel Gil Peyrot
5e8c20e78c
Expose creating a resource loader from a path to C
2020-06-11 16:02:09 +02:00
Emmanuel Gil Peyrot
f2c0aba352
C API: Only use foreign-types on macOS
...
Its only use is for CoreAnimationLayerRef::from_ptr() in
PFMetalDeviceCreate, so this fixes a warning on other platforms.
The last time I tried to fix this warning I didn’t notice that it was
actually used, and thus 2d2bc14e5c
broke
the macOS build in #257 .
2020-06-05 17:12:35 +02:00
Antonio Scandurra
cc54fa6e03
Add missing Metal shader to resources/MANIFEST
...
Co-Authored-By: Nathan Sobo <nathansobo@gmail.com>
2020-05-28 16:11:23 +02:00
bors-servo
0f35009215
Auto merge of #342 - pcwalton:listener-lifetime, r=pcwalton
...
Don't restrict render command listeners to the static lifetime
2020-05-16 14:05:57 -04:00
bors-servo
523734d95e
Auto merge of #341 - pcwalton:new-tiling-simd, r=pcwalton
...
Use SIMD a bit more in the new tiling code.
2020-05-16 13:49:38 -04:00
Sebastian K
18d2b006ac
Don't restrict render command listeners to the static lifetime
2020-05-16 10:47:06 -07:00
Patrick Walton
13f9fdc96c
Use SIMD a bit more in the new tiling code.
2020-05-16 10:38:34 -07:00
bors-servo
28c4bc194d
Auto merge of #340 - pcwalton:new-tiling, r=pcwalton
...
Replace the tiling algorithm with the one from "Random Access Vector Graphics".
This is a significant improvement in CPU time, as well as an overall
simplification.
2020-05-15 22:38:27 -04:00
Patrick Walton
abecb697be
Quit the NanoVG demo when pressing Escape, not any key.
...
The previous setup was making it hard to take screenshots.
2020-05-15 19:14:32 -07:00
Patrick Walton
deee2436c1
Make the NanoVG demo use the filesystem resource loader.
...
The embedded resource loader doesn't have the needed fonts.
2020-05-15 19:14:08 -07:00
Patrick Walton
6ed3237b10
Remove path rect clipping, since it's no longer required
2020-05-15 19:13:18 -07:00
Patrick Walton
37c993eee6
Remove monotonic conversion, since it's no longer required
2020-05-15 19:12:46 -07:00
Patrick Walton
440510a126
Add an `abs` method to `Vector2F`
2020-05-15 19:11:39 -07:00
Patrick Walton
3433545a76
Minor cleanup in the `line_segment` module
2020-05-15 19:10:56 -07:00
Patrick Walton
a67b4dd5b7
Replace the tiling algorithm with the one from "Random Access Vector Graphics".
...
This is a significant improvement in CPU time, as well as an overall
simplification.
2020-05-15 19:10:12 -07:00
Patrick Walton
c61f3e5ae8
Add some new operators to `RectI`
2020-05-15 19:08:39 -07:00
bors-servo
1630a3b97c
Auto merge of #338 - servo:jdm-patch-1, r=jdm
...
Add homu webhook.
2020-05-13 11:13:11 -04:00
Josh Matthews
3f201e4729
Add homu webhook.
2020-05-13 10:43:48 -04:00
Patrick Walton
8808bfda63
Merge pull request #337 from pcwalton/macos-radeon
...
Associate texture parameters in shaders with specific texture units, to work around a macOS Radeon driver bug.
2020-05-12 22:08:12 -07:00
Patrick Walton
ef0c0e0679
Associate texture parameters in shaders with specific texture units, to work
...
around a macOS Radeon driver bug.
Also, ensure there is always a dummy texture bound to every parameter in the
OpenGL backend.
These together stop the macOS Radeon drivers from recompiling the shader on
every drawcall.
Possibly addresses #300 .
2020-05-12 21:40:38 -07:00
Patrick Walton
33cd3798d7
Merge pull request #335 from Veedrac/master
...
Change how point_queue and active_edges are sorted for performance
2020-05-11 15:24:59 -07:00
Veedrac
033a150639
Order and sample gradient correctly
...
Zero-width gradient sections should be ‘ignored’.
The visible endpoints should be precisely the first
and last colors added at that point.
https://html.spec.whatwg.org/multipage/canvas.html#interpolation
2020-05-11 21:47:39 +01:00
Veedrac
6d8a89b8c5
Cleanup: remode redundant ops in tiles.rs
2020-05-11 21:47:39 +01:00
Veedrac
1c48e8900e
Faster sorting strategy, remove SortedVector
...
point_queue is only sorted by y coordinate to coordinate
work to one strip at a time. This is more efficiently handled
by punting later work into a next_point_queue,
and never explicitly sorting the data.
active_edges is only sorted by x coordinate for the tile-by-tile
work in process_old_active_edges. It is much more efficient
to sort once inside that function.
2020-05-11 21:47:35 +01:00
Patrick Walton
cbceee85e6
Merge pull request #336 from Veedrac/hidpi_fix
...
Fix non-integer HiDPI support in demo
2020-05-11 11:19:06 -07:00
Veedrac
faea46b9f6
Fix non-integer HiDPI support in demo
2020-05-11 13:14:54 +01:00
Patrick Walton
5ed26819bb
Merge pull request #331 from frewsxcv/frewsxcv-rect
...
Implement {Add,Sub,Mul}Assign for RectF
2020-05-10 21:33:47 -07:00
Patrick Walton
fc515f950f
Merge pull request #329 from frewsxcv/frewsxcv-colors
...
Promote ColorU functions to `const`.
2020-05-10 21:33:23 -07:00
Patrick Walton
116b528e4e
Merge pull request #330 from frewsxcv/frewsxcv-embedded
...
Switch to the embedded loader for the examples.
2020-05-10 21:33:04 -07:00
Corey Farwell
9f71feb545
Update main.rs
2020-05-09 12:49:43 -04:00
Corey Farwell
e993e350e2
Implement {Add,Sub,Mul}Assign for RectF
2020-05-08 21:25:45 -04:00
Corey Farwell
e1ec307b3f
Switch to the embedded loader for the examples.
2020-05-08 21:17:23 -04:00
Corey Farwell
e26338835b
Promote ColorU functions to `const`.
2020-05-08 21:09:38 -04:00
Patrick Walton
aa1279d692
Merge pull request #328 from pcwalton/precision-highp
...
Only define `precision highp sampler2D` in OpenGL ES.
2020-05-08 17:16:35 -07:00
Patrick Walton
2ad02b0b78
Only define `precision highp sampler2D` in OpenGL ES.
...
Closes #309 .
2020-05-08 16:59:40 -07:00
Patrick Walton
1a37b7f819
Merge pull request #327 from pcwalton/glfw-c-example
...
Add an example showing how to use the Pathfinder C API with GLFW
2020-05-08 16:53:06 -07:00
Patrick Walton
feb6cca419
Merge pull request #326 from pcwalton/c-font-context-docs
...
Document `PFCanvasFontContextCreateWithFonts()`.
2020-05-08 15:10:07 -07:00
Patrick Walton
bbf4c88d0d
Add an example showing how to use the Pathfinder C API with GLFW
...
Closes #258 .
2020-05-08 15:09:21 -07:00
Patrick Walton
fd57193442
Merge pull request #325 from pcwalton/update-embedded
...
Update the resource manifest for recent changes
2020-05-08 14:33:53 -07:00
Patrick Walton
b669cc7087
Document `PFCanvasFontContextCreateWithFonts()`.
...
Closes #247 .
2020-05-08 14:27:41 -07:00
Patrick Walton
d039e9009e
Merge pull request #324 from pcwalton/metal-layer-non-macos
...
Provide a placeholder definition of `CAMetalLayer` in the C API.
2020-05-08 14:18:00 -07:00
Patrick Walton
84cd92aea4
Update the resource manifest for recent changes
2020-05-08 14:17:13 -07:00
Patrick Walton
9998fe49bd
Provide a placeholder definition of `CAMetalLayer` in the C API.
...
Closes #260 .
2020-05-08 14:07:06 -07:00
Patrick Walton
d3ceef749f
Merge pull request #323 from pcwalton/surfmanup
...
Upgrade to the latest master surfman
2020-05-08 13:17:52 -07:00
Patrick Walton
41c0c5f071
Upgrade to the latest master surfman
2020-05-08 12:47:58 -07:00
Patrick Walton
e4edb23360
Merge pull request #322 from pcwalton/surfman-x11
...
Switch to using surfman in X11 mode.
2020-05-08 12:45:32 -07:00
Patrick Walton
5362d3a51e
Merge pull request #321 from pcwalton/default-compute
...
Enable compute shader by default if the OpenGL version is high enough.
2020-05-08 12:28:41 -07:00
Patrick Walton
90fb36f199
Switch to using surfman in X11 mode.
...
Partially addresses #310 .
2020-05-08 12:22:46 -07:00
Patrick Walton
2421de6616
Enable compute shader by default if the OpenGL version is high enough.
2020-05-08 12:16:31 -07:00
Patrick Walton
e766721f37
Update `README.md`
2020-05-07 21:46:13 -07:00
Patrick Walton
46070914be
Merge pull request #320 from pcwalton/painting-nothing
...
Clear the canvas to the background color if no drawing command did so.
2020-05-07 21:45:23 -07:00
Patrick Walton
6299d2c36b
Clear the canvas to the background color if no drawing command did so.
...
Closes #318 .
2020-05-07 21:36:13 -07:00
Patrick Walton
371c853370
Merge pull request #319 from pcwalton/gl4
...
Add OpenGL 4.3 support to the GL backend, enabling compute shader on non-Metal platforms
2020-05-07 17:11:33 -07:00
Patrick Walton
520817e909
Add OpenGL 4.3 support to the GL backend, enabling compute shader on
...
non-Metal platforms
2020-05-07 16:33:03 -07:00
Patrick Walton
cfc1d44638
Merge pull request #317 from pcwalton/four-at-a-time
...
Use all four channels in the mask texture.
2020-05-07 09:55:30 -07:00
Patrick Walton
478008dcf0
Use all four channels in the mask texture.
...
Each bundle of four pixels on a scanline is packed into the RGBA channels of
the mask texture. The area LUT is also expanded to be RGBA so that four pixels'
worth of areas can be looked up at once.
Nice improvement on `paris-30k` from MPVG.
Closes #262 .
2020-05-05 13:11:37 -07:00
Patrick Walton
c7ce2153de
Merge pull request #316 from pcwalton/reduce-buffer-size
...
Reduce the size of buffers for performance
2020-05-05 13:11:06 -07:00
Patrick Walton
f8405d81c0
Bump the number of fills per batch up
2020-05-04 20:01:08 -07:00
Patrick Walton
6407bf5871
Reduce the size of buffers
2020-05-04 20:01:08 -07:00
Patrick Walton
a373a1fbc3
Merge pull request #315 from pcwalton/metal-timing
...
Reduce timing jitter in the Metal backend
2020-05-04 20:01:00 -07:00
Patrick Walton
0545d840db
Reduce timing jitter in the Metal backend
2020-05-04 19:11:50 -07:00
Patrick Walton
9ff3248e9e
Merge pull request #314 from pcwalton/size-classes
...
Generalize the buffer allocator to support multiple size classes, and use it for tile compositing too
2020-05-04 16:02:48 -07:00
Patrick Walton
d0842f2f4d
Generalize the buffer allocator to support multiple size classes, and use it
...
for tile compositing too.
2020-05-04 15:48:47 -07:00
Patrick Walton
da2f65ddf4
Fix `surfman` reference in `Cargo.toml`
2020-04-30 15:04:49 -07:00
Patrick Walton
b335f79f77
Remove references to SDL from the README
2020-04-30 13:43:23 -07:00
Patrick Walton
ac83f79d94
Add a compute shader path, optimize GPU memory management, and switch from SDL
...
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.
2020-04-30 13:33:29 -07:00
Patrick Walton
84bf4341c2
Micro-optimize line fill primitive generation to avoid calls to `floorf()` and
...
`ceilf()`
2020-04-23 18:35:17 -07:00
Patrick Walton
24deb36e9a
Supply solid tiles with the appropriate filter.
...
Fixes `embrace.svg` in MPVG.
2020-04-22 12:53:35 -07:00
Patrick Walton
104869a6e9
Move the mask enable flag to the tile to reduce drawcall count
2020-04-22 11:04:16 -07:00
Patrick Walton
a9003fe69b
Add missing `tile_clip` shader to `resources`.
...
Closes #301 .
2020-04-22 09:13:42 -07:00