I'm doing a path tracer on GPU, and I got some traced results of pixel data (which is an array of float3) on GPU global memory, what I do to display the array on screen is to copy the array to CPU memory and call OpenGL glTexImage2D
:
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, pixelArray);
then display the texture. pixelArray
is the pixel data array to show. As GPU is the device managing the whole rendering process, is there a way to display the pixelArray
on screen without copying data from GPU to CPU?