Hi, I have a question in stack size calculation for continuation callable.
optixUtilComputeStackSizes
computes the size for continuation stack as:
*continuationStackSize
= cssRG + cssCCTree
+ ( std::max( maxTraceDepth, 1u ) - 1 ) * cssCHOrMSPlusCCTree
+ std::min( maxTraceDepth, 1u ) * std::max( cssCHOrMSPlusCCTree, cssIS + cssAH );
For simplicity, assume we have maxTraceDepth = 1
, then we get:
*continuationStackSize
= cssRG + cssCCTree
+ std::max( cssCHOrMSPlusCCTree, cssIS + cssAH );
I don’t understand why cssCCTree
appears twice (the first is cssCCTree
as-is, the second is in cssCHOrMSPlusCCTree
).
Possible call tree I think is the below (if I assume maxCCDepth = 1
:
1. RG - CH - CC
2. RG - MS - CC
3. RG - IS/AH
4. RG - CC - CH // trace call from a CC, user cannot call a CC from CH/MS
5. RG - CC - MS // because maxCCDepth = 1 here.
6. RG - CC - IS/AH
Doesn’t optixUtilComputeStackSizes
assume that the user manages oneself not to call a CC in the paths 4/5?
Thanks.