Commit graph

66 commits

Author SHA1 Message Date
Firestar99
9c4ab34a58
Extract gsvg_renderer from gcore, remove gcore/vello feature (#2760)
Extract `gsvg_renderer` from `gcore`, remove `gcore/vello` feature
2025-06-27 13:47:46 +00:00
Firestar99
0e8eb481bf
Extract gapplication_io from gcore (#2742)
move `gcore::application_io` into the new crate `gapplication-io`, remove features `wasm` and `wgpu` from `gcore`
2025-06-23 11:35:14 +02:00
Firestar99
ca5ca863cc
Unify feature dependencies with workspace dependencies (#2736)
* graph-craft: fix direct wasm build

* graph-craft: fix no serde feature failing to compile

* graph-craft: make wgpu-executor properly optional

* workspace: unify `image` formats in workspace

* workspace: turn most dependencies into workspace deps, no actual changes

* workspace: unify dependency features in workspace dep
2025-06-21 16:26:25 -07:00
Firestar99
990d5b37cf
Bulk gcore cleanup, replace core and alloc with std (#2735)
* gcore: replace `core` and `alloc` paths with `std`

* node-graph: remove unnecessary path prefix

* gcore: remove most `#[cfg(target_arch = "spirv")]`, keep some potentially useful ones

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-21 23:08:33 +00:00
Firestar99
34dced38ba Make gcore a std library and remove std, alloc, and more unused features (#2724)
* gcore: remove features `std`, `alloc`, `gpu` and `reflections`, now always available

* gcore: remove non-working features `kurbo` and `log`
2025-06-19 20:28:17 -07:00
Firestar99
14d90195ad Remove unused dependencies from the Cargo.toml files via cargo shear (#2723)
* cargo shear ignore rules

* cargo shear

* cargo shear manual dependency removal

* cargo shear: ignore editor in proc-macros
2025-06-19 20:28:17 -07:00
Firestar99
3489f9ddb1 Bulk remove old code for legacy GPU node implementations (#2722)
* fix warning in node-macro

* remove crates `gpu-executor`, `gpu-compiler`, `compilation-client` and `compilation-server`

* remove `wgpu-executor::executor`

* .gitignore .idea/
2025-06-19 20:28:17 -07:00
Keavon Chambers
6111440afd Instance tables refactor part 7: Remove RasterDataType and add Raster<CPU>/Raster<GPU> 2025-06-19 18:37:13 -07:00
Keavon Chambers
5cacab2e39 Instance tables refactor part 7: Rename "ImageFrame" -> "RasterData", "ImageFrameTable" -> "RasterDataType", and "RasterFrame" -> "RasterDataType" 2025-06-19 18:23:53 -07:00
Keavon Chambers
2696abc6b3
Replace Instances<T>::empty() with Instances<T>::default() and make it return an empty table for vector data instead of one empty row (#2689)
Make Instances<T>::default() return an empty table for everything, even vector, and replace ::empty() with ::default()
2025-06-04 21:00:21 -07:00
Keavon Chambers
cb4289169d
Instance tables refactor part 6: unwrap VectorData and ImageFrame from single-row to multi-row tables (#2684)
* Start refactoring the boolean operations code

* Switch to iterators in the boolean operations code

* Make boolean operations work on rows of a table, not Vecs of single-row tables

* Remove more .transform()

* Simplify brush code

* Attempt to remove .transform() by using Instance<Image<Color>> in brush code, but a regression is introduced

* Improve blend_image_closure

* Simplify

* Remove leading underscore from type arguments

* Remove .transform() from ImageFrameTable<P> and fix Mask node behavior on stencils not fully overlapping its target image

* Remove more .one_instance_ref()

* Fully remove .one_instance_ref() and improve the 'Combine Channels' node robustness

* Fully remove .once_instance_mut()

* Fix tests

* Remove .one_empty_image()

* Make Instances<T>::default() return an empty table for images, but still not yet vector

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-06-04 20:40:15 -07:00
Dennis Kobert
76ecdc8f1b
Fix the 'Upload Texture' node (#2680)
* Fix upload texture node

* Feature gate gpu node implemenations
2025-05-29 04:35:35 -07:00
Keavon Chambers
ac9fb2b02d
Improve instancing nodes (make them output group data, add 'Instance Repeat', fix Flatten Vector Elements click targets, and more) (#2610)
* Improve instancing nodes (make them output group data, add 'Instance Repeat', fix Flatten Vector Elements click targets, and more)

* Fix test?

* Fix more tests?

* Fix moar test??

* Clean up instance method naming
2025-04-22 17:55:57 -07:00
Dennis Kobert
9b23c7e2db
Update Tauri to v2 and execute only the node graph in native (#2362)
* Migrate tauri app to v2

* Move flake files to sub directory

* Remove unused plugins

* Backport some of the tauri code

* Implement async node graph execution

Only move node runtime to native code

* Always use gpu feature for tauri

* Fix serialization

* Add logging filters

* Enable native window rendering with vello

* Cleanup

* Remove unused editor instance

* Remove changes from vite config

* Remove warnings

* Remove unused files

* Fix most tests

* Cleanup

* Apply frontend lint

* Readd flake.nix

* Fix tests using --all-features

* Code review

* Enable all backends

* Fix monitor node downcast types

* Change debug log to a warning

* Disable shader passthrough

* Cleanup unused imports

* Remove warning

* Update project setup instructions

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-14 11:43:15 +00:00
Dennis Kobert
beb1c6ae64
Upgrade to the Rust 2024 edition (#2367)
* Update to rust 2024 edition

* Fixes

* Clean up imports

* Cargo fmt again

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-12 17:29:12 -07:00
Keavon Chambers
2f6c6e28f0 Instance tables refactor part 3: flatten ImageFrame<P> in lieu of Image<P> (#2256)
* Remove ImageFrame<T> by flattening it into Image<T>

* Rename TextureFrame to ImageTexture

* Fix tests
2025-03-06 05:36:17 -08:00
Keavon Chambers
f1160e1ca6 Instance tables refactor part 2: move the transform and alpha_blending fields up a level (#2249)
* Fix domain data structure field plural naming

* Rename method one_item to one_instance

Rename method one_item to one_instance

* Move the Instance<T> methods over to providing an Instance<T>/InstanceMut<T>

Move the Instance<T> methods over to providing an Instance<T>/InstanceMut<T>

* Add transform and alpha_blending fields to Instances<T>

* Finish the refactor (Brush tool is broken though)

* Add test for brush node

* Fix brush node

* Fix default empty images being 1x1 instead of 0x0 as they should be

* Fix tests

* Fix path transform

* Add correct upgrading to move the transform/blending up a level

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-06 05:36:09 -08:00
Dennis Kobert
4ff2bdb04f Replace Footprint/() call arguments with dynamically-bound Contexts (#2232)
* Implement experimental Context struct and traits

* Add Ctx super trait

* Checkpoint

* Return Any instead of DynAny

* Fix send implementation for inputs with lifetimes

* Port more nodes

* Uncomment nodes

* Port more nodes

* Port vector nodes

* Partial progress (the stuff I'm more sure about)

* Partial progress (the stuff that's not compiling and I'm not sure about)

* Fix more errors

* First pass of fixing errors introduced by rebase

* Port wasm application io

* Fix brush node types

* Add type annotation

* Fix warnings and wasm compilation

* Change types for Document Node definitions

* Improve debugging for footprint not found errors

* Forward context in append artboard node

* Fix thumbnails

* Fix loading most demo artwork

* Wrap output type of all nodes in future

* Encode futures as part of the type

* Fix document node definitions for future types

* Remove Clippy warnings

* Fix more things

* Fix opening demo art with manual composition upgrading

* Set correct type for manual composition

* Fix brush

* Fix tests

* Update docs for deps

* Fix up some node signature issues

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-06 05:35:56 -08:00
Dennis Kobert
6becaef980
Fix Vello rendering the infinite canvas without a white background color (#2361)
Fix infinite canvas for vello

Remove debugging fill

Remove debug log
2025-03-06 11:37:00 +00:00
Keavon Chambers
eb0ff20d3c
Instance tables refactor part 1: wrap graphical data in the new Instances<T> struct (#2230)
* Port VectorData to Instances<VectorData>

* Port ImageFrame<P> and TextureFrame to Instances<ImageFrame<P>> and Instances<TextureFrame>

* Avoid mutation with the TransformMut trait

* Port GraphicGroup to Instances<GraphicGroup>

* It compiles!

* Organize debugging

* Document upgrading

* Fix Brush node

* Restore TransformMut in lieu of TransformSet trait

* Fix tests

* Final code review
2025-01-28 23:51:12 -08:00
James Lindsay
fc0cf604df
Update some dependencies (#2134)
* Update some dependencies

* Update to action v2

* Fix for v2
2024-12-12 18:28:49 +00:00
James Lindsay
3b0e9587eb
Update Wasm dependencies to fix WebGPU spec change crash in Firefox with Vello (#2027)
* Update wasm deps

* Bump wasm-bindgen and fix the depricated methods
2024-10-12 14:28:39 -07:00
Dennis Kobert
d2f791cfb3
Make Upload Texture node resolution-aware (#2018)
* Make UploadTextureNode resolution aware

* Add TextureFrame implementations for MonitorNode

* Add TextureFrame implementation to TransformNode
2024-10-03 10:32:34 -07:00
Dennis Kobert
8a1089938e
Path Bool library code cleanup (#2000)
* Remove log statements

* Add feature gates to functions in path.rs

* Fix infinite parsing loop and add new test

* License tweaks

* Remove trailing zero in whole number floats

* Flatten visual-tests directory

* Code review

* Clean up printlines

* Add error handling to path parsing

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-23 12:16:31 +02:00
Dennis Kobert
32da545a49
Fix blend modes and opacity on raster data (#1996)
* Apply alpha blending to images when using vello

* Fix bounds for image layer

* Fix rendering for non vello images
2024-09-20 20:42:39 +00:00
Dennis Kobert
e352c7fa71
Refactor the node macro and simply most of the node implementations (#1942)
* Add support structure for new node macro to gcore

* Fix compile issues and code generation

* Implement new node_fn macro

* Implement property translation

* Fix NodeIO type generation

* Start translating math nodes

* Move node implementation to outer scope to allow usage of local imports

* Add expose attribute to allow controlling the parameter exposure

* Add rust analyzer support for #[implementations] attribute

* Migrate logic nodes

* Handle where clause properly

* Implement argument ident pattern preservation

* Implement adjustment layer mapping

* Fix node registry types

* Fix module paths

* Improve demo artwork comptibility

* Improve macro error reporting

* Fix handling of impl node implementations

* Fix nodeio type computation

* Fix opacity node and graph type resolution

* Fix loading of demo artworks

* Fix eslint

* Fix typo in macro test

* Remove node definitions for Adjustment Nodes

* Fix type alias property generation and make adjustments footprint aware

* Convert vector nodes

* Implement path overrides

* Fix stroke node

* Fix painted dreams

* Implement experimental type level specialization

* Fix poisson disk sampling -> all demo artworks should work again

* Port text node + make node macro more robust by implementing lifetime substitution

* Fix vector node tests

* Fix red dress demo + ci

* Fix clippy warnings

* Code review

* Fix primary input issues

* Improve math nodes and audit others

* Set no_properties when no automatic properties are derived

* Port vector generator nodes (could not derive all definitions yet)

* Various QA changes and add min/max/mode_range to number parameters

* Add min and max for f64 and u32

* Convert gpu nodes and clean up unused nodes

* Partially port transform node

* Allow implementations on call arg

* Port path modify node

* Start porting graphic element nodes

* Transform nodes in graphic_element.rs

* Port brush node

* Port nodes in wasm_executior

* Rename node macro

* Fix formatting

* Fix Mandelbrot node

* Formatting

* Fix Load Image and Load Resource nodes, add scope input to node macro

* Remove unnecessary underscores

* Begin attemping to make nodes resolution-aware

* Infer a generic manual compositon type on generic call arg

* Various fixes and work towards merging

* Final changes for merge!

* Fix tests, probably

* More free line removals!

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-20 03:50:30 -07:00
James Lindsay
bf5019db7b Bezier-rs: Fix crash when outlining a small bézier (#1958)
Fix crash when outlining small bézier
2024-09-05 10:48:12 -07:00
Dennis Kobert
0dfddd529b
Refactor document node type lookup function to fix performance degradation over time (#1878)
* Refactor document_node_types function

* Fix node introspection

* Implement diff based type updates

* Fix missing monitor nodes

* Improve docs and fix warings

* Fix wrongful removal of node paths

* Remove code examples for non pub methodsü

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-08 17:37:28 -07:00
Dennis Kobert
e46af89708
Integrate raw WGPU textures into Vello rendering pipeline (#1897)
* WIP

* Introduce `Raster` enum and plumb texture injection to vello

* Use correct texture formas for usage in vello

* Add missing cache implementations

* Update vello image override api

* Use git version of vello

* Fix type for upload texture node

* Improve crash resiliance

* Fix warnings

* Remove unused node impls
2024-08-06 10:58:22 +00:00
Dennis Kobert
25a82d100f
Set Vello to render an explicit background color behind artboards (#1902)
* Set explicit background color

* Add todo comment for chrome bug
2024-08-06 02:33:39 -07:00
Dennis Kobert
00864e274f
Correctly set the dimensions of the SVG foreignObject container for the Vello canvas (#1907)
* Correctly set the dimensons of the forgein object element

* Remove dead code

* Fix missing default impl

* Set correct default for not wasm32 targets as well
2024-08-06 08:41:56 +00:00
Dennis Kobert
f21c8c1b17
Restructure window state management and fix Vello canvas not resizing with viewport (#1900)
* Restructure window state management

* Disable window creation on ci

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-06 06:18:04 +00:00
Dennis Kobert
ed841803ce
Switch to MSAA for Vello rendering for better anti-aliasing (#1899)
Switch to MSAA for vello rendering
2024-08-05 22:12:37 -07:00
Dennis Kobert
ab71d26d84
Integrate Vello for vector rendering (#1802)
* Start integrating vello into render pipeline

Cache vello render creation

Implement viewport navigation

Close vello path

Add transform parameter to vello render pass

* Fix render node types

* Fix a bunch of bugs in the path translation

* Avoid panic on empty document

* Fix rendering of holes

* Implement image rendering

* Implement graph recompilation afer editor api change

* Implement preferences toggle for using vello as the renderer

* Make surface creation optional

* Feature gate vello usages

* Implement skeleton for radial gradient

* Rename vello preference

* Fix some gradients

* Only update monitor nodes on graph recompile

* Fix warnings + remove dead code

* Update everything except for thumbnails after a node graph evaluation

* Fix missing click targets for Image frames

* Improve perfamance by removing unecessary widget updates

* Fix node graph paning

* Fix thumbnail loading

* Implement proper hash for vector modification

* Fix test and warnings

* Code review

* Fix dep

* Remove warning

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-22 01:56:29 -07:00
Dennis Kobert
212f08c6c8
Restore functionality of GPU infrastructure (#1797)
* Update gpu nodes to compile again

Restructure `gpu-executor` and `wgpu-executor`

And libssl to nix shell

Fix graphene-cli and add half percision color format

Fix texture scaling

Remove vulkan executor

Fix compile errors

Improve execution request deduplication

* Fix warnings

* Fix graph compile issues

* Code review

* Remove test file

* Fix lint

* Wip make node futures send

* Make futures Send on non wasm targets

* Fix warnings

* Fix nested use of block_on

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-15 13:14:48 +00:00
Dennis Kobert
3657b37574
Deprecate LetNodes in favor of new scope API (#1814)
* WIP

* Start deprecating let nodes

* Replace WasmEditorApi network imports with new Scope input

* Add missing unwrap

* Add #[serde(default)] to scope_injections

* Restructure WasmEditorApi definition to be available as a TaggedValue

* Fix text node

* Use stable toolchain in nix shell again

* Code review

* FIx text node and remove all remaining warnings

* Require executor input to be 'static

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-10 14:18:21 +02:00
Keavon Chambers
f7ada701e5
Reorganize cargo dependencies and upgrade most of them (#1815)
* Reorganize cargo dependencies and upgrade most

* cargo update

* Attempt 2

* Polishing changes

* Comment out specta typescript flag-dependent code

* Fix test
2024-07-09 04:08:28 -07:00
adamgerhant
6d74abb4de
Node network subgraph editing (#1750)
* Breadcrumb visualization, nested network consistency, create definitions for Merge internal nodes

* Add index to network inputs, remove imports usage from flatten network

* Replace NodeOutput with NodeInput::Node

* Fully remove imports field, remove unnecessary identity nodes, move Output node to encapsulating network

* Replace previous_outputs with root_node, fix adding artboard/layer to empty network

* Import/Export UI nodes

* Display input/output types dynamically from compiled network

* Add LayerNodeIdentifer::ROOT_PARENT

* Prevent .to_node() on ROOT_PARENT

* Separate NodeGraphMessage and GraphOperationMessage

* General bug fixes with nested networks

* Change layer color, various bug fixes and improvements

* Fix disconnect and set node input for proto nodes and UI export node

* Dashed line to export for previewed node

* Fix deleting proto nodes and nodes that feed into export

* Allow modifications to nodes outside of nested network

* Get network from Node Id parameter

* Change root_node to previous_root_node

* Get TaggedValue from proto node implementation type when disconnecting

* Improve preview functionality and state

* Artboard position and delete children fix

* Name inputs/outputs based on DocumentNodeDefinition or type, fix new artboard/layer insertion

* replace "Link" with "Wire", adjust previewing

* Various bug fixes and improvements

* Modify Sample and Poisson-Disk points, fix incorrect input index and deleting currently viewed node

* Open demo artwork

* Fix opening already upgraded documents and refactor FrontendGraphDataType usages

* Fix deleting within network and other bugs

* Get default node input from compiled network when copying, fix previews, tests, demo artwork

* Code cleanup

* Hide EditorApi and add a comment describing unresolved Import node input types

* Code review

* Replace placeholder ROOT_PARENT NodeId with std::u64::MAX

* Breadcrumb padding

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-06-02 08:01:56 +00:00
Keavon Chambers
0a9bd41be1
Code cleanup and refactoring to enhance consistency (#1695)
- Move message handler payload data into structs
- Organize the file structure used by `editor/src/messages/portfolio/document` `/node_graph` and `/graph_operation`
- Make derive attributes use `serde::Serialize, serde::Deserialize` consistently instead of `use serde::{Deserialize, Serialize};` imports
- Various other code cleanup and refactoring
2024-03-20 21:28:51 -07:00
0HyperCube
6f6fb3bcd4
Upgrade several Rust dependencies (#1613)
`specta` from Hypercube's fork commit to latest upstream commit
`wasm-bindgen` 0.2.87 -> 0.2.91
`spirv-std` from 0.9 to not-yet-merged commit in https://github.com/EmbarkStudios/rust-gpu/pull/1115
`wgpu` 0.17 -> 0.19
`winit` 0.28.6 -> 0.29
`vello` and `vello_svg` from latest upstream commit to not-yet-merged commit in https://github.com/linebender/vello/pull/427
`resvg` 0.36.0 -> 0.39
`glam` 0.24 -> 0.25
`rustybuzz` 0.8.0 -> 0.10.0
`js-sys` and `web-sys` 0.3.55 -> 0.3.67
`usvg` 0.36.0 -> 0.39
`spirv` 0.2.0 -> 0.3

* Update a couple of dependencies

* More test fixing…

* Use upstream Specta instead of fork

* Update comments in Cargo.toml

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-02-17 15:02:41 -08:00
Keavon Chambers
34f952bad1
Convert u64 IDs to newtypes (#1532) 2023-12-22 03:24:13 -08:00
Keavon Chambers
c5ed54cbd2 Rename several node graph structs/fields 2023-12-08 15:30:00 -08:00
Keavon Chambers
d082b15abb Improve naming of several proto nodes 2023-12-08 15:29:46 -08:00
Dennis Kobert
d2450b4d61
Refactor Graphite dependency management (#1455)
* Refactor Graphite dependency management

* Remove deprecated future executor

* Code review nits

* Remove unused dependencies

* Update dependencies and make compile with all features

* Replace use of future_executor with wasm-bindgen-futures

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-12-04 12:39:55 +01:00
Yuri Astrakhan
3d4e3a74e5
A few minor lints and docs (#1436)
* A few minor lints and docs

* Added required packages to compile on Debian-style linux
* Inlined some format args, and removed some `&` in args (they cause about 6% slowdown that compiler cannot inline)
* a few spelling mistakes

* fix fmt
2023-10-18 23:33:10 -07:00
0HyperCube
b881385e3b
Update wasm-bindgen, syn and wgpu (#1398) 2023-08-23 14:53:56 +00:00
0HyperCube
80cc5bee73 Fix clippy lints (#1327)
* Fix clippy lints

* Update formatting

* Remove unsafe send impls

* New type for Rc<NodeContainer>
2023-07-19 16:38:23 +01:00
Dennis Kobert
3c2d371173 Graphene CLI + quantization research (#1320)
* Implement skeleton for graphene-cli

* Configure gpu surface on non wasm32 targets

* Create window with full hd size

* Create window using the graphen-cli

* Use window size for surface creation

* Reuse surface configuration

* Reduce window size for native applications to 800x600

* Add compute pipeline test

* Poll wgpu execution externally

* Remove cache node after texture upload

* Add profiling instructions

* Add more debug markers

* Evaluate extract node before flattening the network

* Reenable hue saturation node for compilation

* Make hue saturation node work on the gpu + make f32 default for user inputs

* Add version of test files without caching

* Only dispatch each workgroup not pixel

* ICE

* Add quantization to gpu code

* Fix quantization

* Load images at graph runtime

* Fix quantization calculation

* Feature gate quantization

* Use git version of autoquant

* Add license to `graphene-cli`

* Fix graphene-cli test case

* Ignore tests on non unix platforms

* Fix flattening test
2023-07-04 17:04:09 +02:00
Alexandru Ică
a5f890289b WebGPU: Switch from rgba8unorm to bgra8unorm to support MacOS (#1306)
* WebGPU: Switch from `rgba8unorm` to `bgra8unorm` to support MacOS

This is a known issue in the Dawn bug database: https://bugs.chromium.org/p/chromium/issues/detail?id=1298618

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>

* Undo the modification to `shader.wgsl`

Apparently I didn't need to modify the order of the channels in
the shader.

Signed-off-by: Ică Alexandru-Gabriel <alexandru@seyhanlee.com>
2023-06-09 15:48:30 +03:00
Dennis Kobert
5b6db0a762 Add document nodes for gpu pipeline nodes (#1292)
* Add document nodes for gpu pipeline nodes

* Load existing frame instead of clearing it

* Feature gate gpu imports
2023-06-08 10:13:19 +02:00