@@ -14,6 +14,7 @@ use graph_craft::ProtoNodeIdentifier;
1414use graph_craft:: concrete;
1515use graph_craft:: document:: value:: * ;
1616use graph_craft:: document:: * ;
17+ use graphene_core:: application_io:: TextureFrameTable ;
1718use graphene_core:: raster:: brush_cache:: BrushCache ;
1819use graphene_core:: raster:: image:: ImageFrameTable ;
1920use graphene_core:: raster:: { CellularDistanceFunction , CellularReturnType , Color , DomainWarpType , FractalType , NoiseType , RedGreenBlueAlpha } ;
@@ -1850,6 +1851,91 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
18501851 description: Cow :: Borrowed ( "TODO" ) ,
18511852 properties: None ,
18521853 } ,
1854+ #[ cfg( feature = "gpu" ) ]
1855+ DocumentNodeDefinition {
1856+ identifier: "GPU Invert" ,
1857+ category: "Debug: GPU" ,
1858+ node_template: NodeTemplate {
1859+ document_node: DocumentNode {
1860+ implementation: DocumentNodeImplementation :: Network ( NodeNetwork {
1861+ exports: vec![ NodeInput :: node( NodeId ( 2 ) , 0 ) ] ,
1862+ nodes: [
1863+ DocumentNode {
1864+ inputs: vec![ NodeInput :: scope( "editor-api" ) ] ,
1865+ implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_core::ops::IntoNode<&WgpuExecutor>" ) ) ,
1866+ ..Default :: default ( )
1867+ } ,
1868+ DocumentNode {
1869+ inputs: vec![ NodeInput :: network( concrete!( TextureFrameTable ) , 0 ) , NodeInput :: node( NodeId ( 0 ) , 0 ) ] ,
1870+ manual_composition: Some ( generic!( T ) ) ,
1871+ implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "wgpu_executor::gcore_shader_nodes::GpuInvertNode" ) ) ,
1872+ ..Default :: default ( )
1873+ } ,
1874+ DocumentNode {
1875+ manual_composition: Some ( generic!( T ) ) ,
1876+ inputs: vec![ NodeInput :: node( NodeId ( 1 ) , 0 ) ] ,
1877+ implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_core::memo::ImpureMemoNode" ) ) ,
1878+ ..Default :: default ( )
1879+ } ,
1880+ ]
1881+ . into_iter( )
1882+ . enumerate( )
1883+ . map( |( id, node) | ( NodeId ( id as u64 ) , node) )
1884+ . collect( ) ,
1885+ ..Default :: default ( )
1886+ } ) ,
1887+ // experimentally determined to work
1888+ inputs: vec![ NodeInput :: value( TaggedValue :: None , true ) ] ,
1889+ // inputs: vec![NodeInput::value(TaggedValue::TextureFrame(TextureFrameTable::default()), true)],
1890+ // inputs: vec![],
1891+ // inputs: vec![NodeInput::network(concrete!(TextureFrameTable), 0)],
1892+ ..Default :: default ( )
1893+ } ,
1894+ persistent_node_metadata: DocumentNodePersistentMetadata {
1895+ input_properties: vec![ ( "In" , "TODO" ) . into( ) ] ,
1896+ output_names: vec![ "Texture" . to_string( ) ] ,
1897+ network_metadata: Some ( NodeNetworkMetadata {
1898+ persistent_metadata: NodeNetworkPersistentMetadata {
1899+ node_metadata: [
1900+ DocumentNodeMetadata {
1901+ persistent_metadata: DocumentNodePersistentMetadata {
1902+ display_name: "Extract Executor" . to_string( ) ,
1903+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , 0 ) ) ,
1904+ ..Default :: default ( )
1905+ } ,
1906+ ..Default :: default ( )
1907+ } ,
1908+ DocumentNodeMetadata {
1909+ persistent_metadata: DocumentNodePersistentMetadata {
1910+ display_name: "Upload Texture" . to_string( ) ,
1911+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 7 , 0 ) ) ,
1912+ ..Default :: default ( )
1913+ } ,
1914+ ..Default :: default ( )
1915+ } ,
1916+ DocumentNodeMetadata {
1917+ persistent_metadata: DocumentNodePersistentMetadata {
1918+ display_name: "Cache" . to_string( ) ,
1919+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 14 , 0 ) ) ,
1920+ ..Default :: default ( )
1921+ } ,
1922+ ..Default :: default ( )
1923+ } ,
1924+ ]
1925+ . into_iter( )
1926+ . enumerate( )
1927+ . map( |( id, node) | ( NodeId ( id as u64 ) , node) )
1928+ . collect( ) ,
1929+ ..Default :: default ( )
1930+ } ,
1931+ ..Default :: default ( )
1932+ } ) ,
1933+ ..Default :: default ( )
1934+ } ,
1935+ } ,
1936+ description: Cow :: Borrowed ( "TODO" ) ,
1937+ properties: None ,
1938+ } ,
18531939 DocumentNodeDefinition {
18541940 identifier: "Extract" ,
18551941 category: "Debug" ,
0 commit comments