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