Texture rendering performance problems
Posted by Matteo Battaglio on Jul 14, 2010; 10:15am
URL: https://forum.jogamp.org/Texture-rendering-performance-problems-tp966089.html
Context:
my application renders a video stream of 720x576 pixels @ 25fps on a GLJPanel;
each time a new frame is decoded, the decoder thread calls the panel's repaint() method;
inside the panel's display(GLAutoDrawable) method I use glTexImage2D to draw the frame to a texture [the video frame buffer is stored in a direct ByteBuffer];
My GPU is an ATI Radeon HD 5750 with the latest drivers, the os is win xp 32bit.
I don't experience any performance problem as long as the size of the GLJPanel is small, but when i enlarge the panel to almost full screen, the frame rate is dropped to 15-17 fps;
The strange thing is that decoding the frames without rendering them takes the cpu load to only 5-10%, but with the rendering the cpu jumps to ~55%, even when the panel size is small.
I measured how long it takes to execute the display method using System.nanoTime() and it only takes 2-3 milliseconds, so it's really fast.
Questions:
->What could be the problem that causes the high CPU load while rendering? May it be the transfer of the video frame buffer from the RAM to the GPU?
->Is it safe to overwrite the content of the buffer passed to glTexImage2D just after that call?
->When the panel size is big, the frame rate is dropped to 15-17 fps, but the display() only takes less than 3 millis. Where is the bottleneck? I also tried to measure the time between the repaint() and the display(), but it is constantly around 20 millis...