AnsweredAssumed Answered

fixing CPU Bound OpenGL Application

Question asked by kphillisjr on Nov 6, 2015
Latest reply on Nov 12, 2015 by deedeeyelverton

I have a program that is getting caught being CPU bound by the glCopyTexImage2D instruction. this instruction is called several times, and each time it leads to huge drops in performance.

 

/*
 * This is the First major cpu bound call. This is a copy of a 256 pixel by 128 pixel depth image.
 * I did not expect this to take about 3000 Microseconds.
 */
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 1072, 256, 128, 0); 
/*
 * The program ran for a while longer, and I needed to copy the actual
 * Frame-buffer of the program. This time it was an 960px by 1200px image.
 * This call took about 800 microseconds.
 */
glCopyTexImage2D(GL_TEXTURE_2D, 0, RGBA8, 0, 0, 960, 1200, 0);

/* 
 * Yet another case where I needed a copy of the depth buffer.
 * It took more than 5500 microseconds
 */
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, 1920, 1200, 0);

I am wondering if there is any easy fix to clone the frame-buffer components to a texture without making a call to glCopyTexImage2D.

Outcomes