We really appreciate ur help for us.
Actually , for each pass during ray tracing there are different number of rays. And we have to copy some data back to CPU to do some work, the size of the data is the same with the ray number. But there is no domainSize for Stream<T>::write, in order to pass less data to CPU, we have to create a new stream with the specific size to exchange data with CPU. Here comes the problem, for large resolution, memory allocation will fail if we create new stream during each loop of ray tracing.( Of course here we delete the stream before creating a new one )
Domain of stream neither solve the problem because it create new stream too. There is no domain size for write.
So is there a way to solve it??
for( loop )
{
pass data to CPU ( size , ray number )
}
( if the stream size doen't change, there will be more data passed to CPU unneccessarily. Actuall , the second time iteration , there are less rays.
Thanks for helping us!