@@ -61,6 +61,10 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
61
61
convert_node!( from: DVec2 , to: String ) ,
62
62
convert_node!( from: IVec2 , to: String ) ,
63
63
convert_node!( from: DAffine2 , to: String ) ,
64
+ convert_node!( from: Table <Raster <CPU >>, to: Table <Raster <CPU >>, converter: & WgpuExecutor ) ,
65
+ convert_node!( from: Table <Raster <CPU >>, to: Table <Raster <GPU >>, converter: & WgpuExecutor ) ,
66
+ convert_node!( from: Table <Raster <GPU >>, to: Table <Raster <GPU >>, converter: & WgpuExecutor ) ,
67
+ convert_node!( from: Table <Raster <GPU >>, to: Table <Raster <CPU >>, converter: & WgpuExecutor ) ,
64
68
// =============
65
69
// MONITOR NODES
66
70
// =============
@@ -394,21 +398,30 @@ mod node_registry_macros {
394
398
x
395
399
} } ;
396
400
( from: $from: ty, to: $to: ty) => {
401
+ convert_node!( from: $from, to: $to, converter: ( ) )
402
+ } ;
403
+ ( from: $from: ty, to: $to: ty, converter: $convert: ty) => {
397
404
(
398
405
ProtoNodeIdentifier :: new( concat![ "graphene_core::ops::ConvertNode<" , stringify!( $to) , ">" ] ) ,
399
406
|mut args| {
400
407
Box :: pin( async move {
401
- let node = graphene_core:: ops:: ConvertNode :: new( graphene_std:: any:: downcast_node:: <Context , $from>( args. pop( ) . unwrap( ) ) ,
402
- graphene_std:: any:: FutureWrapperNode :: new( graphene_std:: value:: ClonedNode :: new( std:: marker:: PhantomData :: <$to>) ) ) ;
408
+ let mut args = args. drain( ..) ;
409
+ let node = graphene_core:: ops:: ConvertNode :: new(
410
+ graphene_std:: any:: downcast_node:: <Context , $from>( args. next( ) . expect( "Convert node did not get first argument" ) ) ,
411
+ graphene_std:: any:: downcast_node:: <Context , $convert>( args. next( ) . expect( "Convert node did not get converter argument" ) ) ,
412
+ graphene_std:: any:: FutureWrapperNode :: new( graphene_std:: value:: ClonedNode :: new( std:: marker:: PhantomData :: <$to>) )
413
+ ) ;
403
414
let any: DynAnyNode <Context , $to, _> = graphene_std:: any:: DynAnyNode :: new( node) ;
404
415
Box :: new( any) as TypeErasedBox
405
416
} )
406
417
} ,
407
418
{
408
- let node = graphene_core:: ops:: ConvertNode :: new( graphene_std:: any:: PanicNode :: <Context , core:: pin:: Pin <Box <dyn core:: future:: Future <Output = $from> + Send >>>:: new( ) ,
409
-
410
- graphene_std:: any:: FutureWrapperNode :: new( graphene_std:: value:: ClonedNode :: new( std:: marker:: PhantomData :: <$to>) ) ) ;
411
- let params = vec![ fn_type_fut!( Context , $from) ] ;
419
+ let node = graphene_core:: ops:: ConvertNode :: new(
420
+ graphene_std:: any:: PanicNode :: <Context , core:: pin:: Pin <Box <dyn core:: future:: Future <Output = $from> + Send >>>:: new( ) ,
421
+ graphene_std:: any:: PanicNode :: <Context , core:: pin:: Pin <Box <dyn core:: future:: Future <Output = $convert> + Send >>>:: new( ) ,
422
+ graphene_std:: any:: FutureWrapperNode :: new( graphene_std:: value:: ClonedNode :: new( std:: marker:: PhantomData :: <$to>) )
423
+ ) ;
424
+ let params = vec![ fn_type_fut!( Context , $from) , fn_type_fut!( Context , $convert) ] ;
412
425
let node_io = NodeIO :: <' _, Context >:: to_async_node_io( & node, params) ;
413
426
node_io
414
427
} ,
0 commit comments