@@ -99,7 +99,7 @@ class CFrontendIR : public CNodePool
99
99
{
100
100
const auto uvTransformID = selfID+" _uvTransform" ;
101
101
sstr << " \n\t " << uvTransformID << " [label=\" " ;
102
- printMatrix (sstr,uvTransform);
102
+ printMatrix (sstr,* reinterpret_cast < const decltype ( uvTransform)*>(params+_count) );
103
103
sstr << " \" ]" ;
104
104
sstr << " \n\t " << selfID << " -> " << uvTransformID << " [label=\" UV Transform\" ]" ;
105
105
for (uint8_t i=0 ; i<_count; i++)
@@ -140,6 +140,9 @@ class CFrontendIR : public CNodePool
140
140
1 ,0 ,0 ,
141
141
0 ,1 ,0
142
142
);
143
+
144
+ // to make sure there will be no padding inbetween
145
+ static_assert (alignof (SParameter)>=alignof(hlsl::float32_t2x3));
143
146
};
144
147
145
148
// basic "built-in" nodes
@@ -306,9 +309,9 @@ class CFrontendIR : public CNodePool
306
309
if (!pWonky->knots .params [i])
307
310
{
308
311
args.logger .log (" Knot %u parameters invalid" ,system::ILogger::ELL_ERROR,i);
309
- return false ;
312
+ return true ;
310
313
}
311
- return true ;
314
+ return false ;
312
315
}
313
316
NBL_API void printDot (std::ostringstream& sstr, const core::string& selfID) const override ;
314
317
@@ -462,10 +465,8 @@ class CFrontendIR : public CNodePool
462
465
inline uint8_t getChildCount () const override {return 2 ;}
463
466
464
467
inline const std::string_view getTypeName () const override {return " nbl::CFresnel" ;}
465
- static inline uint32_t calc_size ()
466
- {
467
- return sizeof (CFresnel);
468
- }
468
+ static inline uint32_t calc_size () {return sizeof (CFresnel);}
469
+ inline uint32_t getSize () const override {return calc_size ();}
469
470
inline CFresnel () = default;
470
471
471
472
// Already pre-divided Index of Refraction, e.g. exterior/interior since VdotG>0 the ray always arrives from the exterior.
@@ -604,7 +605,8 @@ class CFrontendIR : public CNodePool
604
605
return CNodePool::_delete<T>(h);
605
606
}
606
607
607
- // Each material comes down to this
608
+ // Each material comes down to this, YOU MUST NOT MODIFY THE NODES AFTER ADDING THEIR PARENT TO THE ROOT NODES!
609
+ // TODO: shall we copy and hand out a new handle?
608
610
inline std::span<const TypedHandle<const CLayer>> getMaterials () {return m_rootNodes;}
609
611
inline bool addMaterial (const TypedHandle<const CLayer> rootNode, system::logger_opt_ptr logger)
610
612
{
@@ -653,6 +655,7 @@ class CFrontendIR : public CNodePool
653
655
}
654
656
655
657
core::vector<TypedHandle<const CLayer>> m_rootNodes;
658
+ // TODO: named material Fresnels
656
659
};
657
660
658
661
inline bool CFrontendIR::valid (const TypedHandle<const CLayer> rootHandle, system::logger_opt_ptr logger) const
0 commit comments