Commit graph

241 commits

Author SHA1 Message Date
Raph Levien 47e24ec9d5 Start adding support for creating images
This is still WIP, focused on creating image resources and making them
available GPU-side.

Progress toward #38
2020-11-19 16:32:29 -08:00
Raph Levien 1d0fd02c79
Merge pull request #41 from linebender/hub
Add hub abstraction
2020-11-19 16:30:37 -08:00
Raph Levien 75c4b62730 Add hub abstraction
The hub does a little better lifetime tracking of resources (so
Rust-side references can be dropped), and in the future will be used for
dynamic selection of backend.

The migration is still a bit half-baked, as there are a bunch of
Vulkan-specific types in the signatures, but it shouldn't be too much
work to sort that out. Perhaps it can wait until there is a second
backend though.

The main motivation for this is to create image objects with lifetime
tracking, one of the things required for #38.
2020-11-18 16:06:08 -08:00
Raph Levien fdb80c0561
Merge pull request #39 from linebender/cleanup
Minor cleanups
2020-11-18 15:59:13 -08:00
Raph Levien 301abf4db7 Minor cleanups
Mostly cleaning up some comments. Also adds host barrier and a command
to copy a buffer to an image (in preparation for images, see #38).
2020-11-17 14:18:30 -08:00
Raph Levien c939448348
Merge pull request #37 from linebender/update_deps
Update dependencies
2020-11-17 14:18:14 -08:00
Raph Levien 8e2f2aeeba Update dependencies
Update to latest versions of all dependencies. Among other things, this
gets us on piet 0.2, though almost all of the changes were around text,
which is not yet implemented.
2020-11-14 08:25:43 -08:00
Elias Naur d3fe8630be
Merge pull request #35 from eliasnaur/stop-spin
Limit spinning in elements.comp
2020-11-05 20:28:15 +01:00
Elias Naur b942e4035b piet-gpu/shader: ensure forward progress in decoupled lookback
The Vulkan and OpenGL specifications offer only weak forward progress guarantees, and
in practice several mobile devices fail to complete the decoupled lookback
spinloop without mitigation.

This patch implements Raph's suggestion from the "Forward Progress"
section from

https://raphlinus.github.io/gpu/2020/04/30/prefix-sum.html

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-10-25 21:02:58 +01:00
Elias Naur bc01180519 piet-gpu/shader: delete unused is_fill from elements.comp
Delete debug code as well.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-10-25 20:59:54 +01:00
Elias Naur 61810b1bff
Merge pull request #34 from eliasnaur/master
implement clip paths
2020-10-16 11:34:52 +02:00
Elias Naur 8fab45544e shader: implement clip paths
Expand the the final kernel4 stage to maintain a per-pixel mask.

Introduce two new path elements, FillMask and FillMaskInv, to fill
the mask. FillMask acts like Fill, while FillMaskInv fills the area
outside the path.

SVG clipPaths is then representable by a FillMaskInv(0.0) for every nested
path, preceded by a FillMask(1.0) to clear the mask.

The bounding box for FillMaskInv elements is the entire screen; tightening of
the bounding box is left for future work. Note that a fullscreen bounding
box is not hopelessly inefficient because completely filling a tile with
a mask is just a single CmdSolidMask per tile.

Fixes #30

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-10-09 13:20:26 +02:00
Elias Naur 55cfd472a5 shader: delete unused code
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-10-09 13:20:26 +02:00
Elias Naur db6172d811
Merge pull request #33 from eliasnaur/master
piet-gpu-types: remove unused types
2020-09-27 23:47:38 +02:00
Elias Naur 9be0faba6f piet-gpu-types: remove unused scene elements
Delete image compute shader as well; it is unused.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-09-27 18:57:53 +02:00
Elias Naur fa9bf0dc2b piet-gpu-types: remove unused ptcl types
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-09-27 18:30:33 +02:00
Elias Naur dceb0f9412 piet-gpu-types: remove unused annotated types
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-09-21 10:55:58 +02:00
Elias Naur 02a6bfbb6c
Merge pull request #32 from eliasnaur/master
Clean up, add maximum workgroup size control
2020-09-16 08:44:48 +02:00
Elias Naur ac3ac3ddff shader: introduce a crude setting for adjusting the maximum workgroup size
Both the Vulkan and OpenGL ES spec allow implementations to limit workgroups to
128 threads. Add a LG_WG_FACTOR setting for easy switching between 128 and 256
threads, with 256 being kept as the default setting.

Manually tested that LG_WG_FACTOR = 0 (128 threads) works as expected.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-09-13 13:04:13 +02:00
Elias Naur 326f7f0d03 shader: delete more unused code and variables
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-09-13 13:03:56 +02:00
Brian Merchant a73e7cf282
Merge pull request #31 from eliasnaur/master
compute IMAGE_WIDTH and IMAGE_HEIGHT; remove dead code from setup.h
2020-09-04 03:34:59 -07:00
Elias Naur 05636995dd compute IMAGE_WIDTH and IMAGE_HEIGHT; remove dead code from setup.h
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-08-29 15:03:40 +02:00
Elias Naur fa38101e39
Merge pull request #29 from eliasnaur/master
shader: remove dead code
2020-08-28 17:57:45 +02:00
Elias Naur de4f963ba0 shader: remove dead code
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-08-28 17:37:46 +02:00
Raph Levien d5106e8a7e
Merge pull request #28 from eliasnaur/master
Fix linewidth transformations
2020-08-24 09:10:31 -07:00
Elias Naur cfd57361c4 Fix linewidth transformations
The transformation determinant is signed, but we're only interested in
the absolute scale for transforming linewidths.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-08-24 16:12:18 +02:00
Brian Merchant 72e2dfab3d
Merge pull request #27 from bzm3r/vestige-cleanup
Clean up bits of right edge tracking logic left over from sort-middle.
2020-08-15 16:30:20 -07:00
bhmerchant@gmail.com d836d21d12 Clean up bits of right edge tracking logic left over from sort-middle. 2020-08-12 19:57:14 -07:00
Raph Levien 724c4899f2
Merge pull request #26 from linebender/license
Add unlicense
2020-07-02 23:22:42 -07:00
Raph Levien 4470cdeccc Add unlicense
Also take the opportunity to add more links to the README and adopt
the Rust code of conduct.
2020-07-02 17:32:14 -07:00
Raph Levien 2c0f1d3cdd
Merge pull request #25 from ztlpn/fix-mapping-size
Fix read mapping size in the Vulkan adapter
2020-07-02 11:45:50 -07:00
Alexey Zatelepin 9667c34e7e Fix read mapping size (size is number of bytes, not number of items) 2020-07-02 21:32:17 +03:00
Raph Levien 368721e317
Merge pull request #24 from msiglreith/docs
Shader documentation and a slight cleanup
2020-07-01 17:30:16 -07:00
Raph Levien 46d0e7cea2
Merge pull request #22 from kant/patch-1
Minor fix on paragraph 35
2020-06-29 07:21:59 -07:00
msiglreith 1cc5c7ac0d Shader documentation and a slight cleanup 2020-06-28 15:37:27 +02:00
Darío Hereñú 9b87de055f
Minor fix on paragraph 35 2020-06-15 11:15:32 -03:00
Raph Levien 258bf6890a
Merge pull request #21 from msiglreith/update-winit
Update winit example
2020-06-14 14:42:48 -07:00
msiglreith eed71721eb Update winit example 2020-06-14 23:32:59 +02:00
Raph Levien dc5facd198
Merge pull request #20 from linebender/sorta
A sorta-middle architecture
2020-06-13 13:40:48 -07:00
Raph Levien 65f802894c Merge branch 'master' into sorta 2020-06-13 07:30:40 -07:00
Raph Levien daa7c9dd64 Merge branch 'sort_middle' 2020-06-11 16:17:40 -07:00
Raph Levien 73df5534a1
Merge pull request #19 from linebender/sort_middle
Bring sort_middle branch to master
2020-06-11 16:16:10 -07:00
Raph Levien b23113461b Minor cleanups
Get rid of warnings. Do cargo update to bump deps.
2020-06-10 14:10:28 -07:00
Raph Levien 79cc9da811 Fancy flattening
Implement same flattening algorithm as kurbo.
2020-06-09 20:45:19 -07:00
Raph Levien eaa1d261c3 Sederberg error metric
Use proper math to compute number of subdivisions. This works but is not
very satisfying, as it over-subdivides.
2020-06-09 18:43:49 -07:00
Raph Levien b571e0d10c Continue wiring up gpu-side flattening
All segments given to path coarse raster are cubics. Flatten to
quadratics.

This works but the quality is not (yet) good.
2020-06-09 17:56:11 -07:00
Raph Levien 0f44bc8b78 Start GPU-side flattening
This starts the work on GPU-side flattening by plumbing curves through.
2020-06-09 16:01:47 -07:00
Raph Levien 3a8227d025 Non-load balanced coarse path raster
This is a bit of a revert of the load-balanced ("more parallel") coarse
path rasterizer, but includes fills and also uses atomicExchange.

I'm doing it this way because it should be considerably easier to do
flattening in this structure, even though there will be some performance
regression.
2020-06-09 15:09:53 -07:00
Raph Levien 7118c8efc1 Fix backdrop of segments to left of viewport
Make sure we account for backdrop in segments clipped out of viewport.
2020-06-09 10:25:22 -07:00
Raph Levien 6db4e20bbb More parallel backdrop propagation
This is a nice improvement but still not great on tiger.
2020-06-06 08:23:40 -07:00