I need a way to pass some numbers from GPU back to CPU. First I tried:
Image@ img =logTex.GetImage();
Color px = img.GetPixel(0,0);
It worked great for single pixel and I was able to pass four 8-bit numbers back into AngelScript. Problem is, If I try to read more pixels, performance will drop very fast. As I understand, code above stops whole pipeline (both CPU and GPU) for a moment to read a single pixel. And more pixels I read, the longer pipeline stays idle. Not cool.
I know, there should be a better way to do it. Copy image? I don’t mind it to lag a few frames, I just want to pass more data from GPU without stalling whole render pipeline.
Thanks in advance for any thoughts and suggestions.